/* ============================================================
   TOTALITY FESTIVAL — UNICOM LMS Mobile Design System
   Dark learning platform tokens, components, animations
   ============================================================ */

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

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  /* Surfaces (obsidian stack) */
  --bg:              #121318;
  --surface-lowest:  #0d0e13;
  --surface-low:     #1a1b21;
  --surface:         #1e1f25;
  --surface-high:    #292a2f;
  --surface-highest: #34343a;

  /* Text */
  --fg:     #e3e1e9;
  --muted:  #d0c6ab;
  --subtle: #999077;

  /* Borders */
  --border:     rgba(255,255,255,0.08);
  --border-dim: rgba(255,255,255,0.05);

  /* Primary — Corona Gold */
  --primary:           #fff6df;
  --primary-container: #ffd700;
  --on-primary:        #3a3000;
  --primary-glow:      rgba(255,215,0,0.28);
  --primary-glow-soft: rgba(255,215,0,0.10);

  /* Secondary — Atmospheric Cyan */
  --secondary:           #bdf4ff;
  --secondary-container: #00e3fd;
  --on-secondary:        #00363d;
  --secondary-glow:      rgba(0,227,253,0.20);

  /* Tertiary — Celestial Lavender */
  --tertiary:           #fcf3ff;
  --tertiary-container: #e7d1ff;
  --on-tertiary:        #3b2754;

  /* Status */
  --success: oklch(62% 0.18 145);
  --warning: oklch(72% 0.18 60);
  --danger:  oklch(58% 0.22 25);

  /* Level hues (on dark bg) */
  --level-a1: oklch(65% 0.20 145);
  --level-a2: oklch(65% 0.18 175);
  --level-b1: oklch(68% 0.18 210);
  --level-b2: oklch(62% 0.20 265);
  --level-c1: oklch(62% 0.20 290);
  --level-c2: oklch(66% 0.22 315);

  /* Typography */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* Radii */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl:24px;

  /* Safe areas (iOS) */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 34px);
}

/* ── Base Reset ────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { border: none; background: none; cursor: pointer; font: inherit; color: inherit; }
ul, ol { list-style: none; }

/* ── Phone Shell ────────────────────────────────────────────── */
.phone-shell {
  max-width: 390px;
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── iOS Status Bar ─────────────────────────────────────────── */
.status-bar {
  height: 59px;
  padding: 14px 20px 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.dynamic-island {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 126px;
  height: 37px;
  background: #000;
  border-radius: 22px;
  z-index: 20;
}

.status-time {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.01em;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--fg);
}

/* ── Android Status Bar ─────────────────────────────────────── */
.android-status-bar {
  height: 28px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: relative;
}

.android-punch-hole {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  background: #000;
  border-radius: 50%;
}

/* ── Scrollable Content ─────────────────────────────────────── */
.main-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.main-scroll::-webkit-scrollbar { display: none; }

.scroll-pad-bottom { height: 100px; }

/* ── Bottom Tab Bar (iOS) ───────────────────────────────────── */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 390px;
  background: rgba(13, 14, 19, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 10px 0 calc(10px + var(--safe-bottom));
  display: flex;
  z-index: 200;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.tab-item:active { opacity: 0.7; }

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

.tab-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.tab-item.active .tab-label,
.tab-item.active .tab-icon svg { color: var(--primary-container); }

.tab-item:not(.active) .tab-label,
.tab-item:not(.active) .tab-icon svg { color: var(--subtle); }

/* ── Android Bottom Nav ─────────────────────────────────────── */
.android-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 412px;
  background: rgba(13, 14, 19, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 12px 0 20px;
  display: flex;
  z-index: 200;
}

.android-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.android-nav-pill {
  width: 64px;
  height: 32px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.android-nav-item.active .android-nav-pill {
  background: rgba(255,215,0,0.15);
}

.android-nav-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
}

.android-nav-item.active .android-nav-label,
.android-nav-item.active .android-nav-pill svg { color: var(--primary-container); }

.android-nav-item:not(.active) .android-nav-label,
.android-nav-item:not(.active) .android-nav-pill svg { color: var(--subtle); }

/* ── Glass Card ─────────────────────────────────────────────── */
.glass-card {
  background: rgba(30, 31, 37, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r-xl);
}

.glass-card-sm {
  background: rgba(26, 27, 33, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--r-lg);
}

/* ── Progress Bar ───────────────────────────────────────────── */
.progress-track {
  height: 4px;
  background: rgba(255,255,255,0.10);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}

.progress-track-thin {
  height: 2px;
  background: rgba(255,255,255,0.08);
  border-radius: 1px;
  overflow: hidden;
}

.progress-fill-thin {
  height: 100%;
  border-radius: 1px;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  background: var(--primary-container);
  color: var(--on-primary);
  border-radius: var(--r);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 4px 24px var(--primary-glow);
  transition: all 0.18s ease;
  cursor: pointer;
  border: none;
}

.btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 2px 12px var(--primary-glow-soft);
}

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  background: transparent;
  color: var(--secondary);
  border: 1px solid rgba(0,227,253,0.3);
  border-radius: var(--r);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-secondary:active { background: rgba(0,227,253,0.08); }

.btn-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-ghost:active { background: rgba(255,255,255,0.10); }

/* ── Section Header ─────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.01em;
}

.section-link {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  color: var(--secondary);
}

/* ── Badge / Pill ───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-gold {
  background: rgba(255,215,0,0.15);
  border: 1px solid rgba(255,215,0,0.3);
  color: var(--primary-container);
}

.badge-cyan {
  background: rgba(0,227,253,0.12);
  border: 1px solid rgba(0,227,253,0.25);
  color: var(--secondary-container);
}

.badge-lavender {
  background: rgba(231,209,255,0.12);
  border: 1px solid rgba(231,209,255,0.2);
  color: var(--tertiary-container);
}

.badge-muted {
  background: rgba(255,255,255,0.06);
  color: var(--muted);
}

/* ── Activity type icons row ─────────────────────────────────── */
.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Divider ────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 0 20px;
}

/* ── Background Glows ───────────────────────────────────────── */
.glow-decor {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

.animate-in {
  animation: fadeInUp 0.4s cubic-bezier(0.4,0,0.2,1) forwards;
}

.d1 { animation-delay: 0.04s; opacity: 0; }
.d2 { animation-delay: 0.08s; opacity: 0; }
.d3 { animation-delay: 0.12s; opacity: 0; }
.d4 { animation-delay: 0.16s; opacity: 0; }
.d5 { animation-delay: 0.20s; opacity: 0; }
.d6 { animation-delay: 0.24s; opacity: 0; }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: var(--r);
}

/* ── Numeric utility ────────────────────────────────────────── */
.num,
.stat-val,
.qs-val,
.progress-pct {
  font-variant-numeric: tabular-nums;
}

/* ── Scrollbars hidden globally ─────────────────────────────── */
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }
