/* ========================================
   1. VARIABLES & RESET
   ======================================== */
:root {
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --primary: #006400; /* Vert foncé */
  --primary-dark: #004d00;
  --primary-light: #007a00;
  --secondary: #FFD700; /* Jaune/Or */
  --secondary-dark: #cca300;

  --bg-light: #f8fafc;
  --bg-dark: #0f172a;
  --surface-light: #ffffff;
  --surface-dark: #1e293b;
  --border-light: #e2e8f0;
  --border-dark: #334155;

  --text-light-primary: #1e293b;
  --text-light-secondary: #64748b;
  --text-dark-primary: #e2e8f0;
  --text-dark-secondary: #9ca3af;

  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --info: #3b82f6;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent; /* Supprime le highlight bleu sur mobile */
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-light);
  color: var(--text-light-primary);
  transition: background-color 0.3s, color 0.3s;
  overflow-x: hidden; /* Empêche le scroll horizontal global */
  width: 100%;
}

/* ========================================
   2. DARK MODE
   ======================================== */
.dark-mode body {
  background-color: var(--bg-dark);
  color: var(--text-dark-primary);
}

/* ========================================
   3. SHARED COMPONENTS
   ======================================== */
.brand-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  font-weight: 700;
  font-size: 1.2rem;
}
.brand-logo img {
  width: 100%;
  height: 100%;
}
.brand-logo.small {
  width: 32px;
  height: 32px;
  font-size: 1rem;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-light-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s;
}
.btn-icon:hover {
  background-color: var(--border-light);
}
.dark-mode .btn-icon {
  color: var(--text-dark-secondary);
}
.dark-mode .btn-icon:hover {
  background-color: var(--border-dark);
}

.hidden {
  display: none !important;
}

/* ========================================
   4. HOME PAGE (`index.html`)
   ======================================== */
.home-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border-light);
  background-color: var(--surface-light);
  position: relative;
  z-index: 10;
}
.dark-mode .navbar {
  border-bottom-color: var(--border-dark);
  background-color: var(--surface-dark);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.brand-name {
  font-weight: 700;
  font-size: 1.1rem;
}
.brand-sub {
  font-size: 0.75rem;
  color: var(--text-light-secondary);
}
.dark-mode .brand-sub {
  color: var(--text-dark-secondary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.connection-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background-color: var(--bg-light);
  border: 1px solid var(--border-light);
}
.dark-mode .connection-badge {
  background-color: var(--surface-dark);
  border-color: var(--border-dark);
}
.dot-green {
  width: 8px;
  height: 8px;
  background-color: var(--success);
  border-radius: 50%;
}

/* Hero */
.home-layout {
  flex-grow: 1;
  display: flex;
  width: 100%;
  overflow-x: hidden;
}
.form-column {
  width: 50%;
  max-width: 600px;
  padding: 3rem 2rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.info-column {
  width: 50%;
  background-color: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: left;
}
.dark-mode .info-column {
  background-color: var(--bg-dark);
}
.info-content {
  max-width: 500px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 3rem;
  margin-bottom: 1rem;
}
.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-light-secondary);
  margin-bottom: 3rem;
  line-height: 1.6;
}
.dark-mode .hero-subtitle {
  color: var(--text-dark-secondary);
}

/* Tabs & Forms */
.tabs-container {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 1.5rem;
}
.dark-mode .tabs-container {
  border-bottom-color: var(--border-dark);
}
.tab-btn {
  flex: 1;
  padding: 1rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-light-secondary);
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.dark-mode .tab-btn {
  color: var(--text-dark-secondary);
}
.tab-btn:hover {
  color: var(--primary);
}
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.form-card {
  background-color: var(--surface-light);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 2rem;
  text-align: left;
}
.dark-mode .form-card {
  background-color: var(--surface-dark);
  border-color: var(--border-dark);
}

.form-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.form-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background-color: var(--primary-light);
  color: white;
  font-size: 1.5rem;
}
.form-card h2 {
  font-size: 1.25rem;
}

.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}
.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 1rem;
  background-color: var(--bg-light);
}
.dark-mode .form-group input {
  background-color: var(--bg-dark);
  border-color: var(--border-dark);
  color: var(--text-dark-primary);
}
.form-group input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}
.required {
  color: var(--danger);
}

.form-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background-color: var(--bg-light);
  border-radius: 8px;
  margin: 1.5rem 0;
}
.dark-mode .form-toggle-row {
  background-color: var(--bg-dark);
}
.form-toggle-info {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.toggle-label {
  font-weight: 600;
}
.toggle-hint {
  font-size: 0.875rem;
  color: var(--text-light-secondary);
}
.dark-mode .toggle-hint {
  color: var(--text-dark-secondary);
}
.toggle-btn {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background-color: var(--surface-light);
  cursor: pointer;
}
.dark-mode .toggle-btn {
  background-color: var(--surface-dark);
  border-color: var(--border-dark);
}
.toggle-btn.active {
  background-color: var(--secondary);
  color: white;
  border-color: var(--secondary);
}

.btn-launch {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-launch:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 100, 0, 0.3);
}

/* Features */
.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
.dark-mode .features {
  /* No change needed here as it's inside info-column */
}
.feature-card {
  text-align: center;
}
.feature-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

/* Overrides for features in info-column */
.info-column .feature-card {
  display: flex;
  text-align: left;
  align-items: center;
  gap: 1.5rem;
}
.info-column .feature-icon {
  margin: 0;
  flex-shrink: 0;
}
.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}
.feature-card p {
  color: var(--text-light-secondary);
}
.dark-mode .feature-card p {
  color: var(--text-dark-secondary);
}

/* Footer */
.home-footer {
  padding: 1.5rem 2rem;
  color: var(--text-dark-secondary);
  border-top: 1px solid var(--border-light);
  background-color: var(--surface-dark);
}
.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
}
.footer-section strong {
  color: var(--text-dark-primary);
}

.n-badge {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  background-color: var(--danger);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* ========================================
   5. ROOM PAGE (`room.html`)
   ======================================== */
.room-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

/* Room Header */
.room-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  background-color: var(--surface-light);
  flex-shrink: 0;
}
.dark-mode .room-header {
  background-color: var(--surface-dark);
  border-bottom-color: var(--border-dark);
}

.room-header-left, .room-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.room-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.room-id {
  font-weight: 600;
  background-color: var(--bg-light);
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
}
.dark-mode .room-id {
  background-color: var(--bg-dark);
}
.room-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-light-secondary);
}
.dark-mode .room-meta {
  color: var(--text-dark-secondary);
}
.share-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--success);
  font-weight: 600;
}

.btn-header-tab {
  padding: 0.5rem 1rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-light-secondary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dark-mode .btn-header-tab {
  color: var(--text-dark-secondary);
}
.btn-header-tab:hover {
  background-color: var(--bg-light);
}
.dark-mode .btn-header-tab:hover {
  background-color: var(--bg-dark);
}
.btn-header-tab.active {
  background-color: var(--primary);
  color: white;
}

/* Room Layout */
.room-layout {
  display: flex;
  flex-grow: 1;
  overflow: hidden;
  position: relative; /* Important pour le positionnement absolu sur mobile */
}
.video-area {
  flex-grow: 1;
  background-color: var(--bg-light);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dark-mode .video-area {
  background-color: var(--bg-dark);
}

.screen-share-container {
  width: 100%;
  height: 100%;
  background-color: var(--surface-light);
  border-radius: 12px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.dark-mode .screen-share-container {
  background-color: #000;
}
.screen-share-container.fullscreen {
  border-radius: 0;
}

.screen-placeholder {
  text-align: center;
  color: var(--text-light-secondary);
}
.dark-mode .screen-placeholder {
  color: var(--text-dark-secondary);
}
.screen-placeholder i {
  font-size: 4rem;
  margin-bottom: 1rem;
}

#screenVideo {
  background-color: #000;
}

.screen-share-label {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: rgba(0,0,0,0.5);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  z-index: 10;
}
.screen-share-avatar {
  width: 32px;
  height: 32px;
  background-color: var(--primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.live-badge {
  font-size: 0.75rem;
  color: var(--danger);
  font-weight: 700;
}

.expand-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: rgba(0,0,0,0.5);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
}

/* Side Panel */
.side-panel {
  width: 320px;
  flex-shrink: 0;
  border-left: 1px solid var(--border-light);
  background-color: var(--surface-light);
  display: flex;
  flex-direction: column;
}
.dark-mode .side-panel {
  background-color: var(--surface-dark);
  border-left-color: var(--border-dark);
}

.panel-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.dark-mode .panel-header {
  border-bottom-color: var(--border-dark);
}
.panel-header h3 {
  font-size: 1rem;
  flex-grow: 1;
}
.participant-count-badge, .msg-count {
  font-size: 0.875rem;
  background-color: var(--bg-light);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}
.dark-mode .participant-count-badge, .dark-mode .msg-count {
  background-color: var(--bg-dark);
}

.chat-messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1rem;
}

/* ===== NOUVEAU STYLE PARTICIPANTS ===== */

.view-toggle {
  display: flex;
  gap: 6px;
  padding: 10px 15px;
  border-bottom: 1px solid var(--border-light);
  background-color: var(--bg-light);
}
.dark-mode .view-toggle {
  border-bottom-color: var(--border-dark);
  background-color: var(--bg-dark);
}

.view-btn {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border-light);
  background: var(--surface-light);
  color: var(--text-light-secondary);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.2s;
}
.dark-mode .view-btn {
  border-color: var(--border-dark);
  background: var(--surface-dark);
  color: var(--text-dark-secondary);
}

.view-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.view-btn:hover:not(.active) {
  border-color: var(--primary);
  color: var(--primary);
}

.participants-list {
  flex-grow: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.participant-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-light);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.dark-mode .participant-card {
  background: var(--surface-dark);
  border-color: var(--border-dark);
}

.participant-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: transparent;
  transition: background 0.2s;
  border-radius: 3px 0 0 3px;
}

.participant-card:hover {
  transform: translateX(3px);
  border-color: var(--primary);
}
.participant-card:hover::before {
  background: var(--primary);
}

.participant-card.is-host {
  border-color: var(--secondary);
}
.participant-card.is-host::before {
  background: var(--secondary);
}

/* Avatar */
.p-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: white;
  flex-shrink: 0;
  position: relative;
}

.p-avatar .status-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 11px;
  height: 11px;
  background: var(--success);
  border-radius: 50%;
  border: 2px solid var(--surface-light);
}
.dark-mode .p-avatar .status-dot {
  border-color: var(--surface-dark);
}

/* Info */
.p-info {
  flex: 1;
  min-width: 0;
}

.p-name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 5px;
}

.p-status {
  font-size: 11px;
  color: var(--text-light-secondary);
  margin-top: 2px;
}
.dark-mode .p-status {
  color: var(--text-dark-secondary);
}

.p-status.sharing {
  color: var(--success);
}

/* Action */
.p-action {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-light-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  opacity: 0;
  transition: all 0.2s;
}
.dark-mode .p-action {
  border-color: var(--border-dark);
  color: var(--text-dark-secondary);
}

.participant-card:hover .p-action {
  opacity: 1;
}

.p-action:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ===== VUE GRILLE ===== */
.participants-list.grid-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.participants-list.grid-view .participant-card {
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 10px;
  gap: 10px;
}

.participants-list.grid-view .p-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  font-size: 18px;
}

.participants-list.grid-view .p-name {
  justify-content: center;
}

.participants-list.grid-view .p-action {
  opacity: 1;
  width: 100%;
}

/* Section Label */
.section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-light-secondary);
  padding: 8px 2px 4px;
  grid-column: 1 / -1;
}
.dark-mode .section-label {
  color: var(--text-dark-secondary);
}

/* Hand Badge (adapté) */
.hand-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  font-size: 14px;
  background: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  animation: wave 1s infinite;
  z-index: 10;
}

@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-15deg); }
  75% { transform: rotate(15deg); }
}

/* Chat Panel */
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.chat-input-area {
  padding: 1rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.dark-mode .chat-input-area {
  border-top-color: var(--border-dark);
}
.chat-input-wrapper {
  flex-grow: 1;
}
#chatInput {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background-color: var(--bg-light);
}
.dark-mode #chatInput {
  background-color: var(--bg-dark);
  border-color: var(--border-dark);
  color: var(--text-dark-primary);
}
.attach-btn, .send-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.attach-btn {
  background-color: var(--bg-light);
}
.dark-mode .attach-btn {
  background-color: var(--bg-dark);
}
.send-btn {
  background-color: var(--primary);
  color: white;
}

/* Room Footer */
.room-footer {
  border-top: 1px solid var(--border-light);
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}
.dark-mode .room-footer {
  border-top-color: var(--border-dark);
}
.controls-bar {
  display: flex;
  gap: 1rem;
}
.ctrl-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background-color: var(--surface-light);
  cursor: pointer;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0; /* Empêche l'écrasement sur petits écrans */
  transition: all 0.2s;
}
.dark-mode .ctrl-btn {
  background-color: var(--surface-dark);
  border-color: var(--border-dark);
}
.ctrl-btn:hover {
  border-color: var(--secondary);
}
.ctrl-btn.active {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}
.ctrl-btn.danger {
  background-color: var(--danger);
  color: white;
  border: none;
}

.notification-tag {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--warning);
  color: var(--text-light-primary);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* ========================================
   6. RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
  .side-panel {
    width: 280px;
  }
}

@media (max-width: 768px) {
  .home-layout {
    flex-direction: column-reverse; /* Info en premier ou formulaire en premier ? */
  }
  .form-column, .info-column {
    width: 100%;
    max-width: 100%;
    padding: 2rem 1rem;
  }
  
  .info-column {
    text-align: center;
  }
  .info-column .feature-card {
    flex-direction: column;
    text-align: center;
  }
  .info-column .feature-icon {
    margin: 0 auto 1.5rem;
  }
  .footer-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .hero-title {
    font-size: 2.5rem;
  }
  .room-layout {
    flex-direction: column; /* Stack vertical sur mobile */
    width: 100%;
    overflow-x: hidden;
  }
  .side-panel {
    width: 100%;
    flex: 2; /* Prend 40% de l'espace restant */
    min-height: 0; /* Important pour le flexbox shrink */
    border-left: none;
    border-top: 1px solid var(--border-light);
    position: relative;
    z-index: 20;
  }
  
  .video-area {
    flex: 3; /* Prend 60% de l'espace restant */
    min-height: 0; /* Important pour le flexbox shrink */
  }

  .dark-mode .side-panel {
    border-top-color: var(--border-dark);
  }
  .room-header-right .btn-header-tab span {
    display: none;
  }
  .controls-bar {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ========================================
   7. ALERTS & NOTIFICATIONS
   ======================================== */
.alert {
  position: fixed;
  top: 5rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  border-left: 4px solid;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  font-weight: 600;
  z-index: 2000;
  opacity: 0;
  transform: translate(-50%, -20px);
  transition: opacity 0.3s, transform 0.3s;
  min-width: 300px;
  text-align: center;
}

.alert.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.alert-info {
  background-color: #e0f2fe; /* light-blue-100 */
  color: #0c4a6e; /*-blue-900 */
  border-color: var(--primary);
}
.dark-mode .alert-info {
  background-color: #075985; /* cyan-800 */
  color: #e0f2fe; /* light-blue-100 */
}

.alert-success {
  background-color: #dcfce7; /* green-100 */
  color: #14532d; /* green-900 */
  border-color: var(--primary);
}
.dark-mode .alert-success {
  background-color: #166534; /* green-800 */
  color: #dcfce7; /* green-100 */
}

.alert-warning {
  background-color: #fefce8; /* yellow-100 */
  color: #713f12; /* yellow-900 */
  border-color: var(--secondary);
}
.dark-mode .alert-warning {
  background-color: #854d0e; /* yellow-800 */
  color: #fefce8; /* yellow-100 */
}

.alert-error {
  background-color: #fee2e2; /* red-100 */
  color: #7f1d1d; /* red-900 */
  border-color: var(--danger);
}
.dark-mode .alert-error {
  background-color: #991b1b; /* red-800 */
  color: #fee2e2; /* red-100 */
}

/* Animation for the share label */
.screen-share-label {
  animation: slideInFromLeft 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes slideInFromLeft {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ========================================
   8. VIDEO REACTIONS
   ======================================== */
.floating-reaction {
  position: absolute;
  bottom: 80px; /* Au-dessus de la barre de contrôles */
  left: 50%;
  font-size: 3rem;
  animation: floatUp 4s ease-out forwards;
  pointer-events: none;
  z-index: 1500;
  text-shadow: 0 0 10px rgba(0,0,0,0.5);
}

@keyframes floatUp {
  0% {
    transform: translateY(0) scale(0.5);
    opacity: 1;
  }
  100% {
    transform: translateY(-300px) scale(1.2);
    opacity: 0;
  }
}

.ctrl-btn#btnReact.active {
  /* Peut-être pour ouvrir un picker de réactions plus tard */
}

/* ===== NOTIFICATION MAIN LEVÉE (Hôte) ===== */
.hand-raised-notif {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: #1c2128;
  border: 1px solid #FFD700;
  border-radius: 12px;
  padding: 12px 16px;
  z-index: 3000;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.2);
  animation: slideUp 0.3s ease;
  min-width: 280px;
  color: white;
}

.hand-notif-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hand-notif-icon { font-size: 1.5rem; }

.hand-notif-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  font-size: 13px;
}

.hand-notif-actions {
  display: flex;
  gap: 6px;
}

.btn-allow-mic {
  background: #006400;
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}

.btn-dismiss-hand {
  background: transparent;
  border: 1px solid #8b949e;
  color: #8b949e;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== BANNER MICRO AUTORISÉ (Participant) ===== */
.mic-allowed-banner {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #006400, #004d00);
  color: white;
  border-radius: 12px;
  padding: 14px 20px;
  z-index: 3000;
  box-shadow: 0 4px 20px rgba(0,100,0,0.4);
  animation: slideDown 0.3s ease;
}

.mic-banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.mic-banner-content button {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 16px;
  margin-left: 8px;
}

/* ===== SECTIONS PARTICIPANTS ===== */
.raised-hands-section {
  color: #FFD700;
  border-bottom-color: rgba(255,215,0,0.3);
}

.hand-raised-item {
  border-left: 3px solid #FFD700 !important;
  background: rgba(255,215,0,0.05) !important;
}

.me-badge {
  font-size: 10px;
  background: var(--primary);
  color: white;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 4px;
}

.participant-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.participant-card:hover .participant-actions {
  opacity: 1;
}

@keyframes slideUp {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@keyframes slideDown {
  from { transform: translateX(-50%) translateY(-20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ========================================
   MODALS & NOTIFICATIONS
   ======================================== */
.modal-overlay, .notification-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  backdrop-filter: blur(5px);
  animation: fade-in 0.3s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content, .notification-content {
  background-color: var(--surface-light);
  padding: 1.5rem 2rem;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  width: 90%;
  max-width: 480px;
  animation: modal-scale-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.dark-mode .modal-content, .dark-mode .notification-content {
  background-color: var(--surface-dark);
  color: var(--text-dark-primary);
}

@keyframes modal-scale-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}
.dark-mode .modal-header {
  border-bottom-color: var(--border-dark);
}

.modal-header h3 {
  font-size: 1.25rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.close-modal-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light-secondary);
}

.modal-body p, .notification-content p {
  margin-bottom: 1rem;
  color: var(--text-light-secondary);
  line-height: 1.6;
}
.dark-mode .modal-body p, .dark-mode .notification-content p {
  color: var(--text-dark-secondary);
}

.notification-hint, .modal-hint {
  font-size: 0.875rem;
  font-style: italic;
  opacity: 0.8;
  margin-top: -0.5rem;
}

.modal-buttons, .notification-buttons {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.modal-buttons .btn-secondary {
  background-color: var(--surface-light);
  border: 1px solid var(--border-light);
  color: var(--text-light-secondary);
}
.dark-mode .modal-buttons .btn-secondary {
  background-color: var(--surface-dark);
  border-color: var(--border-dark);
  color: var(--text-dark-secondary);
}
.modal-buttons .btn-secondary:hover {
  background-color: var(--bg-light);
}
.dark-mode .modal-buttons .btn-secondary:hover {
  background-color: var(--bg-dark);
}

.modal-buttons .btn-primary {
  background-color: var(--primary);
  color: white;
}
.modal-buttons .btn-primary:hover {
  background-color: var(--primary-dark);
}

/* Styles spécifiques pour la notification de demande */
.notification-content {
  border-top: 4px solid var(--warning);
  text-align: center;
}
.notification-buttons {
  justify-content: center;
}

.notification-buttons .btn-danger,
.notification-buttons .btn-success {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.notification-buttons .btn-danger:hover,
.notification-buttons .btn-success:hover {
    transform: translateY(-2px);
}
