/* ============================================================
   💬 CHAT DIRECT - Styles NoraDrops
   public/css/chatdirect.css
   ============================================================ */

/* Variables couleur Nora */
:root {
    --nora-yellow: #f0b90b;
    --nora-yellow-light: rgba(240, 185, 11, 0.2);
    --nora-yellow-hover: rgba(240, 185, 11, 0.3);
}

/* ============================================================
   🎨 CONTAINER PRINCIPAL
   ============================================================ */

.chatdirect-section {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 15px;
    margin: 5%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ============================================================
   📌 HEADER
   ============================================================ */

.chatdirect-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #555;
    background-image: none;
    background-image: repeating-linear-gradient( 45deg, rgba(106, 106, 106, 0.1) 0px, rgba(157, 157, 157, 0) 1px, #53535336 1px, #00000012 5px );
    border-bottom: 2px solid rgba(240, 185, 11, 0.2);
}

.chatdirect-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
}

.chatdirect-title i {
    color: var(--nora-yellow);
    font-size: 1.2rem;
}

.chatdirect-users-count {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--nora-yellow-light);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--nora-yellow);
}

.chatdirect-users-count i {
    font-size: 8px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.chatdirect-toggle-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chatdirect-toggle-btn:hover {
    background: var(--nora-yellow-hover);
    transform: scale(1.1);
}

/* ============================================================
   📦 BODY
   ============================================================ */

.chatdirect-body {
    position: relative;
    transition: all 0.3s ease;
}

.chatdirect-body.collapsed {
    height: 0;
    overflow: hidden;
}

/* ============================================================
   👤 POPUP PSEUDO (Visiteurs)
   ============================================================ */

.chatdirect-pseudo-popup {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(5px);
}

.pseudo-popup-content {
    text-align: center;
    padding: 30px;
}

.pseudo-popup-content h3 {
    color: #fff;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.pseudo-popup-content h3 i {
    color: var(--nora-yellow);
    margin-right: 8px;
}

.pseudo-popup-content p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
}

.pseudo-input-wrapper {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 10px;
}

.pseudo-input-wrapper input {
    padding: 12px 16px;
    border: 2px solid rgba(240, 185, 11, 0.3);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 1rem;
    width: 200px;
    transition: all 0.3s ease;
}

.pseudo-input-wrapper input:focus {
    outline: none;
    border-color: var(--nora-yellow);
    box-shadow: 0 0 15px rgba(240, 185, 11, 0.3);
}

.pseudo-input-wrapper button {
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--nora-yellow) 0%, #d4a00a 100%);
    border: none;
    border-radius: 8px;
    color: #000;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pseudo-input-wrapper button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(240, 185, 11, 0.4);
}

.pseudo-hint {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

.pseudo-error {
    display: block;
    color: #ff6b6b;
    font-size: 0.85rem;
    margin-top: 10px;
    min-height: 20px;
}

/* ============================================================
   👥 LAYOUT MAIN + SIDEBAR
   ============================================================ */

.chatdirect-main {
    display: flex;
    height: 400px;
}

/* ============================================================
   💬 ZONE MESSAGES
   ============================================================ */

.chatdirect-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
}

/* Scrollbar personnalisée */
.chatdirect-messages::-webkit-scrollbar {
    width: 6px;
}

.chatdirect-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.chatdirect-messages::-webkit-scrollbar-thumb {
    background: var(--nora-yellow);
    border-radius: 3px;
}

.chat-loading {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.chat-load-more {
    text-align: center;
    margin-bottom: 15px;
    display: none;
}

.chat-load-more button {
    background: var(--nora-yellow-light);
    border: 1px solid rgba(240, 185, 11, 0.3);
    color: var(--nora-yellow);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.chat-load-more button:hover {
    background: var(--nora-yellow-hover);
}

.chat-messages-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ============================================================
   👥 SIDEBAR UTILISATEURS
   ============================================================ */

.chatdirect-sidebar {
    width: 200px;
    background: rgba(0, 0, 0, 0.3);
    border-left: 1px solid rgba(240, 185, 11, 0.19);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--nora-yellow);
    font-weight: 600;
    font-size: 0.85rem;
    background: rgb(26, 26, 26);
}

.sidebar-header i {
    font-size: 0.9rem;
}

.sidebar-users-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: #121212;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: background 0.2s ease;
}

.sidebar-user:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-user.member {
    border-left: 2px solid var(--nora-yellow);
}

.sidebar-user.visitor {
    border-left: 2px solid #4a90a4;
}

.sidebar-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.sidebar-avatar-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.sidebar-avatar-icon.visitor {
    background: rgba(74, 144, 164, 0.2);
    color: #4a90a4;
}

.sidebar-user-name {
    flex: 1;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-name.is-member {
    color: var(--nora-yellow);
}

.sidebar-member-badge {
    color: var(--nora-yellow);
    font-size: 0.65rem;
}

/* Scrollbar sidebar */
.sidebar-users-list::-webkit-scrollbar {
    width: 4px;
}

.sidebar-users-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

/* ============================================================
   📝 MESSAGE INDIVIDUEL
   ============================================================ */

.chat-message {
    display: flex;
    gap: 12px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
}

.chat-message:hover {
    background: rgba(255, 255, 255, 0.06);
}

.chat-message.member {
    border-left: 3px solid var(--nora-yellow);
}

.chat-message.visitor {
    border-left: 3px solid #4a90a4;
}

.chat-message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #2a2a3e;
}

/* Icône avatar pour visiteurs */
.chat-avatar-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.chat-avatar-icon.visitor {
    background: rgba(74, 144, 164, 0.2);
    color: #4a90a4;
}

.chatdirect-user-info .chat-avatar-icon {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
}

.chat-message-content {
    flex: 1;
    min-width: 0;
}

.chat-message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.chat-message-pseudo {
    font-weight: 600;
    color: #fff;
    font-size: 0.9rem;
}

.chat-message-pseudo.is-member {
    color: var(--nora-yellow);
}

.member-badge {
    color: var(--nora-yellow);
    font-size: 0.75rem;
}

.chat-message-time {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
}

.chat-message-text {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
    margin: 0;
}

/* ============================================================
   🛡️ ACTIONS MODÉRATION
   ============================================================ */

.chat-mod-actions {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    gap: 5px;
}

.chat-message:hover .chat-mod-actions {
    display: flex;
}

.mod-delete-btn,
.mod-ban-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mod-delete-btn {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

.mod-delete-btn:hover {
    background: rgba(255, 107, 107, 0.4);
}

.mod-ban-btn {
    background: rgba(255, 165, 0, 0.2);
    color: #ffa500;
}

.mod-ban-btn:hover {
    background: rgba(255, 165, 0, 0.4);
}

/* ============================================================
   ⌨️ BARRE D'ENVOI
   ============================================================ */

.chatdirect-input-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: #1a1a1a;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.chatdirect-user-info {
    display: none;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.chat-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #2a2a3e;
}

.chat-user-name {
    color: var(--nora-yellow);
    font-weight: 600;
    font-size: 0.85rem;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chatdirect-input-wrapper {
    flex: 1;
    display: flex;
    gap: 10px;
}

.chatdirect-input-wrapper input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.chatdirect-input-wrapper input:focus {
    outline: none;
    border-color: rgba(240, 185, 11, 0.5);
}

.chatdirect-input-wrapper input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chatdirect-input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#chatSendBtn {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--nora-yellow) 0%, #d4a00a 100%);
    color: #000;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

#chatSendBtn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 5px 20px rgba(240, 185, 11, 0.4);
}

#chatSendBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================
   🚫 BANNI
   ============================================================ */

.chatdirect-banned {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    text-align: center;
}

.chatdirect-banned i {
    font-size: 3rem;
    color: #ff6b6b;
    margin-bottom: 15px;
}

.chatdirect-banned p {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.chatdirect-banned span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* ============================================================
   📱 RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .chatdirect-section {
        border-radius: 10px;
    }
    
    .chatdirect-main {
        height: 400px;
    }
    
    .chatdirect-sidebar {
        display: none;
    }
    
    .chatdirect-user-info {
        display: none !important;
    }
    
    .chat-message {
        padding: 8px 10px;
    }
    
    .chat-message-avatar {
        width: 32px;
        height: 32px;
    }
    
    .chatdirect-input-bar {
        padding: 10px 15px;
    }
    
    .pseudo-input-wrapper {
        flex-direction: column;
        align-items: center;
    }
    
    .pseudo-input-wrapper input {
        width: 100%;
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .chatdirect-section {
    z-index: 900;
    position: relative;
    }

    .chatdirect-header {
        padding: 12px 15px;
    }
    
    .chatdirect-title {
        font-size: 1rem;
    }
    
    .chatdirect-main {
        height: 350px;
    }
    
    .chat-message-text {
        font-size: 0.85rem;
    }
}