/* =========================
   BOUTON AMIS DU HEADER
========================= */

.friends-button {
    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: none;
    border-radius: 8px;

    background: transparent;
    color: #b8b8ca;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}


.friends-button:hover {
    background: #191927;
    color: #ffffff;
}


.friends-icon {
    width: 22px;
    height: 22px;
}


/* =========================
   FRIENDS SIDEBAR
========================= */

.friends-sidebar {
    position: fixed;

    top: 98px;
    right: 0;

    width: 320px;
    height: calc(100vh - 98px);

    display: flex;
    flex-direction: column;

    background: #0d0d16;

    border-left: 1px solid #29293d;

    box-shadow:
        -12px 0 35px rgba(0, 0, 0, 0.35);

    z-index: 1000;

    transform: translateX(0);

    transition:
        transform 0.25s ease;
}


/* Cachée vers la droite */

.friends-sidebar-hidden {
    transform: translateX(100%);
}


/* =========================
   HEADER SIDEBAR
========================= */

.friends-sidebar-header {
    min-height: 64px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 18px;

    border-bottom: 1px solid #29293d;

    background: #11111c;
}


.friends-sidebar-header h2 {
    margin: 0;

    color: #ffffff;

    font-size: 19px;
    font-weight: 600;
}


.friends-sidebar-close {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 7px;

    background: transparent;
    color: #9292a8;

    font-size: 20px;

    cursor: pointer;
}


.friends-sidebar-close:hover {
    background: #222232;
    color: #ffffff;
}


/* =========================
   LISTE
========================= */

.friends-sidebar-list {
    flex: 1;

    padding: 10px;

    overflow-y: auto;
}


.friends-empty {
    margin-top: 30px;

    color: #77778d;

    text-align: center;

    font-size: 14px;
}


/* =========================
   AMI
========================= */

.friend-item {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 11px;

    margin-bottom: 4px;

    border: none;
    border-radius: 10px;

    background: transparent;

    color: white;

    text-align: left;

    cursor: pointer;

    transition: background 0.15s ease;
}


.friend-item:hover {
    background: #181826;
}


/* Avatar */

.friend-avatar {
    width: 44px;
    height: 44px;

    flex-shrink: 0;

    border-radius: 50%;

    object-fit: cover;

    background: #252538;
}


/* Informations */

.friend-info {
    flex: 1;
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 4px;
}


.friend-top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 8px;
}


.friend-alias {
    color: #ffffff;

    font-size: 14px;
    font-weight: 600;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* =========================
   STATUT
========================= */

.friend-status {
    flex-shrink: 0;

    font-size: 11px;
}


.friend-status.online {
    color: #4ade80;
}


.friend-status.offline {
    color: #6f6f82;
}


/* =========================
   DERNIER MESSAGE
========================= */

.friend-last-message {
    max-width: 210px;

    color: #89899e;

    font-size: 12px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* =========================
   MINI CHAT
========================= */

.friend-chat {
    position: fixed;

    right: 24px;
    bottom: 20px;

    width: 340px;
    height: 430px;

    display: flex;
    flex-direction: column;

    background: #0d0d16;

    border: 1px solid #343448;
    border-radius: 12px;

    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.5);

    overflow: hidden;

    z-index: 1100;
}


.friend-chat.hidden {
    display: none;
}


/* =========================
   HEADER CHAT
========================= */

.friend-chat-header {
    min-height: 58px;

    display: flex;
    align-items: center;

    gap: 10px;

    padding: 0 14px;

    background: #141420;

    border-bottom: 1px solid #29293d;
}


.friend-chat-header strong {
    flex: 1;

    color: #ffffff;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.friend-chat-avatar {
    width: 36px;
    height: 36px;

    border-radius: 50%;

    object-fit: cover;

    background: #29293b;
}


.friend-chat-close {
    width: 32px;
    height: 32px;

    border: none;
    border-radius: 7px;

    background: transparent;

    color: #9999ac;

    font-size: 22px;

    cursor: pointer;
}


.friend-chat-close:hover {
    background: #252536;
    color: white;
}


/* =========================
   MESSAGES
========================= */

.friend-chat-messages {
    flex: 1;

    padding: 14px;

    overflow-y: auto;

    background: #090910;
}


.friend-chat-message {
    margin-bottom: 10px;

    color: #d9d9e5;

    font-size: 14px;

    line-height: 1.4;

    word-break: break-word;
}


.friend-chat-message strong {
    color: #a78bfa;
}


/* =========================
   FORMULAIRE
========================= */

.friend-chat-form {
    display: flex;

    gap: 8px;

    padding: 12px;

    background: #141420;

    border-top: 1px solid #29293d;
}


.friend-chat-form input {
    flex: 1;
    min-width: 0;

    padding: 10px 12px;

    border: 1px solid #343448;
    border-radius: 8px;

    outline: none;

    background: #090910;

    color: white;
}


.friend-chat-form input::placeholder {
    color: #6f6f83;
}


.friend-chat-form input:focus {
    border-color: #8b5cf6;
}


.friend-chat-form button {
    padding: 9px 13px;

    border: none;
    border-radius: 8px;

    background: #7c3aed;

    color: white;

    cursor: pointer;
}


.friend-chat-form button:hover {
    background: #8b5cf6;
}


/* =========================
   SCROLLBAR
========================= */

.friends-sidebar-list::-webkit-scrollbar,
.friend-chat-messages::-webkit-scrollbar {
    width: 6px;
}


.friends-sidebar-list::-webkit-scrollbar-thumb,
.friend-chat-messages::-webkit-scrollbar-thumb {
    background: #343448;

    border-radius: 10px;
}


/* =========================
   MOBILE
========================= */

@media (max-width: 700px) {

    .friends-sidebar {
        width: 280px;
    }


    .friend-chat {
        right: 10px;
        bottom: 10px;

        width: calc(100% - 20px);
        max-width: 340px;

        height: 400px;
    }
}