/* ========================================
   FitLife Bulgaria — Design Tokens
   ======================================== */

:root {
  /* ── Primary Colors ── */
  --primary: #6C5CE7;
  --primary-light: #A29BFE;
  --primary-dark: #5A4BD1;
  --primary-glow: rgba(108, 92, 231, 0.35);

  /* ── Accent Colors ── */
  --accent: #00D2FF;
  --accent-light: #74E8FF;
  --accent-dark: #00B4D8;
  --accent-glow: rgba(0, 210, 255, 0.3);

  /* ── Success / Warning / Danger ── */
  --success: #00E676;
  --success-glow: rgba(0, 230, 118, 0.25);
  --warning: #FFD600;
  --warning-glow: rgba(255, 214, 0, 0.25);
  --danger: #FF5252;
  --danger-glow: rgba(255, 82, 82, 0.25);
  --orange: #FF9100;

  /* ── Backgrounds (Dark Mode Default) ── */
  --bg-primary: #0A0E1A;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-card-hover: rgba(30, 41, 65, 0.9);
  --bg-glass: rgba(255, 255, 255, 0.05);
  --bg-glass-strong: rgba(255, 255, 255, 0.1);
  --bg-input: rgba(255, 255, 255, 0.07);
  --bg-modal: rgba(10, 14, 26, 0.95);

  /* ── Text Colors ── */
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-inverse: #0A0E1A;

  /* ── Borders ── */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.15);
  --border-strong: rgba(255, 255, 255, 0.25);

  /* ── Gradients ── */
  --gradient-primary: linear-gradient(135deg, #6C5CE7 0%, #00D2FF 100%);
  --gradient-warm: linear-gradient(135deg, #FF6B6B 0%, #FFD93D 100%);
  --gradient-success: linear-gradient(135deg, #00E676 0%, #00D2FF 100%);
  --gradient-fire: linear-gradient(135deg, #FF5252 0%, #FF9100 100%);
  --gradient-story: linear-gradient(135deg, #833AB4 0%, #FD1D1D 50%, #FCB045 100%);
  --gradient-card: linear-gradient(145deg, rgba(30, 41, 65, 0.6) 0%, rgba(17, 24, 39, 0.8) 100%);
  --gradient-bg: radial-gradient(ellipse at 20% 50%, rgba(108, 92, 231, 0.08) 0%, transparent 50%),
                 radial-gradient(ellipse at 80% 20%, rgba(0, 210, 255, 0.06) 0%, transparent 50%),
                 radial-gradient(ellipse at 50% 80%, rgba(255, 82, 82, 0.04) 0%, transparent 50%);

  /* ── Typography ── */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Outfit', 'Inter', sans-serif;

  --fs-xs: 0.6875rem;    /* 11px */
  --fs-sm: 0.75rem;      /* 12px */
  --fs-base: 0.875rem;   /* 14px */
  --fs-md: 1rem;         /* 16px */
  --fs-lg: 1.125rem;     /* 18px */
  --fs-xl: 1.375rem;     /* 22px */
  --fs-2xl: 1.75rem;     /* 28px */
  --fs-3xl: 2.25rem;     /* 36px */

  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-black: 900;

  --lh-tight: 1.2;
  --lh-normal: 1.5;
  --lh-relaxed: 1.7;

  /* ── Spacing ── */
  --space-xs: 0.25rem;   /* 4px */
  --space-sm: 0.5rem;    /* 8px */
  --space-md: 0.75rem;   /* 12px */
  --space-base: 1rem;    /* 16px */
  --space-lg: 1.25rem;   /* 20px */
  --space-xl: 1.5rem;    /* 24px */
  --space-2xl: 2rem;     /* 32px */
  --space-3xl: 3rem;     /* 48px */

  /* ── Border Radius ── */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* ── Shadows ── */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow-primary: 0 0 20px var(--primary-glow);
  --shadow-glow-accent: 0 0 20px var(--accent-glow);
  --shadow-glow-success: 0 0 20px var(--success-glow);

  /* ── Transitions ── */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ── Z-Index ── */
  --z-base: 1;
  --z-dropdown: 100;
  --z-modal: 500;
  --z-toast: 700;
  --z-navbar: 900;
  --z-overlay: 1000;

  /* ── iOS Safe Areas ── */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  /* ── Layout ── */
  --navbar-height: 64px;
  --header-height: 56px;
  --max-width: 440px;
}

/* ── Light Mode Override ── */
body.light-mode {
  --bg-primary: #F8FAFC;
  --bg-secondary: #EDF2F7;
  --bg-card: rgba(255, 255, 255, 0.98);
  --bg-card-hover: rgba(241, 245, 249, 0.98);
  --bg-glass: rgba(0, 0, 0, 0.04);
  --bg-glass-strong: rgba(0, 0, 0, 0.07);
  --bg-input: rgba(0, 0, 0, 0.05);
  --bg-modal: rgba(255, 255, 255, 0.98);
  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --text-inverse: #FFFFFF;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-medium: rgba(0, 0, 0, 0.14);
  --border-strong: rgba(0, 0, 0, 0.22);
  --gradient-card: linear-gradient(145deg, #FFFFFF 0%, #F8FAFC 100%);
  --gradient-bg: none;
  background-color: #F1F5F9;
  color: #0F172A;
}

body.light-mode .card,
body.light-mode .stat-card,
body.light-mode .workout-plan-card,
body.light-mode .meal-card,
body.light-mode .location-card,
body.light-mode .post-card {
  background: #FFFFFF;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  color: #0F172A;
}

body.light-mode .status-bar {
  background: rgba(248, 250, 252, 0.96);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  color: #0F172A;
}

body.light-mode .bottom-nav {
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.06);
}

body.light-mode .exercise-item {
  background: rgba(0, 0, 0, 0.03);
}

body.light-mode .exercise-check {
  border-color: #CBD5E1;
  background: #F8FAFC;
}

body.light-mode .page-header {
  background: rgba(248, 250, 252, 0.92);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-mode .tab {
  background: rgba(0, 0, 0, 0.05);
  color: #475569;
}

body.light-mode .tab.active {
  background: var(--gradient-primary);
  color: #FFFFFF;
}

body.light-mode .exercise-name,
body.light-mode h1,
body.light-mode h2,
body.light-mode h3,
body.light-mode h4,
body.light-mode .location-name,
body.light-mode .post-username,
body.light-mode .stat-value {
  color: #0F172A;
}
