/**
 * design-system.css
 * Google Play Store authentic design tokens, Light/Dark theme engine, typography, and animations.
 */

:root {
  /* Default: Google Play Light Mode */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8F9FA;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #F1F3F4;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8F9FA;
  --bg-glass: rgba(255, 255, 255, 0.92);
  --bg-chip: #F1F3F4;
  --bg-chip-active: #E6F4EA;
  --bg-sticky-bar: rgba(255, 255, 255, 0.96);

  --text-primary: #202124;
  --text-secondary: #5F6368;
  --text-muted: #80868B;
  --text-highlight: #1A73E8;
  --text-chip: #3C4043;
  --text-chip-active: #137333;

  --border-subtle: #E8EAED;
  --border-medium: #DADCE0;
  --border-active: #01875F;

  /* Google Play Brand Colors */
  --play-green: #01875F;
  --play-green-hover: #00704E;
  --play-green-active: #005A3E;
  --play-green-glow: rgba(1, 135, 95, 0.35);
  --play-green-tint: #E6F4EA;

  --play-blue: #1A73E8;
  --play-blue-hover: #1557B0;
  --play-blue-tint: #E8F0FE;

  --star-gold: #E37400;
  --star-gold-bg: #FEF7E0;
  --rating-bar-bg: #E8EAED;
  --rating-bar-fill: #01875F;

  --badge-bg: #E8F0FE;
  --badge-text: #1967D2;

  --header-border: #E8EAED;
  --sticky-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);

  /* Typography */
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Google Sans', Roboto, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-size-2xs: 0.6875rem; /* 11px */
  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.875rem;   /* 14px */
  --font-size-base: 1rem;     /* 16px */
  --font-size-lg: 1.125rem;   /* 18px */
  --font-size-xl: 1.25rem;    /* 20px */
  --font-size-2xl: 1.5rem;    /* 24px */
  --font-size-3xl: 1.875rem;  /* 30px */
  --font-size-4xl: 2.25rem;   /* 36px */

  /* Spacing */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */

  /* Border Radii */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px rgba(60, 64, 67, 0.12), 0 1px 2px rgba(60, 64, 67, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(60, 64, 67, 0.15), 0 2px 4px -2px rgba(60, 64, 67, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(60, 64, 67, 0.18), 0 4px 6px -4px rgba(60, 64, 67, 0.12);
  --shadow-xl: 0 20px 25px -5px rgba(60, 64, 67, 0.2), 0 8px 10px -6px rgba(60, 64, 67, 0.15);
  --shadow-cta: 0 8px 20px -4px var(--play-green-glow), 0 4px 8px -2px rgba(0, 0, 0, 0.1);
  --shadow-cta-hover: 0 12px 28px -4px var(--play-green-glow), 0 6px 12px -2px rgba(0, 0, 0, 0.15);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 350ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout Widths */
  --max-width-mobile: 480px;
  --max-width-tablet: 768px;
  --max-width-desktop: 1040px;
}

/* Automatic System Phone Mode (Automatically adapts to phone's Light or Dark theme) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #121212;
    --bg-secondary: #1F1F1F;
    --bg-surface: #1F1F1F;
    --bg-surface-elevated: #28292A;
    --bg-card: #1F1F1F;
    --bg-card-hover: #28292A;
    --bg-glass: rgba(18, 18, 18, 0.92);
    --bg-chip: #2D3135;
    --bg-chip-active: #1E3A2F;
    --bg-sticky-bar: rgba(31, 31, 31, 0.96);

    --text-primary: #E8EAED;
    --text-secondary: #9AA0A6;
    --text-muted: #80868B;
    --text-highlight: #8AB4F8;
    --text-chip: #E8EAED;
    --text-chip-active: #81C995;

    --border-subtle: #2F3336;
    --border-medium: #3C4043;
    --border-active: #00A36C;

    --play-green: #00A36C;
    --play-green-hover: #00C885;
    --play-green-active: #00875E;
    --play-green-glow: rgba(0, 163, 108, 0.4);
    --play-green-tint: #143527;

    --play-blue: #8AB4F8;
    --play-blue-hover: #ADC8FF;
    --play-blue-tint: #1C2B42;

    --star-gold: #FDD663;
    --star-gold-bg: #372E14;
    --rating-bar-bg: #3C4043;
    --rating-bar-fill: #00A36C;

    --badge-bg: #1C2B42;
    --badge-text: #8AB4F8;

    --header-border: #2F3336;
    --sticky-shadow: 0 -4px 16px rgba(0, 0, 0, 0.5);
  }
}

/* Global Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color var(--transition-base), color var(--transition-base);
}

/* Accessibility Focus States */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--play-green);
  outline-offset: 2px;
}

/* Typography Base */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

p {
  color: var(--text-secondary);
}

a {
  color: var(--play-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  text-decoration: underline;
}

/* Main Responsive Container */
.app-container {
  width: 100%;
  max-width: var(--max-width-mobile);
  margin: 0 auto;
  padding: 0 var(--space-3);
  position: relative;
  flex: 1;
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   Animations & Maximum Conversion Highlighting
   ========================================================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseGlowRing {
  0%, 100% {
    box-shadow: 0 4px 16px rgba(0, 163, 108, 0.45);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 8px 26px rgba(0, 163, 108, 0.65);
    transform: scale(1.015);
  }
}

@keyframes shimmerBeam {
  0% {
    transform: translateX(-150%) skewX(-25deg);
  }
  35%, 100% {
    transform: translateX(250%) skewX(-25deg);
  }
}

.animate-fade-in-up {
  animation: fadeInUp var(--transition-smooth) forwards;
}

.animate-pulse-cta {
  animation: pulseGlowRing 2.2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}
