/*
 * Appfelstrudel Design System
 * Electric Minimalism - A vibrant, modern design for iOS app discovery
 */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* ========================================================================
   CSS RESET & BASE
   ======================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-ink);
  background: var(--color-bg);
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

/* ========================================================================
   CSS CUSTOM PROPERTIES (Design System)
   ======================================================================== */

:root {
  /* === COLORS === */

  /* Primary - Deep Electric Blue */
  --color-primary: #2563EB;
  --color-primary-dark: #1E40AF;
  --color-primary-light: #3B82F6;
  --color-primary-pale: #DBEAFE;

  /* Secondary - Vibrant Coral */
  --color-secondary: #F97316;
  --color-secondary-dark: #EA580C;
  --color-secondary-light: #FB923C;
  --color-secondary-pale: #FFEDD5;

  /* Accent - Electric Cyan */
  --color-accent: #06B6D4;
  --color-accent-dark: #0891B2;
  --color-accent-light: #22D3EE;
  --color-accent-pale: #CFFAFE;

  /* Neutrals - Cool Grays */
  --color-bg: #FAFBFC;
  --color-surface: #FFFFFF;
  --color-surface-elevated: #F8FAFC;
  --color-border: #E2E8F0;
  --color-border-strong: #CBD5E1;
  --color-text-muted: #64748B;
  --color-text-secondary: #475569;
  --color-ink: #1E293B;

  /* Semantic */
  --color-success: #10B981;
  --color-success-dark: #059669;
  --color-warning: #F59E0B;
  --color-error: #EF4444;

  /* Rating Stars */
  --color-star-filled: #FBBF24;
  --color-star-empty: #E2E8F0;

  /* Price Tags */
  --color-free: #10B981;
  --color-paid: #2563EB;

  /* Additional Neutrals */
  --color-text-tertiary: #94A3B8;
  --color-bg-secondary: #F1F5F9;

  /* Medal Colors (Podium Rankings) */
  --color-gold: #F59E0B;
  --color-gold-dark: #D97706;
  --color-gold-light: #FBBF24;
  --color-gold-pale: #FFFBEB;
  --color-silver: #94A3B8;
  --color-silver-dark: #64748B;
  --color-silver-pale: #F8FAFC;
  --color-bronze: #D97706;
  --color-bronze-dark: #B45309;
  --color-bronze-pale: #FEF3C7;

  /* Highlight Color */
  --color-highlight: #FEF3C7;

  /* Legacy aliases for compatibility */
  --color-alpine-teal: var(--color-primary);
  --color-alpine-teal-light: var(--color-primary-light);
  --color-alpine-teal-dark: var(--color-primary-dark);
  --color-parchment: var(--color-bg);
  --color-cream: var(--color-surface-elevated);
  --color-linen: var(--color-border);
  --color-stone: var(--color-border-strong);
  --color-graphite: var(--color-text-muted);

  /* === TYPOGRAPHY === */

  /* Font Families */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'SF Mono', 'Monaco', 'Consolas', monospace;

  /* Type Scale */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */
  --text-5xl: 3rem;        /* 48px */

  /* Line Heights */
  --leading-tight: 1.15;
  --leading-snug: 1.3;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

  /* Letter Spacing */
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.02em;
  --tracking-wider: 0.05em;

  /* === SPACING === */

  --space-px: 1px;
  --space-0: 0;
  --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 */

  /* === SHADOWS & ELEVATION === */

  --shadow-sm: 0 1px 2px rgba(30, 41, 59, 0.06), 0 1px 1px rgba(30, 41, 59, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(30, 41, 59, 0.1), 0 2px 4px -1px rgba(30, 41, 59, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(30, 41, 59, 0.12), 0 4px 6px -2px rgba(30, 41, 59, 0.08);
  --shadow-xl: 0 20px 25px -5px rgba(30, 41, 59, 0.14), 0 10px 10px -5px rgba(30, 41, 59, 0.06);
  --shadow-2xl: 0 25px 50px -12px rgba(30, 41, 59, 0.25);
  --shadow-inset: inset 0 2px 4px rgba(30, 41, 59, 0.06);
  --shadow-icon: 0 4px 8px rgba(30, 41, 59, 0.1), 0 2px 3px rgba(30, 41, 59, 0.08);

  /* Colored Shadows for Emphasis */
  --shadow-primary: 0 8px 16px -4px rgba(37, 99, 235, 0.2);
  --shadow-secondary: 0 8px 16px -4px rgba(249, 115, 22, 0.2);
  --shadow-accent: 0 8px 16px -4px rgba(6, 182, 212, 0.2);

  /* === BORDER RADIUS === */

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
  --radius-icon: 22.37%; /* iOS-style icon radius */

  /* === BREAKPOINTS === */

  --bp-sm: 640px;
  --bp-md: 768px;
  --bp-lg: 1024px;
  --bp-xl: 1280px;
  --bp-2xl: 1536px;

  /* === GLASS MORPHISM === */

  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
}

/* ========================================================================
   TYPOGRAPHY UTILITIES
   ======================================================================== */

.text-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

.text-section {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
}

.text-app-name {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: var(--leading-snug);
}

.text-body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--leading-normal);
}

.text-caption {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 400;
  line-height: var(--leading-normal);
  color: var(--color-graphite);
}

.text-technical {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
}

/* ========================================================================
   LAYOUT
   ======================================================================== */

.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

@media (min-width: 768px) {
  .container {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}

@media (min-width: 1024px) {
  .container {
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }
}

/* ========================================================================
   COMPONENTS
   ======================================================================== */

/* --- App Icon --- */

.app-icon {
  aspect-ratio: 1;
  border-radius: var(--radius-icon);
  box-shadow: var(--shadow-icon);
  background: linear-gradient(135deg, var(--color-surface-elevated) 0%, var(--color-border) 100%);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.app-icon:hover {
  box-shadow: var(--shadow-lg);
  transform: scale(1.05);
}

.app-icon--xs { width: 40px; height: 40px; }
.app-icon--sm { width: 56px; height: 56px; }
.app-icon--md { width: 80px; height: 80px; }
.app-icon--lg { width: 128px; height: 128px; }

.app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.app-icon:hover img {
  transform: scale(1.05);
}

/* --- Star Rating --- */

.star-rating {
  position: relative;
  display: inline-flex;
  font-size: 14px;
  line-height: 1;
}

.stars {
  display: flex;
  gap: 1px;
  position: relative;
}

.stars-empty {
  color: var(--color-star-empty);
}

.stars-filled {
  position: absolute;
  inset: 0;
  color: var(--color-star-filled);
  overflow: hidden;
}

.star {
  display: inline-block;
}

.rating-text {
  margin-left: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-graphite);
}

.rating-count {
  margin-left: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-graphite);
}

/* --- Price Badge --- */

.price-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  box-shadow: var(--shadow-sm);
}

.price-badge.price-free {
  background: transparent;
  border: 2px solid var(--color-success);
  color: var(--color-success-dark);
}

.price-badge.price-paid {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.25);
}

.price-badge:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.price-badge:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* --- App Card --- */
.app-card {
  display: grid;
  grid-template-columns: 1fr 130px;
  grid-template-rows: auto auto;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 2px solid var(--color-border);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-lg), var(--shadow-primary);
}

/* Header row: Icon + Info */
.app-card__header {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}

.app-card__icon {
  flex-shrink: 0;
}

.app-card__icon img {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-icon);
  box-shadow: var(--shadow-icon);
}

.app-card__info {
  flex: 1;
  min-width: 0;
}

.app-card__title {
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: var(--leading-snug);
  margin-bottom: var(--space-1);
}

.app-card__title a {
  color: var(--color-ink);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.app-card__tagline {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  font-style: italic;
  line-height: var(--leading-snug);
  margin-bottom: var(--space-1);
}

.app-card__seller {
  font-size: var(--text-sm);
  color: var(--color-graphite);
  margin-bottom: var(--space-2);
}

.app-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Preview row: Screenshot + Description */
.app-card__preview {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}

.app-card__screenshot {
  flex-shrink: 0;
  width: 120px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-elevated);
}

.app-card__screenshot img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 200px;
  object-fit: cover;
  object-position: top;
}

.app-card__body {
  flex: 1;
  min-width: 0;
}

.app-card__description {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-graphite);
  margin-bottom: var(--space-3);
}

/* Search term highlighting in description snippets */
.app-card__description mark {
  background-color: var(--color-highlight);
  color: inherit;
  padding: 0.1em 0.2em;
  border-radius: 2px;
}

.app-card__read-more {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

.app-card__read-more:hover {
  text-decoration: underline;
}

.app-card__see-also {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.app-card__see-also a {
  color: var(--color-primary);
  text-decoration: none;
}

.app-card__see-also a:hover {
  text-decoration: underline;
}

/* Actions column - spans both rows */
.app-card__actions {
  grid-column: 2;
  grid-row: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-3);
}

.app-card__store-link {
  display: block;
  transition: transform 0.2s ease;
}

.app-card__store-link:hover {
  transform: scale(1.05);
}

.app-card__category {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  background: var(--color-primary-pale);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  margin-top: auto;
}

.app-store-badge {
  height: 40px;
  width: auto;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .app-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .app-card__header {
    gap: var(--space-3);
  }

  .app-card__icon img {
    width: 80px;
    height: 80px;
  }

  .app-card__screenshot {
    width: 100px;
  }

  .app-card__screenshot img {
    max-height: 160px;
  }

  .app-card__actions {
    grid-column: 1;
    grid-row: 3;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border);
  }

  .app-card__category {
    margin-top: 0;
    margin-left: auto;
  }
}

/* --- App Card Compact --- */

.app-card-compact {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3);
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-linen);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease;
}

.app-card-compact:hover {
  border-color: var(--color-stone);
}

.app-card-compact__icon {
  flex-shrink: 0;
}

.app-card-compact__content {
  flex: 1;
  min-width: 0;
}

.app-card-compact__title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: var(--space-1);
}

.app-card-compact__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-graphite);
}

/* --- Search Box --- */

.search-box {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.search-box form {
  position: relative;
}

.search-box__wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box__icon {
  position: absolute;
  left: var(--space-5);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
  z-index: 1;
  width: 20px;
  height: 20px;
}

.search-box__input {
  width: 100%;
  padding: var(--space-5) var(--space-12) var(--space-5) var(--space-12);
  font-size: var(--text-lg);
  font-weight: 500;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-2xl);
  background: var(--color-surface);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--color-ink);
}

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

.search-box__input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-lg), 0 0 0 4px var(--color-primary-pale);
  transform: translateY(-2px);
}

.search-box__input:focus + .search-box__icon {
  color: var(--color-primary);
}

.search-box__button {
  position: absolute;
  right: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  padding: var(--space-3) var(--space-6);
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-light) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-xl);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-md);
}

.search-box__button:hover {
  background: linear-gradient(135deg, var(--color-secondary-dark) 0%, var(--color-secondary) 100%);
  box-shadow: var(--shadow-lg), var(--shadow-secondary);
  transform: translateY(-50%) scale(1.05);
}

/* --- Autocomplete Dropdown --- */

.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: none;
  max-height: 400px;
  overflow-y: auto;
}

.autocomplete-list--visible {
  display: block;
}

.autocomplete-item {
  display: block;
  padding: var(--space-4) var(--space-5);
  color: var(--color-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.15s ease;
  cursor: pointer;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item--active {
  background: var(--color-primary-pale);
  color: var(--color-primary);
}

/* --- Filter Panel --- */

.filter-panel {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 2px solid var(--color-border);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.filter-panel h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-5);
  color: var(--color-ink);
  letter-spacing: -0.01em;
}

.filter-group {
  margin-bottom: var(--space-5);
}

.filter-group label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-group select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-ink);
  transition: all 0.2s ease;
  cursor: pointer;
}

.filter-group select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-pale);
}

.filter-apply {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-md);
}

.filter-apply:hover {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  box-shadow: var(--shadow-lg), var(--shadow-primary);
  transform: translateY(-2px);
}

.filter-apply:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* --- Pagination --- */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-12);
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pagination a {
  color: var(--color-primary);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
}

.pagination a:hover {
  background: var(--color-primary-pale);
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.pagination span {
  color: white;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  border: 2px solid transparent;
  box-shadow: var(--shadow-md), var(--shadow-primary);
}


/* --- Buttons --- */

.btn,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn:hover,
.button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn:active,
.button:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn--primary,
.button-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: white;
}

.btn--primary:hover,
.button-primary:hover {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  box-shadow: var(--shadow-lg), var(--shadow-primary);
}

.btn--secondary,
.button-secondary {
  background: var(--color-surface);
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn--secondary:hover,
.button-secondary:hover {
  background: var(--color-primary-pale);
  border-color: var(--color-primary-dark);
  color: var(--color-primary-dark);
}

.btn--ghost {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

.btn--ghost:hover {
  background: var(--color-primary-pale);
}

/* Button Sizes */
.btn--sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  border-radius: var(--radius-lg);
}

.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
}

/* --- Tag Component --- */

.tag {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-md);
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tag--genre {
  background: var(--color-primary-pale);
  color: var(--color-primary);
}

.tag--info {
  background: var(--color-accent-pale);
  color: var(--color-accent-dark);
}

/* ========================================================================
   PAGE LAYOUTS
   ======================================================================== */

/* --- Header --- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--color-border);
  padding: var(--space-5) 0;
  margin-bottom: var(--space-8);
  box-shadow: var(--shadow-sm);
}

.site-header__content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-logo {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: transform 0.2s ease;
}

.site-logo:hover {
  transform: scale(1.05);
}

.site-nav {
  display: flex;
  gap: var(--space-6);
}

.site-nav a {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
}

.site-nav a:hover {
  color: var(--color-primary);
  background: var(--color-primary-pale);
}

/* --- Footer --- */

.site-footer {
  background: linear-gradient(135deg, var(--color-ink) 0%, var(--color-text-secondary) 100%);
  color: white;
  border-top: 3px solid var(--color-primary);
  padding: var(--space-12) 0 var(--space-6) 0;
  margin-top: var(--space-20);
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 50%, var(--color-secondary) 100%);
}

.site-footer__content {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  justify-content: space-between;
  margin-bottom: var(--space-8);
}

.site-footer__nav {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.site-footer__nav a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--text-sm);
  transition: all 0.2s ease;
  padding: var(--space-1) 0;
  border-bottom: 2px solid transparent;
}

.site-footer__nav a:hover {
  color: white;
  border-bottom-color: var(--color-accent);
}

.site-footer__section h4 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-4);
  color: white;
}

.site-footer__section ul {
  list-style: none;
}

.site-footer__section li {
  margin-bottom: var(--space-2);
}

.site-footer__section a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: var(--text-sm);
}

.site-footer__section a:hover {
  color: white;
  padding-left: var(--space-1);
}

.site-footer__copyright {
  text-align: center;
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.site-footer__apps-like {
  margin-bottom: var(--space-10);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.site-footer__apps-like h4 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-5);
  color: white;
  text-align: center;
}

.apps-like-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
}

.apps-like-links a {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
}

.apps-like-links a:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.site-footer__affiliate {
  text-align: center;
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.6);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.site-footer__attribution {
  text-align: center;
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.5);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
}

/* --- Search Page --- */

.search-page {
  padding: var(--space-6) 0;
}

.search-page__header {
  margin-bottom: var(--space-8);
}

.search-page__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 1024px) {
  .search-page__layout {
    grid-template-columns: 280px 1fr;
  }
}

.search-page__sidebar {
  position: sticky;
  top: var(--space-4);
  align-self: start;
}

.search-page__title {
  font-size: var(--text-3xl);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.search-page__count {
  font-size: var(--text-base);
  color: var(--color-graphite);
}

.search-page__controls {
  margin-bottom: var(--space-6);
}

.search-page__empty {
  text-align: center;
  padding: var(--space-16) var(--space-4);
  color: var(--color-graphite);
}

.app-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* --- Search Hero --- */

.search-hero {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 50%, var(--color-accent) 100%);
  padding: var(--space-12) 0 var(--space-10) 0;
  margin: calc(var(--space-8) * -1) 0 var(--space-12) 0;
  color: white;
  position: relative;
  overflow: visible;
}

.search-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(6, 182, 212, 0.2) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(249, 115, 22, 0.15) 0%, transparent 50%);
  pointer-events: none;
}

.search-hero__header {
  text-align: center;
  margin-bottom: var(--space-6);
  position: relative;
  z-index: 1;
}

.search-hero__title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 800;
  text-align: center;
  margin-bottom: var(--space-4);
  line-height: var(--leading-tight);
  letter-spacing: -0.03em;
  position: relative;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-hero__count-badge {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-full);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: fadeInUp 0.6s ease-out 0.2s backwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-hero__count-number {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.search-hero__count-label {
  font-size: var(--text-sm);
  font-weight: 500;
  opacity: 0.95;
  letter-spacing: 0.01em;
}

@media (max-width: 768px) {
  .search-hero {
    padding: var(--space-10) 0 var(--space-8) 0;
  }

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

  .search-hero__count-badge {
    flex-direction: column;
    gap: 0;
    padding: var(--space-2) var(--space-4);
  }

  .search-hero__count-number {
    font-size: var(--text-lg);
  }

  .search-hero__count-label {
    font-size: var(--text-xs);
  }
}

/* --- Detail Page - Glass Editorial --- */

.detail-page {
  min-height: 100vh;
}

/* Hero Header */
.detail-hero {
  background: linear-gradient(135deg,
    var(--color-primary-pale) 0%,
    var(--color-accent-pale) 50%,
    var(--color-secondary-pale) 100%);
  padding: var(--space-10) 0;
  margin: 0 0 var(--space-8) 0;
  position: relative;
  overflow: hidden;
}

.detail-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(37, 99, 235, 0.08) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.06) 0%, transparent 50%);
  pointer-events: none;
}

.detail-hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  gap: var(--space-6);
  align-items: flex-start;
}

.detail-hero__icon {
  flex-shrink: 0;
}

.detail-hero__icon img {
  width: 128px;
  height: 128px;
  border-radius: var(--radius-icon);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.detail-hero__icon img:hover {
  transform: scale(1.05);
}

.detail-hero__info {
  flex: 1;
  min-width: 0;
}

.detail-hero__title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-ink);
  margin-bottom: var(--space-2);
}

.detail-hero__tagline {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  font-weight: 500;
  font-style: italic;
  margin-bottom: var(--space-3);
  line-height: var(--leading-snug);
}

.detail-hero__seller {
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.detail-hero__meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.detail-hero__rating-count {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-left: var(--space-1);
}

.detail-hero__tags {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.detail-hero__actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Main Layout */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  margin-top: var(--space-8);
}

@media (min-width: 1024px) {
  .detail-layout {
    grid-template-columns: 1fr 320px;
  }
}

.detail-main {
  min-width: 0;
}

/* Screenshots Section */
.detail-screenshots {
  margin-bottom: var(--space-10);
}

.detail-screenshots__heading {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: var(--space-5);
  letter-spacing: var(--tracking-tight);
}

.detail-screenshots__carousel {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
  padding-bottom: var(--space-3);
}

.detail-screenshots__carousel::-webkit-scrollbar {
  height: 8px;
}

.detail-screenshots__carousel::-webkit-scrollbar-track {
  background: transparent;
}

.detail-screenshots__carousel::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}

.detail-screenshots__carousel::-webkit-scrollbar-thumb:hover {
  background: var(--color-border-strong);
}

.detail-screenshots__item {
  flex-shrink: 0;
  scroll-snap-align: start;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.detail-screenshots__item img {
  display: block;
  height: 480px;
  width: auto;
  max-width: none;
}

.detail-screenshots__item:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-xl);
  z-index: 1;
}

/* Description Section */
.detail-section {
  margin-bottom: var(--space-8);
}

.detail-section h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: var(--space-4);
  letter-spacing: var(--tracking-tight);
}

.detail-description__summary {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-ink);
  margin-bottom: var(--space-4);
  font-weight: 500;
}

.detail-description__text {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
  white-space: pre-wrap;
}

/* Sidebar */
.detail-sidebar {
  position: sticky;
  top: var(--space-20);
  align-self: start;
}

.detail-sidebar__card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--glass-shadow);
}

.detail-sidebar__card h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: var(--space-5);
  letter-spacing: var(--tracking-tight);
}

.detail-sidebar__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--space-3) 0;
  border-bottom: 1px solid rgba(203, 213, 225, 0.3);
  gap: var(--space-4);
}

.detail-sidebar__row:last-child {
  border-bottom: none;
}

.detail-sidebar__label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.detail-sidebar__value {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-ink);
  text-align: right;
}

/* Responsive Mobile Styles */
@media (max-width: 640px) {
  .detail-hero {
    padding: var(--space-6) 0;
  }

  .detail-hero__inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .detail-hero__icon img {
    width: 96px;
    height: 96px;
  }

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

  .detail-hero__actions {
    flex-direction: column;
    width: 100%;
  }

  .detail-hero__actions .button {
    width: 100%;
  }

  .detail-screenshots__item img {
    height: 360px;
  }

  .detail-sidebar {
    position: static;
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .detail-hero__icon img {
    width: 112px;
    height: 112px;
  }

  .detail-screenshots__item img {
    height: 420px;
  }
}

/* ========================================================================
   ALTERNATIVES PAGE - Editorial Showcase Design
   ======================================================================== */

/* Page Container */
.alt-page {
  min-height: 100vh;
}

/* --- Hero Section --- */
.alt-hero {
  position: relative;
  padding: var(--space-8) 0 var(--space-10);
  background: linear-gradient(135deg, var(--color-primary-pale) 0%, var(--color-surface) 50%, var(--color-accent-pale) 100%);
  overflow: hidden;
}

.alt-hero__bg {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(37, 99, 235, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.alt-hero__bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='1' cy='1' r='1' fill='%232563EB' fill-opacity='0.07'/%3E%3C/svg%3E");
  background-size: 20px 20px;
}

.alt-hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.alt-hero__eyebrow {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}

.alt-hero__featured {
  display: flex;
  align-items: flex-start;
  gap: var(--space-6);
  padding: var(--space-6);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-2xl);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 10px 15px -3px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(37, 99, 235, 0.05);
  max-width: 720px;
}

.alt-hero__icon {
  flex-shrink: 0;
}

.alt-hero__icon img {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.alt-hero__info {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.alt-hero__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-ink);
  margin-bottom: var(--space-1);
  line-height: var(--leading-tight);
}

.alt-hero__tagline {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  font-style: italic;
  line-height: var(--leading-snug);
  margin-bottom: var(--space-1);
}

.alt-hero__seller {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.alt-hero__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.alt-hero__divider {
  color: var(--color-border-strong);
}

.alt-hero__ratings {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.alt-hero__actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* --- Main Section --- */
.alt-main {
  padding: var(--space-12) 0;
  background: var(--color-bg);
}

.alt-intro {
  text-align: center;
  margin-bottom: var(--space-6);
}

.alt-intro__title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-ink);
  margin-bottom: var(--space-2);
}

.alt-intro__desc {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 480px;
  margin: 0 auto;
}

/* --- Podium Section (Top 3) --- */
.alt-podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-4);
}

.alt-podium__card {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  border: 2px solid var(--color-border);
  padding: var(--space-6);
  text-align: center;
  transition: all 0.25s ease;
}

.alt-podium__card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* #1 - Gold treatment */
.alt-podium__card--1 {
  border-color: var(--color-gold);
  background: linear-gradient(180deg, var(--color-gold-pale) 0%, var(--color-surface) 100%);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15);
}

.alt-podium__card--1:hover {
  border-color: var(--color-gold-dark);
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.25);
}

/* #2 - Silver treatment */
.alt-podium__card--2 {
  border-color: var(--color-border-strong);
  background: linear-gradient(180deg, var(--color-silver-pale) 0%, var(--color-surface) 100%);
}

/* #3 - Bronze treatment */
.alt-podium__card--3 {
  border-color: var(--color-bronze);
  background: linear-gradient(180deg, var(--color-bronze-pale) 0%, var(--color-surface) 100%);
  opacity: 0.95;
}

.alt-podium__rank {
  position: absolute;
  top: calc(-1 * var(--space-3));
  left: 50%;
  transform: translateX(-50%);
  width: var(--space-8);
  height: var(--space-8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-sm);
  color: white;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
}

.alt-podium__rank--1 {
  background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-dark) 100%);
  width: var(--space-10);
  height: var(--space-10);
  font-size: var(--text-lg);
}

.alt-podium__rank--2 {
  background: linear-gradient(135deg, var(--color-silver) 0%, var(--color-silver-dark) 100%);
}

.alt-podium__rank--3 {
  background: linear-gradient(135deg, var(--color-bronze) 0%, var(--color-bronze-dark) 100%);
}

.alt-podium__link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.alt-podium__icon {
  margin: var(--space-4) auto var(--space-4);
}

.alt-podium__icon img {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  margin: 0 auto;
}

.alt-podium__card--1 .alt-podium__icon img {
  width: 96px;
  height: 96px;
}

.alt-podium__name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: var(--space-1);
  line-height: var(--leading-snug);
}

.alt-podium__tagline {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  font-style: italic;
  line-height: var(--leading-snug);
  margin-bottom: var(--space-1);
}

.alt-podium__seller {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.alt-podium__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}

.alt-podium__category {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.alt-podium__description {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-3);
  min-height: 3em;
}

.alt-podium__price-wrapper {
  display: flex;
  justify-content: center;
}

/* --- List Section (4+) --- */
.alt-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.alt-list__item {
  /* Reset ol styling */
}

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

.alt-card {
  display: flex;
  align-items: stretch;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
}

.alt-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.alt-card__rank {
  flex-shrink: 0;
  width: var(--space-12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--color-text-muted);
}

.alt-card__link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4);
  padding-left: 0;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.alt-card__primary {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex: 1;
  min-width: 0;
}

.alt-card__icon {
  flex-shrink: 0;
}

.alt-card__icon img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.alt-card__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.alt-card__name {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: var(--leading-tight);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.alt-card__tagline {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  font-style: italic;
  line-height: var(--leading-snug);
  margin-top: var(--space-1);
}

.alt-card__seller {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.alt-card__rating {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.alt-card__votes {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.alt-card__category-chip {
  display: inline-block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background: var(--color-surface);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  line-height: var(--leading-snug);
}

.alt-card__description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.alt-card__action {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding-right: var(--space-4);
}


/* --- Ad Container --- */
.alt-ad {
  margin: var(--space-4) 0;
  padding: var(--space-4);
  background: var(--color-surface-elevated);
  border-radius: var(--radius-lg);
}

/* --- Footer Section --- */
.alt-footer {
  padding: var(--space-12) 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.alt-footer__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: var(--space-3);
}

.alt-footer__desc {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: var(--leading-relaxed);
}

/* --- Empty State --- */
.alt-empty {
  text-align: center;
  padding: var(--space-12);
  color: var(--color-text-muted);
}

.alt-empty a {
  color: var(--color-primary);
  text-decoration: underline;
}

/* --- Indexing Notice --- */
.alt-indexing-notice {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
}

.alt-indexing-notice__title {
  color: #0369a1;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.alt-indexing-notice__desc {
  color: #475569;
  font-size: 0.875rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .alt-hero {
    padding: var(--space-8) 0 var(--space-10);
  }

  .alt-hero__featured {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-5);
  }

  .alt-hero__icon img {
    width: 80px;
    height: 80px;
  }

  .alt-hero__actions {
    justify-content: center;
  }

  .alt-podium {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .alt-podium__card--1 {
    order: -1;
  }

  .alt-card__link {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-4);
  }

  .alt-card__primary {
    flex-direction: column;
    align-items: center;
  }

  .alt-card__icon img {
    width: 48px;
    height: 48px;
  }

  .alt-card__info {
    align-items: center;
  }

  .alt-card__rating {
    justify-content: center;
    flex-wrap: wrap;
  }

  .alt-card__action {
    padding-right: 0;
    width: 100%;
    justify-content: center;
  }

  .alt-card__action .price-badge {
    width: 100%;
  }

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

/* Star rating size variants */
.star-rating--sm {
  font-size: var(--text-xs);
}

.star-rating--sm .stars {
  font-size: var(--text-sm);
}

.star-rating--lg {
  font-size: var(--text-lg);
}

.star-rating--lg .stars {
  font-size: var(--text-xl);
}

.star-rating--lg .rating-text {
  font-size: var(--text-lg);
}

/* ========================================================================
   ACCESSIBILITY
   ======================================================================== */

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: 100;
  padding: var(--space-3) var(--space-6);
  background: var(--color-alpine-teal);
  color: white;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.skip-link:focus {
  top: var(--space-4);
}

/* Focus Styles */
:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-primary-pale);
}

/* 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;
  }
}

/* --- Legal Page --- */

.legal-page {
  padding: var(--space-8) 0;
  background-color: var(--color-bg);
}

.legal-page h1 {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 800;
  color: var(--color-ink);
  margin-bottom: var(--space-8);
  text-align: center;
}

.legal-section {
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-border);
}

.legal-section:last-child {
  border-bottom: none;
}

.legal-section h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-ink);
  margin-bottom: var(--space-4);
}

.legal-section p {
  margin-bottom: var(--space-4);
  line-height: 1.7;
  color: var(--color-text-secondary);
}

.legal-section ul {
  margin-left: var(--space-6);
  margin-bottom: var(--space-4);
  color: var(--color-text-secondary);
}

.legal-section li {
  margin-bottom: var(--space-2);
  line-height: 1.7;
}

.legal-section a {
  color: var(--color-primary);
  text-decoration: underline;
  transition: color 0.2s ease;
}

.legal-section a:hover {
  color: var(--color-accent);
}

.dmca-contact {
  background-color: var(--color-bg-secondary);
  border-left: 4px solid var(--color-primary);
  padding: var(--space-4);
  margin: var(--space-4) 0;
  border-radius: 4px;
}

.dmca-contact strong {
  color: var(--color-ink);
}

/* --- Browse Page --- */

.browse-page {
  padding: var(--space-8) 0;
  background-color: var(--color-bg);
}

.browse-page h1 {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 800;
  color: var(--color-ink);
  margin-bottom: var(--space-8);
  text-align: center;
}

.browse-section {
  margin-bottom: var(--space-10);
}

.browse-section h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-ink);
  margin-bottom: var(--space-5);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
}

.category-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-5);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md), var(--shadow-primary);
  transform: translateY(-2px);
}

.category-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: var(--space-2);
}

.category-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.filter-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.filter-link {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all 0.2s ease;
}

.filter-link:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-pale);
}

.browse-ad {
  margin: var(--space-6) 0;
  padding: var(--space-4);
  background: var(--color-surface-elevated);
  border-radius: var(--radius-lg);
}

/* --- Error Page --- */

.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) 0;
  text-align: center;
}

.error-page h1 {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 800;
  color: var(--color-ink);
  margin-bottom: var(--space-6);
}

.error-message {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.error-actions {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Attribution Notices --- */

.detail-attribution,
.alt-attribution {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}

.detail-attribution p,
.alt-attribution p {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  margin: 0;
}

/* --- Breadcrumb Navigation --- */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  list-style: none;
  padding: var(--space-4) 0 var(--space-6);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  animation: breadcrumbSlideIn 0.4s ease-out;
}

@keyframes breadcrumbSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.breadcrumb li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.breadcrumb li:not(:last-child)::after {
  content: '›';
  color: var(--color-border-strong);
  font-size: var(--text-lg);
  font-weight: 300;
  display: inline-block;
  user-select: none;
  opacity: 0.6;
}

.breadcrumb a {
  color: var(--color-text-muted);
  text-decoration: none;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.breadcrumb a:hover {
  color: var(--color-primary);
  background: var(--color-primary-pale);
}

.breadcrumb a:active {
  transform: scale(0.97);
}

.breadcrumb li:last-child span {
  color: var(--color-ink);
  font-weight: 600;
  padding: var(--space-1) var(--space-2);
}

/* Mobile responsive */
@media (max-width: 640px) {
  .breadcrumb {
    font-size: var(--text-xs);
    padding: var(--space-3) 0 var(--space-4);
    gap: var(--space-1);
  }

  .breadcrumb li:not(:last-child)::after {
    font-size: var(--text-base);
  }

  .breadcrumb a,
  .breadcrumb li:last-child span {
    padding: var(--space-1);
  }
}

/* ========================================================================
   UTILITIES
   ======================================================================== */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* --- Related Categories Section (Alternatives Page) --- */

.alt-related {
  padding: var(--space-10) 0;
  background: var(--color-surface-elevated);
  border-top: 1px solid var(--color-border);
}

.alt-related__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-ink);
  text-align: center;
  margin-bottom: var(--space-6);
}

.alt-related__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
}

.alt-related__link {
  display: inline-flex;
  align-items: center;
  padding: var(--space-3) var(--space-5);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.alt-related__link:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-pale);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 640px) {
  .alt-related__links {
    flex-direction: column;
    align-items: stretch;
  }

  .alt-related__link {
    justify-content: center;
  }
}

/* ========================================================================
   ABOUT & SEARCH TIPS PAGES - Editorial Documentation Style
   ======================================================================== */

/* Shared Page Styles */
.about-page,
.search-tips-page {
  padding-bottom: var(--space-16);
}

.about-page .container,
.search-tips-page .container {
  max-width: 900px;
}

/* Page Title - Editorial Headline */
.about-page h1,
.search-tips-page h1 {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  font-weight: 800;
  color: var(--color-ink);
  text-align: center;
  margin-bottom: var(--space-4);
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--color-ink) 0%, var(--color-primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fadeInUp 0.6s ease-out;
}

/* Section Cards */
.about-section,
.tips-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  margin-bottom: var(--space-6);
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: slideUp 0.5s ease-out backwards;
}

.about-section:nth-child(1) { animation-delay: 0.1s; }
.about-section:nth-child(2) { animation-delay: 0.15s; }
.about-section:nth-child(3) { animation-delay: 0.2s; }
.about-section:nth-child(4) { animation-delay: 0.25s; }
.tips-section:nth-child(1) { animation-delay: 0.1s; }
.tips-section:nth-child(2) { animation-delay: 0.15s; }
.tips-section:nth-child(3) { animation-delay: 0.2s; }
.tips-section:nth-child(4) { animation-delay: 0.25s; }
.tips-section:nth-child(5) { animation-delay: 0.3s; }
.tips-section:nth-child(6) { animation-delay: 0.35s; }
.tips-section:nth-child(7) { animation-delay: 0.4s; }

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.about-section:hover,
.tips-section:hover {
  border-color: var(--color-primary-pale);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--color-primary-pale);
}

/* Section Headings */
.about-section h2,
.tips-section h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-ink);
  margin-bottom: var(--space-4);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.about-section h2::before,
.tips-section h2::before {
  content: '';
  width: 4px;
  height: 1.2em;
  background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-accent) 100%);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.tips-section h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: var(--space-3);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.tips-section h3::before {
  content: '';
  width: 3px;
  height: 1em;
  background: linear-gradient(180deg, var(--color-secondary) 0%, var(--color-secondary-light) 100%);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* Paragraph Text */
.about-section p,
.tips-section p {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.about-section p:last-child,
.tips-section p:last-child {
  margin-bottom: 0;
}

/* Links in Content */
.about-section a,
.tips-section a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid var(--color-primary-pale);
  transition: all 0.2s ease;
}

.about-section a:hover,
.tips-section a:hover {
  color: var(--color-primary-dark);
  border-bottom-color: var(--color-primary);
}

/* Feature Lists - Card Grid Style */
.about-section ul,
.tips-section ul {
  list-style: none;
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.about-section li,
.tips-section li {
  background: linear-gradient(135deg, var(--color-surface-elevated) 0%, var(--color-bg) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.about-section li::before,
.tips-section li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-accent) 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.about-section li:hover,
.tips-section li:hover {
  border-color: var(--color-primary-pale);
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.about-section li:hover::before,
.tips-section li:hover::before {
  opacity: 1;
}

.about-section li strong,
.tips-section li strong {
  color: var(--color-ink);
  font-weight: 700;
  display: block;
  margin-bottom: var(--space-1);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Search Tips - Example Boxes */
.tips-section .example {
  background: linear-gradient(135deg, var(--color-accent-pale) 0%, rgba(6, 182, 212, 0.05) 100%);
  border: 1px solid var(--color-accent);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  margin-top: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
}

.tips-section .example strong {
  color: var(--color-accent-dark);
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
}

/* Two-Column Layout for Technology Section */
@media (min-width: 768px) {
  .about-section ul,
  .tips-section ul {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Single column for very long filter lists */
  .tips-section ul:has(li:nth-child(7)) {
    grid-template-columns: 1fr;
  }
}

/* Mobile Responsive */
@media (max-width: 767px) {
  .about-page h1,
  .search-tips-page h1 {
    font-size: var(--text-3xl);
  }

  .about-section,
  .tips-section {
    padding: var(--space-5);
    margin-bottom: var(--space-4);
  }

  .about-section h2,
  .tips-section h2 {
    font-size: var(--text-xl);
  }

  .tips-section h3 {
    font-size: var(--text-lg);
  }

  .about-section li,
  .tips-section li {
    padding: var(--space-3) var(--space-4);
  }
}

/* ========================================================================
   COMPACT CHARTS (Horizontal Carousel with Genre Tabs)
   ======================================================================== */

.charts-compact {
  padding: var(--space-6) 0;
  background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-surface) 100%);
  border-bottom: 1px solid var(--color-border);
}

.charts-compact__header {
  margin-bottom: var(--space-4);
}

.charts-compact__header h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-ink);
  margin: 0;
}

/* Hidden radio inputs */
.charts-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Genre tab navigation - horizontal scrolling */
.charts-tabs {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-4);
}

.charts-tabs::-webkit-scrollbar {
  display: none;
}

/* Genre tab (label) */
.charts-tab {
  flex-shrink: 0;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.charts-tab:hover {
  color: var(--color-ink);
  border-color: var(--color-primary-light);
}

/* Panels container */
.charts-panels {
  position: relative;
}

/* Genre panel - hidden by default */
.charts-panel {
  display: none;
}

/* Row container (Free/Paid) */
.charts-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  position: relative;
}

.charts-row__label {
  flex-shrink: 0;
  width: 40px;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.charts-row__label--free {
  color: var(--color-success);
}

.charts-row__label--paid {
  color: var(--color-primary);
}

/* Horizontal scroll carousel */
.charts-carousel {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-2) 0;
  /* Fade edges for scroll indication */
  mask-image: linear-gradient(to right, transparent, black 20px, black calc(100% - 20px), transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 20px, black calc(100% - 20px), transparent);
}

.charts-carousel::-webkit-scrollbar {
  display: none;
}

/* Compact app chip */
.charts-chip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  scroll-snap-align: start;
  transition: all 0.15s ease;
  min-width: 160px;
  max-width: 200px;
}

.charts-chip:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-sm);
}

.charts-chip__rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.charts-chip__rank--gold {
  background: linear-gradient(135deg, var(--color-gold-light) 0%, var(--color-gold) 100%);
  color: var(--color-gold-dark);
  border-radius: var(--radius-full);
}

.charts-chip__rank--silver {
  background: linear-gradient(135deg, var(--color-silver-pale) 0%, var(--color-silver) 100%);
  color: var(--color-silver-dark);
  border-radius: var(--radius-full);
}

.charts-chip__rank--bronze {
  background: linear-gradient(135deg, var(--color-bronze-pale) 0%, var(--color-bronze) 100%);
  color: var(--color-bronze-dark);
  border-radius: var(--radius-full);
}

.charts-chip__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-icon);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.charts-chip__name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

/* View all link */
.charts-view-all {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
  margin-top: var(--space-2);
  transition: color 0.15s ease;
}

.charts-view-all:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* Responsive: Adjust for mobile */
@media (max-width: 767px) {
  .charts-compact {
    padding: var(--space-4) 0;
  }

  .charts-tabs {
    gap: var(--space-1);
  }

  .charts-tab {
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
  }

  .charts-chip {
    min-width: 140px;
    max-width: 170px;
    padding: var(--space-2);
  }

  .charts-chip__icon {
    width: 32px;
    height: 32px;
  }

  .charts-chip__name {
    font-size: var(--text-xs);
  }

  .charts-row__label {
    width: 32px;
    font-size: 10px;
  }
}

/* ========================================================================
   MOBILE RESPONSIVE ENHANCEMENTS
   ======================================================================== */

/* --- Mobile Filter Panel (Full-screen Overlay) --- */

/* Filter toggle button - hidden on desktop */
.filter-toggle {
  display: none;
}

@media (max-width: 1023px) {
  /* Hide sidebar by default on mobile/tablet */
  .search-page__sidebar {
    display: none;
  }

  /* Filter toggle button */
  .filter-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--color-ink);
    cursor: pointer;
    margin-bottom: var(--space-4);
    transition: all 0.2s ease;
  }

  .filter-toggle:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
  }

  .filter-toggle__icon {
    width: 18px;
    height: 18px;
    color: var(--color-text-muted);
  }

  .filter-toggle:hover .filter-toggle__icon {
    color: var(--color-primary);
  }

  /* When filter panel is visible */
  .search-page__sidebar.filter-panel--visible {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 200;
    overflow-y: auto;
    background: var(--color-surface);
    padding: var(--space-4);
    padding-top: var(--space-16);
  }

  .search-page__sidebar.filter-panel--visible .filter-panel {
    border: none;
    box-shadow: none;
    max-width: 400px;
    margin: 0 auto;
  }

  /* Close button for filter panel */
  .filter-panel__close {
    position: fixed;
    top: var(--space-4);
    right: var(--space-4);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: var(--text-xl);
    color: var(--color-ink);
    cursor: pointer;
    z-index: 201;
    transition: all 0.2s ease;
  }

  .filter-panel__close:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
  }

  /* Body scroll lock when filter panel is open */
  body.filter-open {
    overflow: hidden;
  }
}

/* Close button hidden on desktop */
@media (min-width: 1024px) {
  .filter-panel__close {
    display: none;
  }
}

/* --- Header Narrow Screen Styles --- */

@media (max-width: 480px) {
  .site-header {
    padding: var(--space-3) 0;
  }

  .site-logo {
    font-size: var(--text-lg);
  }

  .site-nav {
    gap: var(--space-2);
  }

  .site-nav a {
    font-size: 10px;
    padding: var(--space-1) var(--space-2);
    letter-spacing: 0.03em;
  }
}

/* --- Browse Page Mobile Styles --- */

@media (max-width: 480px) {
  .browse-page {
    padding: var(--space-6) 0;
  }

  .browse-page h1 {
    font-size: var(--text-2xl);
  }

  .category-grid {
    grid-template-columns: 1fr;
  }
}

/* --- App Card Screenshot - Very Narrow Screens --- */

@media (max-width: 480px) {
  .app-card__screenshot {
    display: none;
  }

  .app-card__preview {
    display: block;
  }
}

