/* =============================================
   TawagNow - Lightweight Video Call Platform
   Premium Dark Theme with Glassmorphism
   ============================================= */

/* --- CSS Custom Properties --- */
:root {
  --bg-primary: #06080f;
  --bg-secondary: #0d1120;
  --bg-tertiary: #141832;
  --glass-bg: rgba(14, 18, 40, 0.75);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --accent-1: #00d4aa;
  --accent-2: #7c3aed;
  --accent-3: #3b82f6;
  --gradient-accent: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  --gradient-warm: linear-gradient(135deg, #f59e0b, #ef4444);
  --text-primary: #f0f2f8;
  --text-secondary: #8892b0;
  --text-muted: #4a5568;
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.3);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.3);
  --warning: #f59e0b;
  --border-radius: 16px;
  --border-radius-sm: 10px;
  --border-radius-xs: 6px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

/* --- Animated Background --- */
.bg-decoration {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
  animation: orbFloat 20s ease-in-out infinite;
}

.bg-orb-1 {
  width: 500px;
  height: 500px;
  background: var(--accent-1);
  top: -150px;
  right: -100px;
  animation-delay: 0s;
}

.bg-orb-2 {
  width: 400px;
  height: 400px;
  background: var(--accent-2);
  bottom: -100px;
  left: -100px;
  animation-delay: -7s;
}

.bg-orb-3 {
  width: 300px;
  height: 300px;
  background: var(--accent-3);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(40px, -30px) scale(1.05); }
  50% { transform: translate(-20px, 40px) scale(0.95); }
  75% { transform: translate(30px, 20px) scale(1.02); }
}

/* --- Icon --- */
.icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.icon-sm {
  width: 16px;
  height: 16px;
}

/* --- Screen System --- */
.screen {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.screen.active {
  opacity: 1;
  visibility: visible;
  z-index: 10;
}

/* --- Typography --- */
h1, h2, h3 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* --- Inputs --- */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.input-group-grow {
  flex: 1;
}

.input-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  outline: none;
  transition: var(--transition);
}

.input::placeholder {
  color: var(--text-muted);
}

.input:focus {
  border-color: var(--accent-1);
  background: rgba(0, 212, 170, 0.04);
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.input-mono {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  letter-spacing: 0.15em;
  font-size: 18px;
  text-align: center;
  text-transform: uppercase;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--border-radius-sm);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.btn:hover::after {
  opacity: 1;
}

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

.btn-primary {
  width: 100%;
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 4px 20px rgba(0, 212, 170, 0.25);
  font-size: 16px;
}

.btn-primary:hover {
  box-shadow: 0 6px 30px rgba(0, 212, 170, 0.35);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-secondary {
  background: rgba(124, 58, 237, 0.2);
  color: var(--accent-2);
  border: 1px solid rgba(124, 58, 237, 0.3);
  padding: 14px 24px;
}

.btn-secondary:hover {
  background: rgba(124, 58, 237, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.03);
}

.btn-icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--border-radius-xs);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-icon-only:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

/* --- Glass Card --- */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  padding: 32px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* --- Divider --- */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 13px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--glass-border);
}

/* =============================================
   LANDING SCREEN
   ============================================= */
.landing-container {
  width: 100%;
  max-width: 420px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  animation: fadeSlideUp 0.6s ease-out;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.logo-section {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(0, 212, 170, 0.25);
  animation: logoPulse 3s ease-in-out infinite;
}

.logo-icon .icon {
  width: 36px;
  height: 36px;
  color: #fff;
}

@keyframes logoPulse {
  0%, 100% { box-shadow: 0 8px 32px rgba(0, 212, 170, 0.25); }
  50% { box-shadow: 0 8px 48px rgba(0, 212, 170, 0.4); }
}

.logo-text {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.logo-text span {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-tagline {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 400;
}

.join-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  width: 100%;
}

.features-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.feature-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.feature-emoji {
  font-size: 14px;
}

/* =============================================
   WAITING SCREEN
   ============================================= */
.waiting-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 24px;
  animation: fadeSlideUp 0.6s ease-out;
  max-width: 420px;
  width: 100%;
}

.pulse-ring-container {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent-1);
  opacity: 0;
  animation: pulseExpand 2.5s ease-out infinite;
}

.pulse-ring-delay {
  animation-delay: 1.25s;
}

@keyframes pulseExpand {
  0% {
    transform: scale(0.5);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.waiting-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.waiting-avatar .icon {
  width: 28px;
  height: 28px;
  color: #fff;
}

.waiting-title {
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  color: var(--text-primary);
}

.room-code-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 32px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.room-code-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.room-code-value-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.room-code-value {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 0.12em;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.share-link-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 20px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--glass-border);
  width: 100%;
  overflow: hidden;
}

.share-link-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.share-link-url {
  font-size: 12px;
  color: var(--accent-1);
  word-break: break-all;
  text-align: center;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.local-preview-wrapper {
  width: 200px;
  height: 150px;
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  border: 2px solid var(--glass-border);
  position: relative;
}

.local-preview-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.preview-label {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: rgba(0,0,0,0.5);
  padding: 2px 10px;
  border-radius: 100px;
}

/* =============================================
   CALL SCREEN
   ============================================= */
#call-screen {
  flex-direction: column;
  padding: 0;
}

/* --- Call Header --- */
.call-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  width: 100%;
  z-index: 20;
  background: linear-gradient(to bottom, rgba(6,8,15,0.9), transparent);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.call-info-left,
.call-info-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.call-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success-glow);
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.call-timer {
  font-size: 13px;
  font-weight: 600;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--text-secondary);
}

.quality-badge {
  font-size: 14px;
  cursor: help;
}

.room-badge {
  font-size: 12px;
  font-weight: 600;
  font-family: 'SF Mono', 'Fira Code', monospace;
  padding: 4px 12px;
  background: rgba(255,255,255,0.06);
  border-radius: 100px;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.participant-count {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* --- Video Grid --- */
.video-grid {
  display: grid;
  gap: 6px;
  width: 100%;
  height: 100%;
  padding: 6px;
  align-items: center;
  justify-items: center;
}

.video-grid[data-count="0"] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-grid[data-count="0"]::after {
  content: 'Waiting for participants...';
  color: var(--text-muted);
  font-size: 16px;
}

.video-grid[data-count="1"] {
  grid-template-columns: 1fr;
}

.video-grid[data-count="2"] {
  grid-template-columns: 1fr 1fr;
}

.video-grid[data-count="3"] {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.video-grid[data-count="3"] .video-tile:first-child {
  grid-column: 1 / -1;
}

.video-grid[data-count="4"] {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.video-grid[data-count="5"],
.video-grid[data-count="6"] {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr 1fr;
}

.video-tile {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  background: var(--bg-secondary);
  animation: tileAppear 0.4s ease-out;
}

@keyframes tileAppear {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.video-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.video-tile .video-name {
  position: absolute;
  bottom: 10px;
  left: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  padding: 4px 12px;
  border-radius: 100px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.video-tile.no-video {
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-tile.no-video::before {
  content: '';
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--gradient-accent);
  opacity: 0.3;
}

/* --- Local PiP --- */
.local-pip {
  position: absolute;
  bottom: 110px;
  right: 16px;
  width: 140px;
  height: 105px;
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.15);
  z-index: 25;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  transition: var(--transition);
}

.local-pip:hover {
  border-color: var(--accent-1);
}

.local-pip video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.local-pip .pip-label {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  padding: 2px 8px;
  border-radius: 100px;
}

.local-pip.camera-off video {
  visibility: hidden;
}

.local-pip.camera-off {
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.local-pip.camera-off::before {
  content: '📷❌';
  font-size: 20px;
}

/* --- Controls Bar --- */
.controls-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 20px 28px;
  background: linear-gradient(to top, rgba(6,8,15,0.95) 60%, transparent);
  z-index: 30;
}

.control-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 18px 8px;
  border: none;
  border-radius: var(--border-radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  min-width: 64px;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.control-btn:active {
  transform: scale(0.93);
}

.control-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-icon .icon {
  width: 22px;
  height: 22px;
}

.control-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.control-btn.off {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.control-btn.off .control-label {
  color: var(--danger);
}

.control-btn.active {
  background: rgba(0, 212, 170, 0.15);
  color: var(--accent-1);
}

.control-btn.active .control-label {
  color: var(--accent-1);
}

.control-btn-end {
  background: var(--danger) !important;
  color: #fff !important;
  box-shadow: 0 4px 16px var(--danger-glow);
}

.control-btn-end:hover {
  background: #dc2626 !important;
  box-shadow: 0 6px 24px var(--danger-glow);
}

.control-btn-end .control-label {
  color: rgba(255,255,255,0.8) !important;
}

/* Unread badge */
.unread-badge {
  position: absolute;
  top: 6px;
  right: 10px;
  width: 10px;
  height: 10px;
  background: var(--accent-1);
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
  animation: badgePop 0.3s ease-out;
}

@keyframes badgePop {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

/* --- Chat Panel --- */
.chat-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 340px;
  max-width: 85vw;
  background: var(--glass-bg);
  border-left: 1px solid var(--glass-border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 35;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.chat-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
}

.chat-empty {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 40px 20px;
}

.chat-bubble {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  animation: bubbleIn 0.2s ease-out;
}

@keyframes bubbleIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-bubble.other {
  background: rgba(255, 255, 255, 0.06);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.chat-bubble.self {
  background: rgba(0, 212, 170, 0.12);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

.chat-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-1);
}

.chat-bubble.self .chat-name {
  color: var(--text-secondary);
}

.chat-text {
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}

.chat-time {
  font-size: 10px;
  color: var(--text-muted);
  align-self: flex-end;
}

.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 16px 24px;
  border-top: 1px solid var(--glass-border);
}

.chat-input-area .input {
  flex: 1;
  padding: 10px 14px;
  font-size: 14px;
}

.btn-send {
  background: var(--gradient-accent);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: var(--border-radius-xs);
}

.btn-send:hover {
  box-shadow: 0 0 16px rgba(0, 212, 170, 0.3);
}

/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: 90%;
  max-width: 400px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  opacity: 0;
  transform: translateY(-12px);
  transition: all 0.3s ease;
  pointer-events: auto;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-info {
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent-3);
  border-color: rgba(59, 130, 246, 0.2);
}

.toast-success {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.2);
}

.toast-warning {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.2);
}

.toast-error {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.2);
}

.toast-chat {
  background: rgba(0, 212, 170, 0.15);
  color: var(--accent-1);
  border-color: rgba(0, 212, 170, 0.15);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 640px) {
  .glass-card {
    padding: 24px;
  }

  .logo-text {
    font-size: 30px;
  }

  .room-code-value {
    font-size: 28px;
  }

  .video-grid[data-count="2"] {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }

  .video-grid[data-count="3"] .video-tile:first-child {
    grid-column: auto;
  }

  .video-grid[data-count="3"],
  .video-grid[data-count="4"],
  .video-grid[data-count="5"],
  .video-grid[data-count="6"] {
    grid-template-columns: 1fr 1fr;
  }

  .local-pip {
    width: 110px;
    height: 82px;
    bottom: 105px;
    right: 10px;
  }

  .controls-bar {
    gap: 4px;
    padding: 12px 8px 24px;
  }

  .control-btn {
    min-width: 52px;
    padding: 12px 10px 6px;
  }

  .chat-panel {
    width: 100%;
    max-width: 100%;
  }

  .features-row {
    gap: 8px;
  }

  .feature-chip {
    padding: 6px 10px;
    font-size: 11px;
  }
}

@media (max-width: 380px) {
  .landing-container {
    padding: 16px;
    gap: 24px;
  }

  .glass-card {
    padding: 20px;
    gap: 16px;
  }

  .btn-primary {
    padding: 12px 20px;
    font-size: 15px;
  }

  .control-btn {
    min-width: 46px;
    padding: 10px 8px 6px;
  }

  .control-label {
    font-size: 9px;
  }
}

/* --- Landscape phone --- */
@media (max-height: 500px) and (orientation: landscape) {
  .controls-bar {
    padding-bottom: 12px;
  }

  .local-pip {
    bottom: 85px;
    width: 100px;
    height: 75px;
  }

  .video-grid[data-count="1"],
  .video-grid[data-count="2"] {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
  }
}

/* =============================================
   UTILITIES & MISC
   ============================================= */
::selection {
  background: rgba(0, 212, 170, 0.3);
  color: #fff;
}

/* Smooth scroll for chat */
.chat-messages {
  scroll-behavior: smooth;
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--accent-1);
  outline-offset: 2px;
}

/* Remove default focus for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}
