/* ── DriveBeats — Nocturne Glass Design System ───────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap');

/* ── Color Tokens ──────────────────────────────────────────────── */
:root {
  /* Base canvas */
  --bg:           #0d0e12;
  --s-lowest:     #0d0e12;
  --s-low:        #1a1b20;
  --s:            #1f1f24;
  --s-high:       #292a2e;
  --s-highest:    #343439;

  /* Glass surfaces */
  --glass:        rgba(255,255,255,0.06);
  --glass2:       rgba(255,255,255,0.04);
  --glass3:       rgba(255,255,255,0.02);
  --border:       rgba(255,255,255,0.12);
  --border2:      rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.2);

  /* Typography */
  --text:   #e3e2e8;
  --text-2: rgba(203,195,215,0.9);
  --text-3: rgba(149,142,160,0.8);

  /* ── Purple Haze (default) ── */
  --accent:       #8b5cf6;
  --accent2:      #d0bcff;
  --accent-c:     #a078ff;
  --accent-bg:    rgba(139,92,246,0.15);
  --accent-dim:   rgba(139,92,246,0.25);
  --accent-glow:  rgba(139,92,246,0.55);
  --blob1:        rgba(139,92,246,0.18);
  --blob2:        rgba(13,102,217,0.12);
  --blob3:        rgba(247,81,161,0.08);

  --radius:  0.75rem;
  --shadow:  0 8px 32px rgba(0,0,0,0.55);
}

html[data-theme="blue"] {
  --accent:       #3b82f6;
  --accent2:      #adc6ff;
  --accent-c:     #0566d9;
  --accent-bg:    rgba(59,130,246,0.15);
  --accent-dim:   rgba(59,130,246,0.25);
  --accent-glow:  rgba(59,130,246,0.55);
  --blob1:        rgba(59,130,246,0.18);
  --blob2:        rgba(5,102,217,0.12);
  --blob3:        rgba(59,200,246,0.08);
}
html[data-theme="green"] {
  --accent:       #10b981;
  --accent2:      #6ee7b7;
  --accent-c:     #059669;
  --accent-bg:    rgba(16,185,129,0.15);
  --accent-dim:   rgba(16,185,129,0.25);
  --accent-glow:  rgba(16,185,129,0.55);
  --blob1:        rgba(16,185,129,0.18);
  --blob2:        rgba(5,150,105,0.12);
  --blob3:        rgba(16,210,150,0.08);
}
html[data-theme="pink"] {
  --accent:       #ec4899;
  --accent2:      #ffb0cd;
  --accent-c:     #f751a1;
  --accent-bg:    rgba(236,72,153,0.15);
  --accent-dim:   rgba(236,72,153,0.25);
  --accent-glow:  rgba(236,72,153,0.55);
  --blob1:        rgba(236,72,153,0.18);
  --blob2:        rgba(247,81,161,0.12);
  --blob3:        rgba(200,72,180,0.08);
}
html[data-theme="amber"] {
  --accent:       #f59e0b;
  --accent2:      #fcd34d;
  --accent-c:     #d97706;
  --accent-bg:    rgba(245,158,11,0.15);
  --accent-dim:   rgba(245,158,11,0.25);
  --accent-glow:  rgba(245,158,11,0.55);
  --blob1:        rgba(245,158,11,0.18);
  --blob2:        rgba(217,119,6,0.12);
  --blob3:        rgba(245,200,11,0.08);
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Ambient Background Blobs ──────────────────────────────────── */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  transition: background 0.6s ease;
}
body::before {
  width: 600px; height: 600px;
  top: -180px; left: -180px;
  background: radial-gradient(circle, var(--blob1) 0%, transparent 70%);
  filter: blur(40px);
}
body::after {
  width: 500px; height: 500px;
  bottom: -120px; right: -120px;
  background: radial-gradient(circle, var(--blob2) 0%, transparent 70%);
  filter: blur(40px);
}
.blob-mid {
  position: fixed;
  width: 400px; height: 400px;
  top: 30%; left: 40%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--blob3) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
  transition: background 0.6s ease;
}

/* ── Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

/* ── Material Symbols ───────────────────────────────────────────── */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
  user-select: none;
}
.material-symbols-outlined.fill { font-variation-settings: 'FILL' 1; }
.material-symbols-outlined.sz18 { font-size: 18px; }
.material-symbols-outlined.sz24 { font-size: 24px; }
.material-symbols-outlined.sz28 { font-size: 28px; }
.material-symbols-outlined.sz32 { font-size: 32px; }

/* ── Glass Surface Mixin ────────────────────────────────────────── */
.glass {
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
}
.glass-2 {
  background: var(--glass2);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--border2);
}

/* ── Card ───────────────────────────────────────────────────────── */
.card {
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
}

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 12px;
  font-size: .85rem; font-weight: 600; font-family: inherit;
  padding: 9px 18px; cursor: pointer;
  transition: all 0.2s ease;
}
.btn:active { transform: scale(.96); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-dim);
}
.btn-primary:hover { opacity: .88; box-shadow: 0 6px 28px var(--accent-glow); }
.btn-secondary {
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text);
  backdrop-filter: blur(12px);
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); border-color: var(--border-hover); }
.btn-danger { background: rgba(255,80,80,0.15); border: 1px solid rgba(255,80,80,0.3); color: #ff9090; }
.btn-danger:hover { background: rgba(255,80,80,0.25); }
.btn-sm { padding: 7px 14px; font-size: .8rem; border-radius: 8px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .4; pointer-events: none; }

/* ── Inputs ─────────────────────────────────────────────────────── */
.input {
  width: 100%;
  background: var(--glass2);
  border: 1px solid var(--border2);
  border-radius: 12px;
  color: var(--text);
  padding: 11px 14px;
  font-size: .9rem; font-family: inherit;
  outline: none;
  backdrop-filter: blur(12px);
  transition: all 0.2s;
}
.input:focus {
  border-color: var(--accent);
  background: var(--glass);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.input::placeholder { color: var(--text-3); }

/* ── Toggle ─────────────────────────────────────────────────────── */
.toggle {
  position: relative; display: inline-block;
  width: 40px; height: 22px; cursor: pointer;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.12);
  border-radius: 11px; border: 1px solid var(--border);
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute; left: 3px; top: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--text-3);
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.toggle input:checked + .toggle-slider { background: var(--accent); border-color: var(--accent-dim); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); background: #fff; }

/* ── Spinner ────────────────────────────────────────────────────── */
.spinner {
  width: 28px; height: 28px;
  border: 2.5px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Badge ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  background: var(--accent-dim);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: .72rem; font-weight: 600;
  color: var(--accent2);
  letter-spacing: .04em;
}

/* ── Toast ──────────────────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(30,31,40,0.9);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 22px;
  font-size: .85rem;
  box-shadow: var(--shadow);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
  z-index: 9999;
  white-space: nowrap;
  pointer-events: none;
  color: var(--text);
}
#toast.show  { transform: translateX(-50%) translateY(0); }
#toast.error { border-color: rgba(255,80,80,.35); color: #ff9090; }
#toast.success { border-color: rgba(16,185,129,.35); color: #6ee7b7; }

/* ── Auth Layout ────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  position: relative; z-index: 1;
}
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--glass);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 44px 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  text-align: center;
  position: relative; z-index: 1;
}
.auth-logo { font-size: 52px; margin-bottom: 12px; }
.auth-title {
  font-size: 2rem; font-weight: 800; margin-bottom: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-subtitle { color: var(--text-3); margin-bottom: 28px; font-size: .9rem; }
.form-group { margin-bottom: 14px; text-align: left; }
.form-group label {
  display: block; font-size: .75rem; color: var(--text-3);
  margin-bottom: 5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
}
.form-error { color: #ff9090; font-size: .82rem; margin-top: 6px; display: none; }
.form-error.show { display: block; }
.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text-3); font-size: .82rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.google-btn {
  width: 100%;
  background: var(--glass2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  padding: 11px;
  font-size: .9rem; font-weight: 600; font-family: inherit;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: all .2s;
  backdrop-filter: blur(12px);
}
.google-btn:hover { background: var(--glass); border-color: var(--border-hover); }

/* ── Page Header ────────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; gap: 14px;
  padding: 0 20px;
  height: 56px;
  background: rgba(13,14,18,0.7);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-bottom: 1px solid var(--border2);
  position: sticky; top: 0; z-index: 100;
}
.page-header-logo {
  font-weight: 800; font-size: 1.1rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none; flex-shrink: 0;
  display: flex; align-items: center; gap: 6px;
}
.page-header-logo:hover { opacity: .85; text-decoration: none; }
.page-header-spacer { flex: 1; }

/* ── Theme Toggle Dots ──────────────────────────────────────────── */
.theme-picker {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border2);
  border-radius: 20px;
}
.theme-dot {
  width: 13px; height: 13px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.theme-dot:hover { transform: scale(1.2); }
.theme-dot.active {
  border-color: rgba(255,255,255,0.8);
  box-shadow: 0 0 8px var(--accent-glow);
  transform: scale(1.15);
}

/* ── Nav Link ───────────────────────────────────────────────────── */
.nav-link {
  color: var(--text-3); font-size: .85rem; font-weight: 500;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid transparent;
  display: flex; align-items: center; gap: 5px;
  transition: all .15s;
  text-decoration: none;
}
.nav-link:hover {
  background: var(--glass);
  border-color: var(--border);
  color: var(--text);
  text-decoration: none;
}
.nav-link.active { background: var(--accent-bg); border-color: var(--accent-dim); color: var(--accent2); }

/* ── User Chip ──────────────────────────────────────────────────── */
.user-chip {
  display: flex; align-items: center; gap: 7px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 20px; padding: 3px 12px 3px 3px;
  backdrop-filter: blur(12px);
}
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-c));
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 10px var(--accent-dim);
}
.user-chip-name { font-size: .82rem; color: var(--text-2); }

/* ── Info Row (Settings page) ───────────────────────────────────── */
.info-row {
  display: flex; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border2);
  font-size: .88rem;
}
.info-row:last-child { border: none; }
.info-label { color: var(--text-3); }

/* ── Danger Zone ────────────────────────────────────────────────── */
.danger-zone {
  border: 1px solid rgba(255,80,80,.25);
  border-radius: 14px; padding: 18px;
  background: rgba(255,80,80,.04);
}
.danger-title { color: #ff9090; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .page-header { padding: 0 12px; height: 52px; }
  .auth-card { padding: 30px 22px; }
  h1 { font-size: 1.5rem; }
  .theme-picker { display: none; }
}
