/* === CONTENEUR PRINCIPAL UNIFIÉ === */
.salons-interface {
    background: linear-gradient(135deg, rgba(88, 50, 168, 0.15) 0%, rgba(139, 69, 255, 0.1) 100%);
    backdrop-filter: blur(20px);
    border: 3px solid transparent;
    background-clip: padding-box;
    border-radius: 32px;
    width: 95%;
    max-width: 95%;
    margin: 0 auto;
    padding: 25px;
    min-height: calc(75vh - 140px);
    display: flex;
    gap: 25px;
    position: relative;
    box-shadow: 0 20px 60px rgba(88, 50, 168, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.salons-interface::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 32px;
    padding: 3px;
    background: linear-gradient(135deg, #8B45FF 0%, #FF3CAC 50%, #784BA0 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* === PARTIE GAUCHE === */
.salons-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, rgba(20, 20, 35, 0.95) 0%, rgba(30, 25, 45, 0.95) 100%);
    border: 2px solid rgba(139, 69, 255, 0.3);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* === PARTIE DROITE === */
.salons-right {
    width: 340px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* === TABLEAU DES SALONS === */
.salons-table-container {
    flex: 1;
    overflow-y: auto;
    background: linear-gradient(180deg, rgba(25, 20, 40, 1) 0%, rgba(30, 25, 45, 1) 100%);
}

.salons-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
}

.salons-table thead {
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, rgba(15, 10, 30, 1) 0%, rgba(20, 15, 35, 0.98) 100%);
    z-index: 10;
    box-shadow: 0 2px 10px rgba(139, 69, 255, 0.2);
}

.salons-table th {
    padding: 14px 18px;
    text-align: left;
    color: #B794F6;
    font-weight: 700;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(139, 69, 255, 0.3);
    border-right: 1px solid rgba(139, 69, 255, 0.1);
}

.salons-table th:last-child {
    border-right: none;
}

.salon-row {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid rgba(139, 69, 255, 0.08);
    background: transparent;
    position: relative;
}

.salon-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, #8B45FF 0%, #FF3CAC 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.salon-row:hover {
    background: linear-gradient(90deg, rgba(139, 69, 255, 0.12) 0%, rgba(255, 60, 172, 0.08) 100%);
    transform: translateX(2px);
}

.salon-row:hover::before {
    opacity: 1;
}

.salon-row.officiel {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 193, 7, 0.05) 100%);
}

.salon-row.officiel::before {
    background: linear-gradient(135deg, #FFD700 0%, #FFC107 100%);
}

.salon-row.officiel:hover {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 193, 7, 0.1) 100%);
}

.salons-table td {
    padding: 14px 18px;
    color: #E5DEFF;
    font-size: 0.9em;
    border-right: 1px solid rgba(139, 69, 255, 0.05);
}

.salons-table td:last-child {
    border-right: none;
}

.salon-jeu {
    font-weight: 700;
    color: #B794F6;
    font-size: 1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-officiel {
    display: inline-block;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1a2e;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.7em;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.salon-nom {
    color: #FFFFFF;
    font-weight: 600;
}

.salon-createur {
    display: block;
    font-size: 11px;
    color: #9F7AEA;
    margin-top: 4px;
    font-weight: 500;
}

.joueurs-count {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(139, 69, 255, 0.25) 0%, rgba(255, 60, 172, 0.2) 100%);
    border: 1px solid rgba(139, 69, 255, 0.4);
    border-radius: 16px;
    color: #E9D5FF;
    font-size: 0.9em;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(139, 69, 255, 0.2);
}

/* === CHAT === */
.salons-chat {
    background: linear-gradient(135deg, rgba(20, 15, 35, 1) 0%, rgba(30, 20, 45, 1) 100%);
    border-top: 3px solid rgba(139, 69, 255, 0.4);
    display: flex;
    flex-direction: column;
    height: 280px;
    position: relative;
    /* Transition retirée pour éviter que l'input ne suive la barre */
}

.salons-chat::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #8B45FF 0%, #FF3CAC 50%, #784BA0 100%);
}

/* Barre de contrôle pour agrandir/réduire le chat */
.chat-toggle-bar {
    padding: 6px 18px;
    background: linear-gradient(135deg, rgba(139, 69, 255, 0.2) 0%, rgba(255, 60, 172, 0.15) 100%);
    border-bottom: 2px solid rgba(139, 69, 255, 0.3);
    cursor: ns-resize;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    flex-shrink: 0;
}

.chat-toggle-bar:hover {
    background: linear-gradient(135deg, rgba(139, 69, 255, 0.35) 0%, rgba(255, 60, 172, 0.25) 100%);
    border-bottom-color: rgba(139, 69, 255, 0.6);
}

.chat-toggle-bar.dragging {
    background: linear-gradient(135deg, rgba(139, 69, 255, 0.5) 0%, rgba(255, 60, 172, 0.4) 100%);
    border-bottom-color: rgba(139, 69, 255, 0.8);
    box-shadow: 0 0 20px rgba(139, 69, 255, 0.5);
}

.chat-toggle-bar.dragging .toggle-icon {
    transform: scale(1.05);
}

.toggle-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #E9D5FF;
    font-weight: 600;
    font-size: 0.75em;
    transition: all 0.3s ease;
}

.toggle-icon .arrow-up,
.toggle-icon .arrow-down {
    font-size: 0.9em;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 8px rgba(139, 69, 255, 0.6));
}

.toggle-icon.expanded .arrow-up {
    display: none;
}

.toggle-icon:not(.expanded) .arrow-down {
    display: none;
}

.toggle-icon .arrow-up {
    animation: bounceUp 1.5s ease-in-out infinite;
}

.toggle-icon .arrow-down {
    animation: bounceDown 1.5s ease-in-out infinite;
}

@keyframes bounceUp {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

.toggle-text {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 0 10px rgba(139, 69, 255, 0.5);
}

/* Wrapper pour le contenu du chat (messages + input) */
.chat-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: transparent;
    min-height: 0;
}

.chat-message {
    font-size: 0.88em;
    color: #E5DEFF;
    line-height: 1.5;
    padding: 6px 12px;
    border-radius: 12px;
    background: rgba(139, 69, 255, 0.05);
    border-left: 3px solid rgba(139, 69, 255, 0.3);
    transition: all 0.2s ease;
}

.chat-message:hover {
    background: rgba(139, 69, 255, 0.12);
    border-left-color: rgba(139, 69, 255, 0.6);
    transform: translateX(2px);
}

.msg-time {
    color: #9F7AEA;
    margin-right: 8px;
    font-size: 0.9em;
    font-weight: 600;
}

.msg-pseudo {
    color: #E9D5FF;
    font-weight: 700;
    margin-right: 8px;
    text-shadow: 0 0 10px rgba(139, 69, 255, 0.5);
}

.msg-text {
    color: #E5DEFF;
}

.chat-input-container {
    display: flex;
    padding: 12px 18px;
    gap: 12px;
    background: linear-gradient(135deg, rgba(15, 10, 30, 0.95) 0%, rgba(20, 15, 35, 0.95) 100%);
    border-top: 1px solid rgba(139, 69, 255, 0.2);
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.chat-input {
    flex: 1;
    padding: 10px 16px;
    background: rgba(30, 25, 50, 0.8);
    border: 2px solid rgba(139, 69, 255, 0.3);
    border-radius: 16px;
    color: #ffffff;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.chat-input:focus {
    outline: none;
    border-color: rgba(139, 69, 255, 0.7);
    box-shadow: 0 0 20px rgba(139, 69, 255, 0.3);
    background: rgba(30, 25, 50, 1);
}

.chat-input::placeholder {
    color: #9F7AEA;
}

.chat-send-btn {
    padding: 10px 18px;
    background: linear-gradient(135deg, #8B45FF 0%, #FF3CAC 100%);
    border: none;
    border-radius: 16px;
    color: white;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(139, 69, 255, 0.4);
}

.chat-send-btn:hover {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 6px 25px rgba(139, 69, 255, 0.6);
}

.chat-send-btn:active {
    transform: scale(0.95) rotate(0deg);
}

/* === BOUTON CRÉER PARTIE === */
.btn-create-partie {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #8B45FF 0%, #FF3CAC 100%);
    border: none;
    border-radius: 20px;
    color: white;
    font-size: 1.05em;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(139, 69, 255, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-create-partie::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-create-partie:hover::before {
    width: 300px;
    height: 300px;
}

.btn-create-partie:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 35px rgba(139, 69, 255, 0.7),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-create-partie:active {
    transform: translateY(-1px) scale(0.98);
}

/* === SIDEBAR SECTIONS === */
.sidebar-section {
    background: linear-gradient(135deg, rgba(30, 25, 45, 0.95) 0%, rgba(40, 30, 55, 0.95) 100%);
    border: 2px solid rgba(139, 69, 255, 0.3);
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.sidebar-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #8B45FF 0%, #FF3CAC 50%, #784BA0 100%);
}

.sidebar-section h4 {
    margin: 0 0 16px 0;
    color: #E9D5FF;
    font-size: 1em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-top: 4px;
}

/* === FILTRES === */
.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 8px;
    background: rgba(30, 25, 50, 0.6);
    border: 1px solid rgba(139, 69, 255, 0.2);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-checkbox:hover {
    background: rgba(40, 35, 60, 0.8);
    border-color: rgba(139, 69, 255, 0.5);
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(139, 69, 255, 0.2);
}

.filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #8B45FF;
}

.filter-icon {
    font-size: 1.3em;
    filter: drop-shadow(0 0 8px rgba(139, 69, 255, 0.5));
}

.filter-checkbox span:not(.filter-icon):not(.filter-count) {
    flex: 1;
    color: #E5DEFF;
    font-size: 0.95em;
    font-weight: 600;
}

.filter-count {
    color: #B794F6;
    font-size: 0.9em;
    font-weight: 700;
    padding: 2px 8px;
    background: rgba(139, 69, 255, 0.2);
    border-radius: 8px;
}

/* === MEMBRES CONNECTÉS === */
.membres-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-height: 400px;
}

.membres-liste {
    flex: 1;
    overflow-y: auto;
}

.membres-liste::-webkit-scrollbar {
    width: 8px;
}

.membres-liste::-webkit-scrollbar-track {
    background: rgba(20, 15, 35, 0.5);
    border-radius: 4px;
}

.membres-liste::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #8B45FF 0%, #FF3CAC 100%);
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(139, 69, 255, 0.5);
}

.membres-liste::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #9F5AFF 0%, #FF4DB8 100%);
}

.membre-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 8px;
    background: rgba(30, 25, 50, 0.6);
    border: 1px solid rgba(139, 69, 255, 0.2);
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.membre-item:hover {
    background: rgba(40, 35, 60, 0.8);
    border-color: rgba(139, 69, 255, 0.5);
    transform: translateX(6px);
    box-shadow: 0 4px 15px rgba(139, 69, 255, 0.3);
}

.membre-statut {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}

.membre-statut::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: inherit;
    filter: blur(6px);
    opacity: 0.6;
    z-index: -1;
}

.membre-statut.en_ligne {
    background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.8);
}

.membre-statut.absent {
    background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.8);
}

.membre-statut.occupe {
    background: linear-gradient(135deg, #EF4444 0%, #F87171 100%);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.8);
}

.membre-pseudo {
    color: #E5DEFF;
    font-size: 0.95em;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(139, 69, 255, 0.3);
}

/* === MENTIONS DANS LE CHAT === */
.mention {
    background: linear-gradient(135deg, rgba(139, 69, 255, 0.25) 0%, rgba(255, 60, 172, 0.2) 100%);
    color: #E9D5FF;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(139, 69, 255, 0.5);
    box-shadow: 0 2px 8px rgba(139, 69, 255, 0.3);
}

.mention:hover {
    background: linear-gradient(135deg, rgba(139, 69, 255, 0.4) 0%, rgba(255, 60, 172, 0.35) 100%);
    border-color: #8B45FF;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 69, 255, 0.5);
}

/* === SCROLLBARS === */
.salons-table-container::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    width: 10px;
}

.salons-table-container::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track {
    background: rgba(20, 15, 35, 0.5);
    border-radius: 5px;
}

.salons-table-container::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #8B45FF 0%, #FF3CAC 100%);
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(139, 69, 255, 0.5);
}

.salons-table-container::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #9F5AFF 0%, #FF4DB8 100%);
    box-shadow: 0 0 15px rgba(139, 69, 255, 0.7);
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .salons-interface {
        flex-direction: column;
        gap: 15px;
    }
    
    .salons-right {
        width: 100%;
    }
    
    .membres-section {
        max-height: 250px;
    }
}

@media (max-width: 768px) {
    .salons-interface {
        padding: 15px;
    }
    
    .salons-table th,
    .salons-table td {
        padding: 8px 10px;
        font-size: 0.85em;
    }
    
    .chat-messages {
        font-size: 0.8em;
    }
    
    .sidebar-section {
        padding: 12px;
    }
}

/* ========================================== */
/* RESPONSIVE MOBILE - ONGLETS */
/* ========================================== */

@media (max-width: 1024px) {
    /* Masquer totalement la structure desktop */
    .salons-interface {
        display: none !important;
    }

    /* Onglets navigation */
    .mobile-tabs {
        display: flex;
        background: linear-gradient(135deg, rgba(15, 10, 30, 1) 0%, rgba(20, 15, 35, 1) 100%);
        border-bottom: 2px solid rgba(139, 69, 255, 0.3);
        position: sticky;
        top: 0;
        z-index: 20;
        border-radius: 20px 20px 0 0;
    }

    .mobile-tab {
        flex: 1;
        padding: 12px 8px;
        background: none;
        border: none;
        color: #9F7AEA;
        font-size: 0.85em;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        border-bottom: 3px solid transparent;
        margin-bottom: -2px;
    }

    .mobile-tab.active {
        color: #E9D5FF;
        border-bottom-color: #8B45FF;
        background: rgba(139, 69, 255, 0.1);
    }

    .mobile-tab-icon {
        font-size: 1.2em;
    }

    /* Panneau contenu onglets */
    .mobile-panel {
        display: none;
        padding: 15px;
        background: linear-gradient(135deg, rgba(20, 20, 35, 0.97) 0%, rgba(30, 25, 45, 0.97) 100%);
    }

    .mobile-panel.active {
        display: block;
    }

    /* Structure mobile */
    .salons-mobile-wrapper {
        display: flex;
        flex-direction: column;
        width: 100%;
        border-radius: 20px;
        overflow: hidden;
        border: 2px solid rgba(139, 69, 255, 0.3);
        background: linear-gradient(135deg, rgba(20, 20, 35, 0.97) 0%, rgba(30, 25, 45, 0.97) 100%);
        box-shadow: 0 20px 60px rgba(88, 50, 168, 0.3);
    }

    /* Tableau dans l'onglet Parties */
    .mobile-table-container {
        overflow-x: auto;
        border-radius: 12px;
        overflow-y: auto;
        max-height: 45vh;
    }

    /* Bouton créer partie dans l'onglet */
    .mobile-btn-create {
        width: 100%;
        padding: 13px;
        background: linear-gradient(135deg, #8B45FF 0%, #FF3CAC 100%);
        border: none;
        border-radius: 14px;
        color: white;
        font-size: 0.95em;
        font-weight: 800;
        cursor: pointer;
        margin-bottom: 14px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        box-shadow: 0 6px 20px rgba(139, 69, 255, 0.4);
    }

    /* Panel chat */
    .mobile-chat-panel {
        display: none;
        flex-direction: column;
        padding: 0 !important;
        height: calc(55vh - 100px);
        background: linear-gradient(135deg, rgba(15, 10, 30, 1) 0%, rgba(25, 18, 40, 1) 100%);
    }

    .mobile-chat-panel.active {
        display: flex !important;
    }

    .mobile-chat-messages {
        flex: 1;
        overflow-y: auto;
        padding: 10px 14px;
        display: flex;
        flex-direction: column;
        gap: 5px;
        background: linear-gradient(135deg, rgba(15, 10, 30, 1) 0%, rgba(25, 18, 40, 1) 100%);
    }

    .mobile-chat-input-row {
        display: flex;
        padding: 8px 12px;
        gap: 10px;
        border-top: 1px solid rgba(139, 69, 255, 0.2);
        background: rgba(10, 7, 25, 0.98);
        flex-shrink: 0;
    }

    /* Membres liste mobile */
    .mobile-membres-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
        max-height: 50vh;
        overflow-y: auto;
    }

    /* Filtres mobile */
    .mobile-filtres-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
}

@media (min-width: 1025px) {
    .mobile-tabs,
    .salons-mobile-wrapper {
        display: none !important;
    }
}
