/* ============================================
   DESIGN TOKENS - Glassmorphism Design System
   ============================================ */

:root {
  /* === BACKGROUND GRADIENTS === */
  --bg-gradient-primary: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  --bg-gradient-secondary: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  --bg-gradient-accent: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --bg-gradient-cta: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --bg-gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  --bg-gradient-danger: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
  --bg-gradient-warning: linear-gradient(135deg, #f6e05e 0%, #ed8936 100%);
  --bg-gradient-info: linear-gradient(135deg, #63b3ed 0%, #4299e1 100%);

  /* === SOLID COLORS === */
  --color-primary: #7c3aed;
  --color-primary-light: #a78bfa;
  --color-primary-dark: #5b21b6;
  --color-secondary: #3b82f6;
  --color-secondary-light: #60a5fa;
  --color-accent: #ec4899;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #06b6d4;

  /* === TEXT COLORS === */
  --text-primary: #f8fafc;
  --text-secondary: rgba(248, 250, 252, 0.7);
  --text-muted: rgba(248, 250, 252, 0.5);
  --text-on-glass: #f1f5f9;
  --text-on-light: #1e293b;
  --text-heading: #ffffff;
  --text-link: #90cdf4;

  /* === GLASSMORPHISM SURFACES === */
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-bg-hover: rgba(255, 255, 255, 0.12);
  --glass-bg-active: rgba(255, 255, 255, 0.16);
  --glass-bg-strong: rgba(255, 255, 255, 0.15);
  --glass-bg-card: rgba(255, 255, 255, 0.1);
  --glass-bg-input: rgba(255, 255, 255, 0.06);
  --glass-bg-sidebar: rgba(15, 12, 41, 0.85);
  --glass-bg-header: rgba(15, 12, 41, 0.75);
  --glass-bg-modal: rgba(255, 255, 255, 0.12);

  /* === GLASS BORDERS === */
  --glass-border: 1px solid rgba(255, 255, 255, 0.15);
  --glass-border-light: 1px solid rgba(255, 255, 255, 0.1);
  --glass-border-strong: 1px solid rgba(255, 255, 255, 0.25);
  --glass-border-focus: 1px solid rgba(124, 58, 237, 0.6);
  --glass-border-color: rgba(255, 255, 255, 0.15);
  --glass-border-color-light: rgba(255, 255, 255, 0.1);

  /* === BLUR VALUES === */
  --blur-sm: blur(8px);
  --blur-md: blur(12px);
  --blur-lg: blur(20px);
  --blur-xl: blur(40px);

  /* === SHADOWS & GLOWS === */
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.25);
  --shadow-glass-sm: 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-glass-lg: 0 16px 48px rgba(0, 0, 0, 0.3);
  --shadow-glow-primary: 0 0 20px rgba(124, 58, 237, 0.3);
  --shadow-glow-accent: 0 0 20px rgba(236, 72, 153, 0.3);
  --shadow-glow-success: 0 0 20px rgba(16, 185, 129, 0.3);
  --shadow-glow-danger: 0 0 20px rgba(239, 68, 68, 0.3);
  --shadow-glow-warning: 0 0 20px rgba(245, 158, 11, 0.3);
  --shadow-glow-info: 0 0 20px rgba(6, 182, 212, 0.3);
  --shadow-inset-glass: inset 0 1px 1px rgba(255, 255, 255, 0.1);

  /* === TYPOGRAPHY === */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;
  --text-hero: clamp(2.5rem, 5vw, 4rem);

  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;

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

  /* === SPACING SCALE === */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* === BORDER RADIUS === */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* === TRANSITIONS === */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
  --transition-spring: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* === LAYOUT === */
  --container-max: 1200px;
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 72px;
  --header-height: 64px;
  --z-sidebar: 100;
  --z-header: 200;
  --z-modal-backdrop: 900;
  --z-modal: 1000;
  --z-toast: 1100;
}

/* === LIGHT MODE === */
[data-theme="light"] {
  --bg-gradient-primary: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 50%, #ddd6fe 100%);
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-bg-hover: rgba(255, 255, 255, 0.75);
  --glass-bg-active: rgba(255, 255, 255, 0.85);
  --glass-bg-card: rgba(255, 255, 255, 0.65);
  --glass-bg-input: rgba(255, 255, 255, 0.5);
  --glass-bg-sidebar: rgba(255, 255, 255, 0.8);
  --glass-bg-header: rgba(255, 255, 255, 0.75);
  --glass-border: 1px solid rgba(124, 58, 237, 0.15);
  --glass-border-light: 1px solid rgba(124, 58, 237, 0.1);
  --glass-border-color: rgba(124, 58, 237, 0.15);
  --glass-border-color-light: rgba(124, 58, 237, 0.1);
  --text-primary: #1e293b;
  --text-secondary: rgba(30, 41, 59, 0.7);
  --text-muted: rgba(30, 41, 59, 0.5);
  --text-on-glass: #334155;
  --text-heading: #1e293b;
  --text-link: #3b82f6;
  --shadow-glass: 0 8px 32px rgba(124, 58, 237, 0.1);
  --shadow-glass-sm: 0 4px 16px rgba(124, 58, 237, 0.08);
}

/* === TELEGRAM MINI APP BRIDGE === */
/* Overrides glassmorphism tokens with TG native theme variables.
   Works for both light and dark Telegram themes automatically. */
.mini-app {
  /* Primary colors from TG theme */
  --color-primary: var(--tg-theme-button-color, #2481cc);
  --color-primary-light: var(--tg-theme-button-color, #2481cc);
  --color-primary-dark: var(--tg-theme-button-color, #1a6daa);

  /* Text colors from TG theme */
  --text-primary: var(--tg-theme-text-color, #000000);
  --text-secondary: var(--tg-theme-hint-color, #8e8e93);
  --text-muted: var(--tg-theme-hint-color, #8e8e93);
  --text-heading: var(--tg-theme-text-color, #000000);
  --text-on-glass: var(--tg-theme-text-color, #000000);
  --text-link: var(--tg-theme-link-color, #2481cc);

  /* Surfaces — solid TG backgrounds, no glass transparency */
  --glass-bg: var(--tg-theme-secondary-bg-color, #efeff4);
  --glass-bg-hover: var(--tg-theme-secondary-bg-color, #e5e5ea);
  --glass-bg-active: var(--tg-theme-secondary-bg-color, #d1d1d6);
  --glass-bg-card: var(--tg-theme-secondary-bg-color, #ffffff);
  --glass-bg-input: var(--tg-theme-secondary-bg-color, #efeff4);
  --glass-bg-modal: var(--tg-theme-bg-color, #ffffff);

  /* Borders — neutral gray, works on both light and dark */
  --glass-border: 1px solid rgba(128, 128, 128, 0.2);
  --glass-border-light: 1px solid rgba(128, 128, 128, 0.12);
  --glass-border-color: rgba(128, 128, 128, 0.2);
  --glass-border-color-light: rgba(128, 128, 128, 0.12);

  /* Shadows — minimal for native TG feel */
  --shadow-glass: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-glass-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-glass-lg: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-glow-primary: none;
  --shadow-glow-success: none;
  --shadow-glow-danger: none;
  --shadow-glow-warning: none;

  /* Disable blur effects in Mini App (performance + no glass bg) */
  --blur-sm: blur(0px);
  --blur-md: blur(0px);
  --blur-lg: blur(0px);
  --blur-xl: blur(0px);
}
