/* ============================================
   VISION TV v2.0 — DESIGN SYSTEM
   Dark Spiritual Theme + Gold Accents
   ============================================ */

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

:root {
  /* Backgrounds */
  --bg-primary: #0F0F0F;
  --bg-card: #1A1A1A;
  --bg-elevated: #2D2D2D;
  --bg-input: #252525;
  --bg-overlay: rgba(0, 0, 0, 0.7);

  /* Text */
  --text-primary: #F5F5F5;
  --text-secondary: #A8A8A8;
  --text-muted: #6B6B6B;
  --text-inverse: #0F0F0F;

  /* Accent — Gold */
  --gold: #D4AF37;
  --gold-dark: #B8860B;
  --gold-light: #E8D4B8;
  --gold-glow: rgba(212, 175, 55, 0.3);
  --gold-gradient: linear-gradient(135deg, #D4AF37, #B8860B);

  /* Accent — Saffron */
  --saffron: #FF7F00;
  --saffron-glow: rgba(255, 127, 0, 0.2);

  /* System Colors */
  --success: #4ECB71;
  --warning: #FFB84D;
  --error: #FF6B6B;
  --info: #5B9EFF;

  /* Spacing (8-point grid) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --space-3xl: 48px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 50%;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 0 16px rgba(212, 175, 55, 0.25);

  /* Typography */
  --font-heading: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Transitions */
  --ease-fast: 150ms ease;
  --ease-normal: 250ms ease;
  --ease-slow: 400ms ease;
  --ease-spring: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --nav-height: 64px;
  --bottom-nav-height: 60px;
  --max-width: 480px;
  --header-height: 56px;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Native app feel — disable overscroll bounce */
  overscroll-behavior: none;
  -ms-overflow-style: none;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Native app feel */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
  touch-action: pan-y;
  position: fixed;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Allow text selection only in inputs and textareas */
input, textarea, select, [contenteditable] {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* Disable long-press context menu on images and links */
img, a, button {
  -webkit-touch-callout: none;
}

/* Prevent pull-to-refresh and rubber-banding */
.page-content {
  overscroll-behavior: contain;
}

a {
  color: var(--gold);
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

input, textarea, select, button {
  font-family: var(--font-body);
  font-size: 16px;
  outline: none;
  border: none;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 4px;
}

/* Selection */
::selection {
  background: var(--gold);
  color: var(--text-inverse);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, .h1 {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

h2, .h2 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.3px;
}

h3, .h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}

h4, .h4 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.text-lg { font-size: 18px; }

.text-gold { color: var(--gold); }
.text-saffron { color: var(--saffron); }
.text-muted { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-center { text-align: center; }
.text-right { text-align: right; }

.font-heading { font-family: var(--font-heading); }
.font-bold { font-weight: 700; }
.font-semi { font-weight: 600; }
.font-medium { font-weight: 500; }

/* ============================================
   LIGHT THEME
   ============================================ */
body.theme-light {
  --bg-primary: #F5F5F5;
  --bg-card: #FFFFFF;
  --bg-elevated: #E8E8E8;
  --bg-input: #F0F0F0;
  --bg-overlay: rgba(0, 0, 0, 0.4);

  --text-primary: #1A1A1A;
  --text-secondary: #666666;
  --text-muted: #999999;
  --text-inverse: #FFFFFF;

  --gold: #B8860B;
  --gold-dark: #8B6508;
  --gold-light: #D4AF37;
  --gold-glow: rgba(184, 134, 11, 0.2);
  --gold-gradient: linear-gradient(135deg, #D4AF37, #B8860B);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-gold: 0 0 16px rgba(184, 134, 11, 0.15);
}

body.theme-light .header {
  background: rgba(245, 245, 245, 0.92);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

body.theme-light .bottom-nav {
  background: rgba(245, 245, 245, 0.95);
  border-top-color: rgba(0, 0, 0, 0.06);
}

body.theme-light .header-btn {
  background: var(--bg-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

body.theme-light .card {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

body.theme-light .toast {
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
}

body.theme-light .tab {
  background: var(--bg-card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

body.theme-light ::selection {
  background: var(--gold);
  color: #fff;
}

body.theme-light ::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

body.theme-light ::-webkit-scrollbar-thumb {
  background: #CCC;
}
