@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700&family=Inter:wght@400;500;600&family=Space+Grotesk:wght@500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,400,1,0');

:root {
  --bg: #202124;
  --bg-elevated: #292a2d;
  --surface: #2d2e31;
  --surface-hover: #3c4043;
  --surface-container: #303134;
  --on-surface: #e8eaed;
  --on-surface-secondary: #9aa0a6;
  
  --primary: #8ab4f8;
  --primary-dark: #669df6;
  --primary-container: rgba(138, 180, 248, 0.08);
  --on-primary: #202124;
  
  --error: #f28b82;
  --error-bg: rgba(242, 139, 130, 0.12);
  --success: #81c995;
  --success-bg: rgba(129, 201, 149, 0.1);
  --warning: #fdd663;
  
  --border: rgba(255, 255, 255, 0.08);
  --divider: rgba(255, 255, 255, 0.06);
  
  --font-main: 'Inter', 'Google Sans', sans-serif;
  --font-display: 'Space Grotesk', 'Google Sans', sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 100px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--on-surface);
  font-family: var(--font-main);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }

/* ─── Material Symbols ─── */
.material-symbols-rounded {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  display: inline-flex;
  vertical-align: middle;
}

/* ─── Typography ─── */
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; }
.text-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, #c58af9 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.text-muted { color: var(--on-surface-secondary); }
.text-error { color: var(--error); }
.text-success { color: var(--success); }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 24px; height: 40px;
  font-family: var(--font-main); font-weight: 500; font-size: 14px;
  border-radius: var(--radius-full); border: none;
  background: var(--surface-hover); color: var(--on-surface);
  cursor: pointer; transition: all 0.2s; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: rgba(255,255,255,0.12); }
.btn.primary {
  background: var(--primary); color: var(--on-primary); font-weight: 600;
}
.btn.primary:hover { background: var(--primary-dark); box-shadow: 0 1px 8px rgba(138,180,248,0.25); }
.btn.danger {
  background: #ea4335; color: #fff; font-weight: 600;
}
.btn.danger:hover { background: #d93025; }

/* ─── Icon Buttons ─── */
.icon-btn {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-hover); color: var(--on-surface);
  border: none; cursor: pointer; transition: all 0.15s;
  position: relative;
}
.icon-btn .material-symbols-rounded { font-size: 22px; }
.icon-btn:hover { background: rgba(255,255,255,0.15); }
.icon-btn.active { background: var(--primary-container); color: var(--primary); }
.icon-btn.danger-state { background: var(--error-bg); color: var(--error); }
.icon-btn.danger-state:hover { background: rgba(242,139,130,0.2); }

.control-btn-wrapper {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.btn-label {
  font-size: 11px; font-weight: 500; color: var(--on-surface-secondary);
}

/* ─── Input Fields ─── */
.input-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.input-group label {
  font-size: 12px; font-weight: 500; color: var(--on-surface-secondary);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.input-field {
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px;
  color: var(--on-surface); font-family: var(--font-main); font-size: 14px;
  outline: none; transition: border-color 0.2s; width: 100%;
}
.input-field:focus { border-color: var(--primary); }
.input-field::placeholder { color: var(--on-surface-secondary); }

/* ─── Navbar ─── */
.navbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 24px; height: 64px;
  background: var(--bg); border-bottom: 1px solid var(--divider);
}
.brand {
  font-family: var(--font-display); font-size: 22px; font-weight: 700;
  display: flex; align-items: center; gap: 10px; color: var(--on-surface);
}
.brand .meet { color: var(--primary); }

/* ─── Auth Overlay ─── */
.auth-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
}
.auth-panel {
  width: 100%; max-width: 400px; padding: 40px 36px;
  background: var(--bg-elevated); border-radius: var(--radius-xl);
  border: 1px solid var(--border); text-align: center;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  display: flex; flex-direction: column; gap: 12px;
}
.auth-panel h2 { font-size: 24px; margin-bottom: 0; }
.auth-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }

/* ─── Lobby ─── */
.lobby-container {
  max-width: 1200px; margin: 0 auto; padding: 40px 32px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px;
  align-items: center; min-height: calc(100vh - 64px);
}
@media (max-width: 900px) { .lobby-container { grid-template-columns: 1fr; gap: 32px; } }

.lobby-content h1 { font-size: 44px; line-height: 1.15; margin-bottom: 16px; color: var(--on-surface); }
.lobby-content p { max-width: 440px; }

.action-card {
  background: var(--surface-container); border-radius: var(--radius-lg);
  padding: 28px; border: 1px solid var(--border);
}

/* ─── Camera Preview ─── */
.preview-container {
  position: relative; aspect-ratio: 16/9; border-radius: var(--radius-lg);
  overflow: hidden; background: #000;
  border: 1px solid var(--border);
}
.preview-container video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.preview-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 20px 16px 14px; background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  display: flex; justify-content: center; gap: 16px;
}
.preview-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--on-surface-secondary);
}
.audio-meter {
  position: absolute; bottom: 14px; left: 14px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.audio-level {
  width: 100%; height: 100%; background: var(--success);
  opacity: 0.5; transform-origin: bottom; transform: scaleY(0.1); transition: transform 0.1s;
}
.mic-icon { position: absolute; z-index: 2; font-size: 14px; }

/* ─── Glass Panel ─── */
.glass-panel {
  background: var(--surface-container); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* ─── Animations ─── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
