/* ============================================
   AN9TV DESIGN SYSTEM
   ============================================ */

/* i18n flash prevention — hide translatable elements until translations load */
.i18n-loading [data-i18n],
.i18n-loading [data-i18n-placeholder] {
  visibility: hidden;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
/* Google Fonts loaded via <link> in HTML with referrerpolicy="no-referrer" to prevent referrer leakage */

/* ============================================
   CSS VARIABLES - DESIGN TOKENS
   ============================================ */
:root {
  /* Colors - Dark Theme with Purple Accent (Spotify-inspired) */
  --color-primary: #908FF8;
  --color-primary-dark: #7a79e0;
  --color-primary-light: #b3b2fc;

  --color-background: #0e0e12;
  --color-background-light: #16161d;
  --color-background-lighter: #1e1e28;
  --color-background-overlay: rgba(14, 14, 18, 0.95);

  --color-text-primary: #f0f0f0;
  --color-text-secondary: #a0a0b0;
  --color-text-muted: #606070;

  --color-success: #46d369;
  --color-warning: #ffa42b;
  --color-error: #f3727f;
  --color-info: #539df5;
  --color-accent-gold: #F0B90B;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #908FF8 0%, #6865d8 100%);
  --gradient-dark: linear-gradient(180deg, rgba(14, 14, 18, 0) 0%, rgba(14, 14, 18, 1) 100%);
  --gradient-overlay: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.7) 100%);

  /* Typography */
  --font-primary: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Bebas Neue', cursive;

  --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 */
  --font-size-5xl: 3rem;
  /* 48px */
  --font-size-6xl: 4rem;
  /* 64px */

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

  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* 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 */
  --space-16: 4rem;
  /* 64px */
  --space-20: 5rem;
  /* 80px */
  --space-24: 6rem;
  /* 96px */

  /* Border Radius */
  --radius-sm: 0.25rem;
  /* 4px */
  --radius-md: 0.375rem;
  /* 6px */
  --radius-lg: 0.5rem;
  /* 8px */
  --radius-xl: 0.75rem;
  /* 12px */
  --radius-2xl: 1rem;
  /* 16px */
  --radius-full: 9999px;

  /* Shadows - heavier for dark theme visibility */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 30px rgba(0, 0, 0, 0.45);
  --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.5);

  /* Z-index */
  --z-base: 1;
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;

  /* Breakpoints (for reference in JS) */
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  font-weight: var(--font-weight-normal);
  color: var(--color-text-primary);
  background-color: var(--color-background);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================
   TYPOGRAPHY UTILITIES
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-4);
}

h1 {
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-extrabold);
}

h2 {
  font-size: var(--font-size-4xl);
}

h3 {
  font-size: var(--font-size-3xl);
}

h4 {
  font-size: var(--font-size-2xl);
}

h5 {
  font-size: var(--font-size-xl);
}

h6 {
  font-size: var(--font-size-lg);
}

p {
  margin-bottom: var(--space-4);
}

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

a:hover {
  color: var(--color-primary);
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section {
  padding: var(--space-20) 0;
}

/* ============================================
   FLEX UTILITIES
   ============================================ */
.flex-wrap {
  flex-wrap: wrap;
}

.gap-8 {
  gap: var(--space-8);
}

/* ============================================
   GRID UTILITIES
   ============================================ */
.grid {
  display: grid;
}

.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ============================================
   SPACING UTILITIES
   ============================================ */
.mb-12 {
  margin-bottom: var(--space-12);
}

/* ============================================
   TEXT UTILITIES
   ============================================ */
.text-sm {
  font-size: var(--font-size-sm);
}

.text-xl {
  font-size: var(--font-size-xl);
}

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

.text-primary {
  color: var(--color-primary);
}

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

.text-muted {
  color: var(--color-text-muted);
}

/* ============================================
   DISPLAY UTILITIES
   ============================================ */
.hidden {
  display: none;
}

.inline-block {
  display: inline-block;
}

/* ============================================
   POSITION UTILITIES
   ============================================ */
.relative {
  position: relative;
}

/* ============================================
   ANIMATION UTILITIES
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(0);
  }
}

.animate-fadeInUp {
  animation: fadeInUp var(--transition-base);
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================
   TRANSITION UTILITIES
   ============================================ */
.transition-fast {
  transition: all var(--transition-fast);
}

.transition-slow {
  transition: all var(--transition-slow);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
  html {
    font-size: 15px;
  }

  .container {
    padding: 0 var(--space-4);
  }
}

@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  h1 {
    font-size: var(--font-size-4xl);
  }

  h2 {
    font-size: var(--font-size-3xl);
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 var(--space-3);
  }

  .grid-cols-4 {
    grid-template-columns: 1fr;
  }
}