/* ============================================================
 *  NIKE XR — Styles (shadcn-inspired design system)
 * ============================================================
 *  Design tokens and visual language inspired by shadcn/ui:
 *    - Neutral color palette with HSL-based tokens
 *    - Clean borders, subtle shadows, and backdrop blur
 *    - Inter / Geist-style typography
 *    - Smooth micro-interactions
 *
 *  STUDENTS:
 *    - Change CSS custom properties (--variables) below
 *    - The entire look updates instantly on reload
 * ============================================================ */

/* ── DESIGN TOKENS (shadcn-inspired) ─────────────────────── */
:root {
  /* — Colors (dark theme) — */
  --background:       hsl(240 10% 4%);
  --foreground:       hsl(0 0% 98%);
  --card:             hsl(240 10% 4%);
  --card-foreground:  hsl(0 0% 98%);
  --muted:            hsl(240 4% 16%);
  --muted-foreground: hsl(240 5% 65%);
  --accent:           hsl(240 4% 16%);
  --accent-foreground:hsl(0 0% 98%);
  --border:           hsl(240 4% 16%);
  --ring:             hsl(240 5% 65%);
  --primary:          hsl(0 0% 98%);
  --primary-foreground: hsl(240 6% 10%);
  --secondary:        hsl(240 4% 16%);
  --secondary-foreground: hsl(0 0% 98%);
  --destructive:      hsl(0 63% 31%);

  /* — Radius — */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* — Spacing — */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* — Typography — */
  --font-sans: "Inter", "Geist Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", "SF Mono", "Fira Code", monospace;

  /* — Shadows — */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

  /* — Transitions — */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Google Font (Inter) ──────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── RESET & BASE ──────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  overflow: hidden;
  font-family: var(--font-sans);
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── OVERLAY (shared base for every panel) ─────────────────── */
.overlay {
  position: fixed;
  z-index: 10;
  pointer-events: none;
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ── LOADING SCREEN ───────────────────────────────────────── */
#loading-overlay {
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background);
  z-index: 100;
}

.loading-content {
  text-align: center;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  border-top-color: var(--foreground);
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-6);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--foreground);
  margin-bottom: var(--space-2);
}

.loading-sub {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted-foreground);
}

/* ── INTRO SCREEN ──────────────────────────────────────────── */
#intro-overlay {
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsla(240, 10%, 4%, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.intro-card {
  text-align: center;
  max-width: 480px;
  padding: var(--space-12) var(--space-10);
}

.intro-line {
  width: 32px;
  height: 1px;
  background: var(--border);
  margin: 0 auto var(--space-10);
}

.intro-line.bottom {
  margin: var(--space-10) auto 0;
}

.brand-title {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
  color: var(--foreground);
}

.brand-tagline {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-bottom: var(--space-2);
}

.brand-subtitle {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
  opacity: 0.6;
  margin-bottom: var(--space-12);
}

/* ── BUTTONS (shadcn-inspired variants) ───────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  white-space: nowrap;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-normal);
  /* shadcn focus ring */
  position: relative;
}

.btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

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

/* Primary — solid white button */
.btn-primary {
  height: 44px;
  padding: 0 var(--space-8);
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: var(--radius-md);
}

.btn-primary:hover {
  background: hsl(0 0% 90%);
}

/* AR intro button — green accent */
.btn-ar-intro {
  height: 44px;
  padding: 0 var(--space-8);
  background: #00FF88;
  color: #000;
  border-radius: var(--radius-md);
  margin-top: var(--space-3);
  font-weight: 700;
}

.btn-ar-intro:hover {
  background: #00cc6e;
}

/* Secondary — outlined / ghost button */
.btn-secondary {
  height: 36px;
  padding: 0 var(--space-5);
  background: var(--secondary);
  color: var(--secondary-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 12px;
}

.btn-secondary:hover {
  background: hsl(240 4% 20%);
  border-color: hsl(240 4% 24%);
}

/* Mode button — toggle style */
.btn-mode {
  height: 32px;
  padding: 0 var(--space-4);
  background: transparent;
  color: var(--muted-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 11px;
  letter-spacing: 0.08em;
  transition: all var(--transition-normal);
}

.btn-mode:hover {
  background: var(--secondary);
  color: var(--foreground);
  border-color: hsl(240 4% 24%);
}

.btn-mode.active {
  background: var(--foreground);
  color: var(--background);
  border-color: var(--foreground);
}

/* Icon button — circle */
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--secondary);
  color: var(--secondary-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 14px;
}

.btn-icon:hover {
  background: hsl(240 4% 20%);
}

/* ── INFO PANEL (right side — shadcn Card style) ──────────── */
.panel-right {
  top: 50%;
  right: var(--space-6);
  transform: translateY(-50%);
  width: 340px;
  max-height: 70vh;
  padding: var(--space-6);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.panel-right.visible {
  transform: translateY(-50%) translateX(0);
}

.panel-right.hidden {
  transform: translateY(-50%) translateX(12px);
}

.panel-accent-bar {
  width: 24px;
  height: 2px;
  background: var(--muted-foreground);
  margin-bottom: var(--space-5);
  border-radius: var(--radius-full);
  transition: background var(--transition-slow), width var(--transition-slow);
}

.panel-right h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: var(--space-3);
  color: var(--foreground);
}

.panel-right p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted-foreground);
  margin-bottom: var(--space-6);
  font-weight: 400;
}

/* ── BOTTOM CONTROLS BAR ───────────────────────────────────── */
.controls-bar {
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-2);
  align-items: center;
  padding: var(--space-2) var(--space-3);
  background: hsla(240, 10%, 6%, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
}

.controls-bar.hidden {
  transform: translateX(-50%) translateY(8px);
}

.controls-bar .divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 var(--space-1);
}

/* ── STATE INDICATOR (top-left — Badge style) ──────────────── */
.state-indicator {
  top: var(--space-5);
  left: var(--space-5);
  padding: var(--space-1) var(--space-3);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
}

/* ── GRAB HINT (bottom-center floating text) ─────────────── */
.grab-hint {
  bottom: calc(var(--space-6) + 56px);
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-2) var(--space-4);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  background: hsla(240, 10%, 6%, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.grab-hint.visible {
  animation: grabPulse 2s ease-in-out infinite;
}

.grab-hint.hidden {
  animation: none;
  opacity: 0 !important;
}

@keyframes grabPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* ── UTILITY ───────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* ── RESPONSIVE — Quest 3 browser is ~1920 wide ────────────── */
@media (max-width: 640px) {
  .brand-title {
    font-size: 36px;
    letter-spacing: 0.2em;
  }
  .panel-right {
    width: 280px;
    right: var(--space-3);
    padding: var(--space-5);
  }
  .controls-bar {
    padding: var(--space-2);
    gap: var(--space-1);
  }
  .intro-card {
    padding: var(--space-8) var(--space-5);
  }
}
