
:root {
    --primary-color: #2f4b78;
    --secondary-color: #142137;
    --accent-color: #84d1f4;
    --success: #28a745;
    --error: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --text-light: #ffffff;
    --text-dark: #333333;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --bg-light: #f5f5f5;
    --bg-dark: #1a1a1a;
    --bg-primary: #2f4b78;
    --bg-secondary: #142137;
    --border-light: rgba(255,255,255,0.1);
    --border-radius-md: 10px;
    --shadow-sm: 0 2px 6px rgba(0,0,0,0.15);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.25);
    --shadow-lg: 0 4px 15px rgba(0,0,0,0.3);
    --gradient-primary: linear-gradient(135deg, #2f4b78, #84d1f4);
    --gradient-secondary: linear-gradient(135deg, #142137, #2f4b78);
    --gradient-cool: linear-gradient(135deg, #84d1f4, #2f4b78);
    --transition-speed: 0.3s ease;
    --header-height: 90px;
}
/* ===== SÉLECTEUR DE LANGUE (MOBILE) ===== */
.language-btn-mobile {
    display: none;
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all var(--transition-speed);
}

.language-btn-mobile:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}
.language-sidebar {
    position: fixed;
    right: -350px;
    top: 0;
    width: 350px;
    height: 100vh;
    background: var(--text-light);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    transition: right var(--transition-speed);
    overflow-y: auto;
  }
  .language-sidebar.show {
    right: 0;
  }
  
  .sidebar-header {
    background: var(--primary-color);
    color: var(--text-light);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .sidebar-header h3 {
    margin: 0;
    font-size: 18px;
  }
  
  .close-sidebar {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar-content {
    padding: 20px 0;
    display: flex;
    flex-direction: column;
  }
  
  .sidebar-language-option {
    background: none;
    border: none;
    padding: 15px 20px;
    text-align: left;
    cursor: pointer;
    color: var(--text-dark);
    font-size: 16px;
    transition: all 0.3s;
    border-bottom: 1px solid #eee;
  }
  
  .sidebar-language-option:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
    font-weight: bold;
    padding-left: 30px;
  }
  
  .sidebar-language-option.active {
    background-color: var(--accent-color);
    color: var(--primary-color);
    font-weight: bold;
  }



/* ===== MESSAGERIE STYLES ===== */




.messaging-container {
    display: flex;
    gap: 0;
    height: calc(100vh - 100px);
    background: white;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

/* SIDEBAR CONVERSATIONS */
.messaging-sidebar {
    width: 30%;
    border-right: 2px solid var(--accent-color);
    display: flex;
    flex-direction: column;
    background: white;
}

.messaging-header {
    padding: 20px;
    border-bottom: 2px solid var(--accent-color);
}

.messaging-header h2 {
    font-size: 20px;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 600;
}

.search-box {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid var(--accent-color);
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.search-box:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(132, 209, 244, 0.2);
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.conversation-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color var(--transition-speed);
    display: flex;
    gap: 12px;
    align-items: center;
}

.conversation-item:hover {
    background-color: #f9f9f9;
}

.conversation-item.active {
    background: linear-gradient(90deg, rgba(132, 209, 244, 0.15) 0%, transparent 100%);
    border-left: 4px solid var(--accent-color);
    padding-left: 16px;
}

.conversation-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
    flex-shrink: 0;
    position: relative;
    transform: translateY(-8px);
}

.conversation-avatar.online::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--success);
    border-radius: 50%;
    bottom: 0;
    right: 0;
    border: 2px solid white;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-name {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.conversation-preview {
    font-size: 13px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-time {
    font-size: 12px;
    color: #bbb;
    flex-shrink: 0;
}

.unread-badge {
    background: var(--accent-color);
    color: var(--primary-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

/* CHAT AREA */
.messaging-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.chat-header {
    padding: 20px;
    border-bottom: 2px solid var(--accent-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-header-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    position: relative;
    transform: translateY(-5px);
}

.chat-header-avatar.online::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--success);
    border-radius: 50%;
    bottom: 0;
    right: 0;
    border: 2px solid white;
}

.chat-header-details h3 {
    color: var(--primary-color);
    margin-bottom: 4px;
    font-size: 16px;
    font-weight: 600;
}

.chat-header-status {
    font-size: 12px;
    color: var(--success);
    font-weight: 500;
}

.chat-header-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--primary-color);
    transition: transform var(--transition-speed), color var(--transition-speed);
    padding: 5px;
}

.action-btn:hover {
    color: var(--accent-color);
    transform: scale(1.1);
}

/* MESSAGES */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fafafa;
}

.message-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: flex-end;
}

.message-group.sent {
    justify-content: flex-end;
}

.message-group.sent .message-avatar {
    order: 2;
}

.message-group.sent .message-bubble {
    background: var(--primary-color);
    color: var(--text-light);
    border-radius: 18px 18px 4px 18px;
    box-shadow: var(--shadow-sm);
}

.message-group.received .message-bubble {
    background: white;
    color: var(--text-dark);
    border-radius: 18px 18px 18px 4px;
    border: 1px solid var(--accent-color);
}

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
    transform: translateY(-5px);
}

.message-bubble {
    max-width: 60%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    position: relative;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    text-align: right;
}

.message-group.sent .message-time {
    text-align: right;
}

/* MESSAGE INPUT */
.message-input-area {
    padding: 20px;
    border-top: 2px solid var(--accent-color);
    background: white;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.input-actions {
    display: flex;
    gap: 8px;
}

.input-icon-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--accent-color);
    transition: transform var(--transition-speed), color var(--transition-speed);
    padding: 5px;
}

.input-icon-btn:hover {
    transform: scale(1.1);
    color: var(--primary-color);
}

.input-field {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--accent-color);
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
    resize: none;
    max-height: 100px;
}

.input-field:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(132, 209, 244, 0.2);
}

.send-btn {
    background: var(--primary-color);
    color: var(--text-light);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: background var(--transition-speed), box-shadow var(--transition-speed);
    box-shadow: var(--shadow-sm);
}

.send-btn:hover {
    background: var(--secondary-color);
    box-shadow: var(--shadow-md);
}

.send-btn:active {
    transform: scale(0.95);
}

/* SCROLLBAR */
.messages-container::-webkit-scrollbar,
.conversations-list::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-track,
.conversations-list::-webkit-scrollbar-track {
    background: transparent;
}

.messages-container::-webkit-scrollbar-thumb,
.conversations-list::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb:hover,
.conversations-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .messaging-sidebar {
        width: 100%;
        display: none;
    }

    .messaging-sidebar.active {
        display: flex;
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        z-index: 10;
        background: white;
    }

    .messaging-chat {
        width: 100%;
    }

    .message-bubble {
        max-width: 85%;
    }
    .language-btn-mobile {
        display: block;
    }
}
