/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    direction: rtl;
    margin: 0;
    padding: 0;
    padding-top: 70px; /* Ajusté pour correspondre à la nouvelle hauteur du header */
}

/* Header Styles */
.chat-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 0; /* Réduit de 15px à 10px */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
    height: 70px; /* Réduit de 80px à 70px */
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 100%; /* Assure la hauteur complète */
    min-height: 50px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 10px; /* Réduit de 15px à 10px */
    flex-shrink: 0;
    max-width: 60%; /* Limite la largeur pour éviter la déformation */
    min-width: 0;
}

.logo-section i {
    font-size: 2.5em;
    color: #27ae60;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.logo-section h1 {
    font-size: 1.6em; /* Réduit de 1.8em */
    color: #2c3e50;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.logout-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

/* Main Container */
.chat-container {
    display: flex;
    height: calc(100vh - 70px); /* Ajusté */
    max-width: 1400px;
    margin: 0 auto;
    gap: 20px;
    padding: 20px;
    box-sizing: border-box;
}

/* Sidebar Styles */
.sidebar {
    width: 300px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.sidebar h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.room-section, .users-section, .bot-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.create-room-btn {
    width: 100%;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.create-room-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
}

.rooms-list, .users-list {
    max-height: 200px;
    overflow-y: auto;
}

.room-item, .user-item {
    background: rgba(52, 73, 94, 0.1);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-right: 4px solid transparent;
}

.room-item:hover, .user-item:hover {
    background: rgba(52, 73, 94, 0.2);
    border-right-color: #27ae60;
    transform: translateX(-5px);
}

.room-item.active {
    background: rgba(39, 174, 96, 0.2);
    border-right-color: #27ae60;
}

.bot-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(39, 174, 96, 0.1);
    border-radius: 8px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #27ae60;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Chat Main Area */
.chat-main {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    overflow: hidden;
}

.room-header {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.room-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.action-btn.active {
    background: #27ae60;
}

/* Messages Container */
.messages-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: linear-gradient(to bottom, #f8f9fa, #e9ecef);
}

.welcome-message {
    text-align: center;
    padding: 50px 20px;
    color: #7f8c8d;
}

.welcome-message i {
    font-size: 4em;
    color: #27ae60;
    margin-bottom: 20px;
}

.message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: messageSlideIn 0.3s ease;
}

/* Thèmes */
.theme-dark {
    --bg-primary: #2c3e50;
    --bg-secondary: #34495e;
    --text-primary: #ecf0f1;
    --accent: #3498db;
}

.theme-islamic {
    --bg-primary: #1a5f3f;
    --bg-secondary: #27ae60;
    --text-primary: #ffffff;
    --accent: #f39c12;
}

/* Animations améliorées */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message {
    animation: messageSlideIn 0.3s ease-out;
}

/* Indicateur de frappe */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 10px;
    margin-top: 10px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3498db;
    display: inline-block;
    animation: typingDots 1.4s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDots {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

.message.own {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #27ae60;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
}

.message-content {
    max-width: 70%;
    background: white;
    padding: 12px 16px;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
}

.message.own .message-content {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-size: 0.85em;
    opacity: 0.8;
}

.message-text {
    line-height: 1.4;
}

.message-audio {
    background: #34495e;
    border-radius: 20px;
    padding: 10px;
    margin-top: 8px;
}

.message-audio audio {
    width: 100%;
    height: 30px;
}

.message-image {
    margin-top: 8px;
    border-radius: 8px;
    overflow: hidden;
    max-width: 300px;
}

.message-image img {
    width: 100%;
    height: auto;
    display: block;
}

.bot-message {
    background: linear-gradient(135deg, #3498db, #2980b9) !important;
    color: white;
    border-right: 4px solid #f39c12;
}

.bot-correction {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid #e74c3c;
    border-radius: 8px;
    padding: 10px;
    margin-top: 8px;
}

.correction-title {
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 5px;
}

/* Video Area */
.video-area {
    background: #000;
    padding: 20px;
    border-radius: 10px;
    margin: 20px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.video-stream {
    background: #2c3e50;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.video-stream video {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.video-controls {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

/* Message Input Area */
.message-input-area {
    background: white;
    padding: 20px;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.input-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    border-radius: 25px;
    padding: 8px;
}

.attachment-btn, .voice-btn, .send-btn {
    background: none;
    border: none;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #7f8c8d;
}

.attachment-btn:hover, .voice-btn:hover {
    background: rgba(127, 140, 141, 0.1);
    color: #2c3e50;
}

.send-btn {
    background: #27ae60;
    color: white;
}

.send-btn:hover {
    background: #219a52;
    transform: scale(1.1);
}

#messageInput {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 16px;
    font-size: 16px;
    outline: none;
    border-radius: 20px;
}

.recording-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #e74c3c;
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    margin-top: 10px;
}

.recording-animation {
    display: flex;
    align-items: center;
    gap: 10px;
}

.recording-dot {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    animation: pulse 1s infinite;
}

.stop-recording-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
}

/* Modal Styles */
/* Styles pour les modales d'authentification */
.auth-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.auth-modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 0;
  border-radius: 15px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.auth-modal-header {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
  padding: 20px;
  text-align: center;
  position: relative;
}

.auth-modal-header h2 {
  margin: 0;
  font-size: 1.5em;
  font-weight: 600;
}

.close-modal {
  position: absolute;
  right: 15px;
  top: 15px;
  color: white;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
}

.close-modal:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.auth-modal-body {
  padding: 30px;
}

.auth-form-group {
  margin-bottom: 20px;
}

.auth-form-group label {
  display: block;
  margin-bottom: 8px;
  color: #2c3e50;
  font-weight: 500;
  text-align: right;
}

.auth-form-group input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #ecf0f1;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s, box-shadow 0.3s;
  direction: ltr;
  text-align: left;
}

.auth-form-group input:focus {
  outline: none;
  border-color: #27ae60;
  box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

.password-container {
  position: relative;
}

.toggle-password {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #7f8c8d;
  font-size: 18px;
  transition: color 0.3s;
}

.toggle-password:hover {
  color: #27ae60;
}

.auth-submit-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.3s;
  margin-bottom: 15px;
}

.auth-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
}

.auth-submit-btn:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-switch {
  text-align: center;
  color: #7f8c8d;
  margin-top: 15px;
}

.auth-switch a {
  color: #27ae60;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-message {
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 15px;
  text-align: center;
  font-weight: 500;
}

.auth-message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.auth-message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Styles pour la section d'authentification dans l'en-tête */
.auth-section {
  display: flex;
  gap: 10px;
  align-items: center;
}

.header-btn {
  padding: 8px 16px;
  border: 2px solid #27ae60;
  border-radius: 6px;
  text-decoration: none;
  color: #27ae60;
  font-weight: 500;
  transition: all 0.3s ease;
}

.header-btn:hover {
  background-color: #27ae60;
  color: white;
  transform: translateY(-2px);
}

.header-btn.primary {
  background-color: #27ae60;
  color: white;
}

.header-btn.primary:hover {
  background-color: #219a52;
}

/* Responsive Design - Corrections pour le logo */
@media (max-width: 1200px) {
    .logo-section h1 {
        font-size: 1.3em;
    }
    
    .academy-logo {
        width: 32px;
        height: 32px;
    }
    
    .header-content {
        padding: 0 15px;
    }
}

@media (max-width: 768px) {
    .chat-header {
        height: 60px;
        padding: 8px 0;
    }
    
    body {
        padding-top: 60px;
    }
    
    .chat-container {
        height: calc(100vh - 60px);
        flex-direction: column;
        padding: 10px;
        gap: 10px;
    }
    
    .logo-section {
        gap: 8px;
        max-width: 70%;
        flex: 1;
        min-width: 0;
    }
    
    .logo-section h1 {
        font-size: 1.0em;
    }
    
    .academy-logo {
        width: 28px;
        height: 28px;
        margin-left: 6px;
    }
    
    .sidebar {
        width: 100%;
        margin-bottom: 10px;
        max-height: 200px;
        order: 2;
    }
    
    .chat-main {
        order: 1;
        min-height: 350px;
    }
    
    .header-content {
        padding: 0 10px;
        flex-wrap: wrap;
    }
    
    .user-info {
        gap: 8px;
    }
    
    .auth-section {
        gap: 5px;
    }
    
    .header-btn {
        padding: 6px 12px;
        font-size: 0.9em;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .menu-icon {
        width: 14px;
        height: 14px;
        margin-right: 6px;
    }
}

@media (max-width: 480px) {
    .logo-section h1 {
        font-size: 0.85em;
    }
    
    .academy-logo {
        width: 24px;
        height: 24px;
    }
    
    .header-content {
        padding: 0 8px;
    }
    
    .logo-section {
        max-width: 75%;
        gap: 6px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(39, 174, 96, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(39, 174, 96, 0.7);
}

.form-note {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #7f8c8d;
    font-style: italic;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 9999;
    animation: slideInRight 0.3s ease;
}

.notification.success {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.notification.error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Z-index corrections */
.notifications-center {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 300px;
    max-height: 400px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    display: none;
    z-index: 9998;
}

/* Styles pour le panneau de statistiques */
.stats-panel {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    min-width: 250px;
    z-index: 1000;
    display: none;
}

.stats-panel h4 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 10px;
    background: rgba(39, 174, 96, 0.1);
    border-radius: 8px;
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #27ae60;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9em;
    color: #7f8c8d;
}

/* أنماط الأدوار */
.user-role {
  font-size: 0.8em;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 8px;
  font-weight: bold;
}

.user-role.guest {
  background-color: #6c757d;
  color: white;
}

.user-role.student {
  background-color: #17a2b8;
  color: white;
}

.user-role.teacher {
  background-color: #28a745;
  color: white;
}

.user-role.moderator {
  background-color: #ffc107;
  color: #212529;
}

.user-role.admin {
  background-color: #dc3545;
  color: white;
}

.user-role.owner {
  background-color: #6f42c1;
  color: white;
}

/* Styles pour le logo de l'académie - VERSION CORRIGÉE */
.academy-logo {
    width: 35px;
    height: 35px;
    object-fit: contain;
    margin-left: 10px; /* Changé de margin-right à margin-left pour RTL */
    border-radius: 6px;
    flex-shrink: 0;
    display: block;
}

/* Styles pour les icônes dans le menu */
.menu-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    margin-right: 8px;
    vertical-align: middle;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-size: 0.85em;
    opacity: 0.8;
}

.message-text {
    line-height: 1.4;
}

.message-audio {
    background: #34495e;
    border-radius: 20px;
    padding: 10px;
    margin-top: 8px;
}

.message-audio audio {
    width: 100%;
    height: 30px;
}

.message-image {
    margin-top: 8px;
    border-radius: 8px;
    overflow: hidden;
    max-width: 300px;
}

.message-image img {
    width: 100%;
    height: auto;
    display: block;
}

.bot-message {
    background: linear-gradient(135deg, #3498db, #2980b9) !important;
    color: white;
    border-right: 4px solid #f39c12;
}

.bot-correction {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid #e74c3c;
    border-radius: 8px;
    padding: 10px;
    margin-top: 8px;
}

.correction-title {
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 5px;
}

/* Video Area */
.video-area {
    background: #000;
    padding: 20px;
    border-radius: 10px;
    margin: 20px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.video-stream {
    background: #2c3e50;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.video-stream video {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.video-controls {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

/* Message Input Area */
.message-input-area {
    background: white;
    padding: 20px;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.input-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    border-radius: 25px;
    padding: 8px;
}

.attachment-btn, .voice-btn, .send-btn {
    background: none;
    border: none;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #7f8c8d;
}

.attachment-btn:hover, .voice-btn:hover {
    background: rgba(127, 140, 141, 0.1);
    color: #2c3e50;
}

.send-btn {
    background: #27ae60;
    color: white;
}

.send-btn:hover {
    background: #219a52;
    transform: scale(1.1);
}

#messageInput {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 16px;
    font-size: 16px;
    outline: none;
    border-radius: 20px;
}

.recording-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #e74c3c;
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    margin-top: 10px;
}

.recording-animation {
    display: flex;
    align-items: center;
    gap: 10px;
}

.recording-dot {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    animation: pulse 1s infinite;
}

.stop-recording-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
}

/* Modal Styles */
/* Styles pour les modales d'authentification */
.auth-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.auth-modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 0;
  border-radius: 15px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.auth-modal-header {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
  padding: 20px;
  text-align: center;
  position: relative;
}

.auth-modal-header h2 {
  margin: 0;
  font-size: 1.5em;
  font-weight: 600;
}

.close-modal {
  position: absolute;
  right: 15px;
  top: 15px;
  color: white;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
}

.close-modal:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.auth-modal-body {
  padding: 30px;
}

.auth-form-group {
  margin-bottom: 20px;
}

.auth-form-group label {
  display: block;
  margin-bottom: 8px;
  color: #2c3e50;
  font-weight: 500;
  text-align: right;
}

.auth-form-group input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #ecf0f1;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s, box-shadow 0.3s;
  direction: ltr;
  text-align: left;
}

.auth-form-group input:focus {
  outline: none;
  border-color: #27ae60;
  box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

.password-container {
  position: relative;
}

.toggle-password {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #7f8c8d;
  font-size: 18px;
  transition: color 0.3s;
}

.toggle-password:hover {
  color: #27ae60;
}

.auth-submit-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.3s;
  margin-bottom: 15px;
}

.auth-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
}

.auth-submit-btn:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-switch {
  text-align: center;
  color: #7f8c8d;
  margin-top: 15px;
}

.auth-switch a {
  color: #27ae60;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-message {
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 15px;
  text-align: center;
  font-weight: 500;
}

.auth-message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.auth-message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Styles pour la section d'authentification dans l'en-tête */
.auth-section {
  display: flex;
  gap: 10px;
  align-items: center;
}

.header-btn {
  padding: 8px 16px;
  border: 2px solid #27ae60;
  border-radius: 6px;
  text-decoration: none;
  color: #27ae60;
  font-weight: 500;
  transition: all 0.3s ease;
}

.header-btn:hover {
  background-color: #27ae60;
  color: white;
  transform: translateY(-2px);
}

.header-btn.primary {
  background-color: #27ae60;
  color: white;
}

.header-btn.primary:hover {
  background-color: #219a52;
}

/* Responsive Design - Corrections pour le logo */
@media (max-width: 1200px) {
    .logo-section h1 {
        font-size: 1.3em;
    }
    
    .academy-logo {
        width: 32px;
        height: 32px;
    }
    
    .header-content {
        padding: 0 15px;
    }
}

@media (max-width: 768px) {
    .chat-header {
        height: 60px;
        padding: 8px 0;
    }
    
    body {
        padding-top: 60px;
    }
    
    .chat-container {
        height: calc(100vh - 60px);
        flex-direction: column;
        padding: 10px;
        gap: 10px;
    }
    
    .logo-section {
        gap: 8px;
        max-width: 70%;
        flex: 1;
        min-width: 0;
    }
    
    .logo-section h1 {
        font-size: 1.0em;
    }
    
    .academy-logo {
        width: 28px;
        height: 28px;
        margin-left: 6px;
    }
    
    .sidebar {
        width: 100%;
        margin-bottom: 10px;
        max-height: 200px;
        order: 2;
    }
    
    .chat-main {
        order: 1;
        min-height: 350px;
    }
    
    .header-content {
        padding: 0 10px;
        flex-wrap: wrap;
    }
    
    .user-info {
        gap: 8px;
    }
    
    .auth-section {
        gap: 5px;
    }
    
    .header-btn {
        padding: 6px 12px;
        font-size: 0.9em;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .menu-icon {
        width: 14px;
        height: 14px;
        margin-right: 6px;
    }
}

@media (max-width: 480px) {
    .logo-section h1 {
        font-size: 0.85em;
    }
    
    .academy-logo {
        width: 24px;
        height: 24px;
    }
    
    .header-content {
        padding: 0 8px;
    }
    
    .logo-section {
        max-width: 75%;
        gap: 6px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(39, 174, 96, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(39, 174, 96, 0.7);
}

.form-note {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #7f8c8d;
    font-style: italic;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 9999;
    animation: slideInRight 0.3s ease;
}

.notification.success {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.notification.error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Z-index corrections */
.notifications-center {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 300px;
    max-height: 400px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    display: none;
    z-index: 9998;
}

/* Styles pour le panneau de statistiques */
.stats-panel {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    min-width: 250px;
    z-index: 1000;
    display: none;
}

.stats-panel h4 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 10px;
    background: rgba(39, 174, 96, 0.1);
    border-radius: 8px;
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #27ae60;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9em;
    color: #7f8c8d;
}