/* ==========================================================================
   OASIS CALL - Luxury Video Calling Platform (Dubai Edition)
   Ultra-Premium Glassmorphism & Cyber Aesthetics
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;700&display=swap');

:root {
  --bg-base: #06080d;
  --bg-surface: rgba(14, 18, 30, 0.72);
  --bg-surface-hover: rgba(22, 28, 46, 0.85);
  --bg-card: rgba(18, 24, 40, 0.65);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 240, 255, 0.35);
  
  /* Luxury Brand Accents */
  --accent-gold: #f59e0b;
  --accent-gold-glow: rgba(245, 158, 11, 0.35);
  --accent-cyan: #00f0ff;
  --accent-cyan-glow: rgba(0, 240, 255, 0.3);
  --accent-violet: #8b5cf6;
  --accent-emerald: #10b981;
  --accent-danger: #ef4444;
  --accent-danger-glow: rgba(239, 68, 68, 0.4);

  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Elevation & Shadows */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 40px -8px rgba(0, 0, 0, 0.65);
  --shadow-neon: 0 0 30px rgba(0, 240, 255, 0.25);
  --glass-blur: blur(24px) saturate(180%);

  /* Layout */
  --dock-height: 84px;
  --topbar-height: 70px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  position: relative;
  overscroll-behavior: none;
  -webkit-overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(0, 240, 255, 0.07) 0%, transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 50% 85%, rgba(245, 158, 11, 0.06) 0%, transparent 55%);
}

/* Background Ambient Grid */
.ambient-grid {
  position: fixed;
  inset: 0;
  background-size: 50px 50px;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  pointer-events: none;
  z-index: 0;
}

/* ==========================================================================
   VIEW 1: LUXURY LOBBY & PRE-CALL STUDIO
   ========================================================================== */

.lobby-container {
  position: relative;
  z-index: 10;
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.brand-header {
  text-align: center;
  margin-bottom: 28px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--accent-gold);
  padding: 6px 16px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
  box-shadow: 0 0 20px var(--accent-gold-glow);
}

.live-beacon {
  width: 8px;
  height: 8px;
  background: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-emerald);
  display: inline-block;
  animation: pulseAnim 1.8s infinite;
}

.brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 50%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.brand-title span.gold {
  background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tagline {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-top: 6px;
}

/* Lobby Studio Grid */
.lobby-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  width: 100%;
  max-width: 980px;
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: 28px;
  padding: 36px;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(0, 0, 0, 0.5);
  position: relative;
}

/* AV Preview Box */
.preview-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #090c14;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8);
}

#lobbyPreviewVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror camera */
}

.preview-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  pointer-events: none;
}

.preview-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  pointer-events: auto;
}

.preview-status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 14, 22, 0.75);
  backdrop-filter: blur(12px);
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.2);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-cyan);
  animation: pulseAnim 2s infinite;
}

@keyframes pulseAnim {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

/* Mic Live Visualizer */
.preview-audio-meter {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
  padding: 0 4px;
}

.meter-bar {
  width: 3.5px;
  height: 4px;
  background: var(--accent-emerald);
  border-radius: 2px;
  transition: height 0.08s ease;
}

.preview-controls-row {
  pointer-events: auto;
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  background: rgba(10, 14, 24, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  width: fit-content;
  margin: 0 auto;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

.btn-preview-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-preview-circle:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

.btn-preview-circle.muted {
  background: var(--accent-danger);
  border-color: var(--accent-danger);
  box-shadow: 0 0 15px var(--accent-danger-glow);
}

.btn-preview-circle.mobile-flip-btn {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fcd34d;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

/* Lobby Form */
.lobby-form-pane {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.form-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.input-group {
  margin-bottom: 16px;
}

.input-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.input-wrapper {
  position: relative;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon .input-prefix-icon {
  position: absolute;
  left: 14px;
  font-size: 1.05rem;
  pointer-events: none;
  opacity: 0.8;
  z-index: 2;
}

.input-with-icon .input-field {
  padding-left: 42px;
}

.room-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.room-input-wrapper .input-prefix-icon {
  position: absolute;
  left: 14px;
  font-size: 1.05rem;
  pointer-events: none;
  opacity: 0.8;
  z-index: 2;
}

.room-input-wrapper .input-field {
  padding-left: 42px;
  padding-right: 98px;
}

.btn-random-pill {
  position: absolute;
  right: 6px;
  height: 32px;
  padding: 0 12px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 9999px;
  color: #fcd34d;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  z-index: 2;
}

.btn-random-pill:hover {
  background: rgba(245, 158, 11, 0.3);
  transform: translateY(-1px);
}

.btn-random-pill:active {
  transform: scale(0.95);
}

.input-field {
  width: 100%;
  background: rgba(10, 14, 24, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 14px 18px;
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.input-field:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.2);
  background: rgba(14, 20, 36, 0.8);
}

.avatar-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.avatar-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.avatar-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.avatar-btn.selected {
  border-color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.15);
  box-shadow: 0 0 15px var(--accent-gold-glow);
}

/* Luxury iOS Style Toggle */
.luxury-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
}

.luxury-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.14);
}

.toggle-info {
  display: flex;
  flex-direction: column;
}

.toggle-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: #f8fafc;
}

.toggle-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 1px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-track {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.16);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-thumb {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  top: 2px;
  background-color: #ffffff;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.toggle-switch input:checked + .toggle-track {
  background: linear-gradient(135deg, #00f0ff 0%, #0284c7 100%);
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}

.toggle-switch input:checked + .toggle-track .toggle-thumb {
  transform: translateX(20px);
}

/* CTA Buttons */
.btn-primary-action {
  width: 100%;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #00f0ff 0%, #0ea5e9 45%, #f59e0b 100%);
  color: #06080d;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 30px rgba(0, 240, 255, 0.35), 0 0 20px rgba(245, 158, 11, 0.2);
  transition: all 0.25s ease;
  margin-top: 8px;
}

.btn-primary-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(0, 240, 255, 0.5), 0 0 25px rgba(245, 158, 11, 0.3);
  filter: brightness(1.08);
}

.btn-primary-action:active {
  transform: scale(0.97);
}

.btn-shimmer {
  position: absolute;
  top: -50%;
  left: -80%;
  width: 50%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: rotate(25deg);
  animation: shimmerSweep 3.5s infinite;
  pointer-events: none;
}

@keyframes shimmerSweep {
  0% { left: -80%; }
  30%, 100% { left: 160%; }
}

.btn-secondary-action {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.2s ease;
}

.btn-secondary-action:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* UAE Bypass Status Badge in Lobby */
.uae-banner {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 0.8rem;
  color: #a7f3d0;
}

.uae-flag {
  font-size: 1.2rem;
}

/* ==========================================================================
   VIEW 2: CONFERENCE ROOM SUITE
   ========================================================================== */

.conference-container {
  display: none; /* Activated via JS */
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--bg-base);
  flex-direction: column;
}

/* Conference Top Header */
.conference-header {
  height: var(--topbar-height);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8, 11, 18, 0.6);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 30;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.room-info-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 16px;
  border-radius: 12px;
}

.room-id-text {
  font-family: 'Space Grotesk', monospace;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.05em;
}

.btn-copy-code {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

.btn-copy-code:hover {
  color: #fff;
}

.call-timer {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.network-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--accent-emerald);
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* ==========================================================================
   DYNAMIC VIDEO GRID STAGE
   ========================================================================== */

.stage-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-grid {
  width: 100%;
  height: 100%;
  max-width: 1600px;
  display: grid;
  gap: 16px;
  align-content: center;
  justify-content: center;
}

/* Responsive grid layout classes set dynamically */
.video-grid.grid-1 {
  grid-template-columns: 1fr;
  max-width: 1100px;
}

.video-grid.grid-2 {
  grid-template-columns: 1fr 1fr;
}

.video-grid.grid-3,
.video-grid.grid-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.video-grid.grid-5,
.video-grid.grid-6 {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr 1fr;
}

.video-grid.grid-many {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

/* Participant Video Tile */
.video-tile {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 200px;
  background: #090c14;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-tile.local-tile video {
  transform: scaleX(-1);
}

.video-tile.screen-sharing video {
  object-fit: contain;
  transform: none !important;
}

/* Active Speaker Halo Glow */
.video-tile.active-speaker {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px var(--accent-cyan), 0 0 28px rgba(0, 240, 255, 0.45);
}

.video-tile.hand-raised {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 2px var(--accent-gold), 0 0 25px var(--accent-gold-glow);
}

/* Video Tile Overlay Info */
.tile-overlay-bottom {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.tile-participant-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(8, 11, 20, 0.78);
  backdrop-filter: blur(12px);
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tile-controls-top {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.video-tile:hover .tile-controls-top {
  opacity: 1;
}

.tile-mini-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(10, 14, 24, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.tile-mini-btn:hover {
  background: rgba(40, 50, 80, 0.9);
}

/* Avatar Fallback Tile (when video is turned off) */
.tile-avatar-fallback {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, #0d111a 0%, #161c2b 100%);
}

.avatar-circle-large {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  box-shadow: var(--shadow-sm);
}

.video-tile.video-off .tile-avatar-fallback {
  display: flex;
}

.video-tile.video-off video {
  display: none;
}

/* Pin Spotlight Mode */
.video-tile.pinned {
  grid-column: 1 / -1;
  min-height: 480px;
}

/* ==========================================================================
   FLOATING DOCK (CONTROL BAR)
   ========================================================================== */

.dock-container {
  height: var(--dock-height);
  padding: 0 24px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

.floating-dock {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(14, 18, 30, 0.8);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: 8px 16px;
  border-radius: 24px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg), 0 0 35px rgba(0, 0, 0, 0.5);
}

.dock-btn {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dock-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.2);
}

.dock-btn.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 15px var(--accent-cyan-glow);
}

.dock-btn.danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--accent-danger);
  color: var(--accent-danger);
}

.dock-btn.danger.active,
.dock-btn.end-call {
  background: var(--accent-danger);
  border-color: var(--accent-danger);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-danger-glow);
}

.dock-btn.end-call {
  width: 62px;
  border-radius: 18px;
}

.dock-divider {
  width: 1px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 4px;
}

.badge-counter {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent-cyan);
  color: #06080d;
  font-size: 0.68rem;
  font-weight: 800;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px var(--accent-cyan);
}

/* ==========================================================================
   SIDE DRAWERS (CHAT, WHITEBOARD, NOTES, PARTICIPANTS)
   ========================================================================== */

.drawer-panel {
  position: fixed;
  top: var(--topbar-height);
  bottom: var(--dock-height);
  right: 0;
  width: 380px;
  background: rgba(12, 16, 26, 0.92);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 25;
  box-shadow: var(--shadow-lg);
}

.drawer-panel.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-drawer-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.btn-drawer-close:hover {
  color: #fff;
}

/* Chat Drawer Messages */
.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-message-bubble {
  display: flex;
  gap: 10px;
}

.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.chat-content {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 10px 14px;
}

.chat-content.self {
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.2);
}

.chat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.chat-sender {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.chat-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.chat-text {
  font-size: 0.88rem;
  line-height: 1.4;
  word-break: break-word;
}

.chat-input-row {
  padding: 14px 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 10px;
}

/* Fullscreen Whiteboard Drawer Mode */
.whiteboard-drawer {
  width: 600px;
}

.whiteboard-toolbar {
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.color-dot:hover {
  transform: scale(1.2);
}

.color-dot.active {
  border-color: #fff;
  transform: scale(1.15);
}

.whiteboard-canvas-holder {
  flex: 1;
  position: relative;
  background: #090c14;
}

#whiteboardCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

/* Floating Emoji Physics Stream */
.reaction-burst-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.floating-emoji {
  position: absolute;
  bottom: 80px;
  font-size: 2.8rem;
  animation: floatUp 2.8s cubic-bezier(0.2, 0.8, 0.4, 1) forwards;
}

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(0.6) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: translateY(-300px) scale(1.3) rotate(15deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-650px) scale(1) rotate(-15deg);
  }
}

/* ==========================================================================
   MODALS (INVITE QR, SETTINGS & DUBAI RELAY)
   ========================================================================== */

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 8, 0.8);
  backdrop-filter: blur(16px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow-lg), 0 0 50px rgba(0, 0, 0, 0.8);
  position: relative;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
}

.qr-code-holder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: #ffffff;
  border-radius: 18px;
  margin: 16px 0;
  box-shadow: var(--shadow-sm);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(14, 18, 30, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 12px 20px;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: toastFade 0.3s ease;
}

@keyframes toastFade {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   MOBILE & TABLET ADAPTATIONS
   ========================================================================== */

@media (max-width: 768px) {
  body {
    height: 100dvh;
    min-height: 100dvh;
    overflow-y: auto;
  }

  .ambient-grid {
    background-size: 32px 32px;
  }

  /* Lobby Studio Mobile Optimization */
  .lobby-container {
    height: 100dvh;
    max-height: 100dvh;
    padding: max(8px, env(safe-area-inset-top, 0px)) 12px max(12px, env(safe-area-inset-bottom, 0px)) 12px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .brand-header {
    margin-bottom: 2px;
    text-align: center;
  }

  .brand-badge {
    font-size: 0.65rem;
    padding: 3px 10px;
    margin-bottom: 4px;
    letter-spacing: 0.04em;
  }

  .brand-title {
    font-size: 1.55rem;
    gap: 6px;
    margin-bottom: 0;
  }

  .brand-tagline {
    font-size: 0.72rem;
    margin-top: 1px;
    opacity: 0.85;
  }

  .lobby-card {
    grid-template-columns: 1fr;
    padding: 12px 14px;
    gap: 10px;
    border-radius: 22px;
    background: rgba(14, 18, 32, 0.82);
    border: 1px solid rgba(212, 175, 55, 0.25);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 24px rgba(245, 158, 11, 0.08);
    width: 100%;
    margin-bottom: 8px;
  }

  .preview-box {
    aspect-ratio: 16 / 10;
    max-height: 25vh;
    border-radius: 18px;
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.8), 0 6px 20px rgba(0, 0, 0, 0.5);
  }

  .preview-overlay {
    padding: 10px;
  }

  .preview-status-pill {
    padding: 4px 8px;
    font-size: 0.68rem;
  }

  .preview-controls-row {
    padding: 4px 10px;
    gap: 6px;
  }

  .btn-preview-circle {
    width: 36px;
    height: 36px;
  }

  .uae-banner {
    display: none; /* Merged into top header badge to maximize mobile screen space */
  }

  .form-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
  }

  .input-group {
    margin-bottom: 8px;
  }

  .input-label {
    font-size: 0.7rem;
    margin-bottom: 3px;
  }

  .input-field {
    height: 42px;
    padding: 0 12px;
    font-size: 0.88rem;
    border-radius: 12px;
  }

  .input-with-icon .input-field,
  .room-input-wrapper .input-field {
    padding-left: 38px;
  }

  .input-with-icon .input-prefix-icon,
  .room-input-wrapper .input-prefix-icon {
    left: 12px;
    font-size: 0.95rem;
  }

  .btn-random-pill {
    height: 30px;
    padding: 0 10px;
    font-size: 0.74rem;
  }

  .avatar-selector {
    gap: 6px;
    margin-bottom: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .avatar-selector::-webkit-scrollbar {
    display: none;
  }

  .avatar-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 10px;
    font-size: 1.15rem;
  }

  .luxury-toggle {
    padding: 8px 12px;
    margin-bottom: 10px;
    border-radius: 12px;
  }

  .toggle-title {
    font-size: 0.8rem;
  }

  .toggle-sub {
    font-size: 0.68rem;
  }

  .btn-primary-action {
    height: 48px;
    border-radius: 14px;
    font-size: 0.98rem;
    margin-top: 4px;
  }

  /* In-Call Mobile Layout */
  .conference-header {
    height: auto;
    min-height: 48px;
    padding: max(8px, env(safe-area-inset-top, 0px)) 12px 6px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-left {
    gap: 8px;
  }

  .header-right {
    gap: 6px;
  }

  .network-badge {
    padding: 3px 6px;
    font-size: 0.68rem;
  }

  .stage-viewport {
    padding: 4px;
    height: auto;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .video-grid {
    gap: 6px;
  }

  .video-grid.grid-1 {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
  }

  .video-grid.grid-1 .video-tile.local-tile {
    width: 100%;
    height: 100%;
    border-radius: 20px;
  }

  .video-grid.grid-2 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }

  .video-grid.grid-3,
  .video-grid.grid-4 {
    grid-template-columns: 1fr 1fr;
  }

  .video-tile {
    min-height: 160px;
    border-radius: 16px;
  }

  .tile-mini-btn {
    width: 34px;
    height: 34px;
  }

  /* Ergonomic Floating Dock on Mobile */
  .dock-container {
    height: auto;
    padding: 6px 10px max(10px, env(safe-area-inset-bottom, 0px)) 10px;
  }

  .floating-dock {
    max-width: 100vw;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: flex-start;
    padding: 6px 10px;
    gap: 8px;
    border-radius: 24px;
    background: rgba(12, 16, 28, 0.88);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.12);
  }

  .floating-dock::-webkit-scrollbar {
    display: none;
  }

  .dock-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  .dock-btn.end-call {
    width: 52px;
    min-width: 52px;
    border-radius: 22px;
  }

  .dock-divider {
    height: 20px;
    margin: 0 2px;
  }

  /* Mobile Bottom Sheet Drawers (Chat, Notes, Whiteboard, Participants) */
  .drawer-panel {
    top: auto !important;
    bottom: 0 !important;
    right: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-height: 82dvh !important;
    border-radius: 28px 28px 0 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.16) !important;
    border-left: none !important;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.9) !important;
    transform: translateY(105%) !important;
    transition: transform 0.32s cubic-bezier(0.32, 1, 0.23, 1) !important;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }

  .drawer-panel.open {
    transform: translateY(0) !important;
  }

  .drawer-header {
    padding: 12px 16px 14px 16px;
    position: relative;
  }

  .mobile-drawer-handle {
    width: 40px;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 9999px;
    margin: 0 auto 10px auto;
  }

  .whiteboard-drawer {
    width: 100% !important;
  }
}

/* Mobile-Specific Buttons */
.mobile-flip-btn {
  display: flex;
}

/* Rear camera mirror override */
.video-tile.local-tile.rear-cam video {
  transform: none !important;
}


/* Chips & Tool Selectors */
.btn-fx-chip,
.btn-tool-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-fx-chip:hover,
.btn-tool-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.btn-fx-chip.active,
.btn-tool-chip.active {
  background: rgba(0, 240, 255, 0.18);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 12px var(--accent-cyan-glow);
}

.reaction-item-btn {
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reaction-item-btn:hover {
  transform: scale(1.35);
}

/* Participant List in Drawer */
.participant-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 14px;
  border-radius: 12px;
}

.participant-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.participant-item-name {
  font-size: 0.88rem;
  font-weight: 600;
}

.participant-item-role {
  font-size: 0.72rem;
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}
