/* ============================================================
   AutoSpyders.com - Main Stylesheet
   Premium Glassmorphism + Dark Automotive UI
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Variables ── */
:root {
  --bg-primary: #0a0c10;
  --bg-secondary: #0f1218;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.15);

  --accent-primary: #e8431a;
  --accent-secondary: #ff6b35;
  --accent-glow: rgba(232, 67, 26, 0.3);
  --accent-blue: #3b82f6;
  --accent-green: #22c55e;
  --accent-yellow: #f59e0b;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --text-accent: #e8431a;

  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 8px 40px rgba(232, 67, 26, 0.15);
  --shadow-glow: 0 0 40px rgba(232, 67, 26, 0.2);

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;

  --header-height: 70px;
  --sidebar-width: 280px;
}

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Animated background mesh */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(232, 67, 26, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-body);
  font-weight: 700;
  line-height: 1.2;
}

.display-title {
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Layout Wrapper ── */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  background: rgba(10, 12, 16, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.site-header.scrolled {
  background: rgba(10, 12, 16, 0.96);
  border-bottom-color: rgba(232, 67, 26, 0.2);
}

.header-inner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 20px var(--accent-glow);
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.05em;
  line-height: 1;
}

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

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.header-search {
  flex: 1;
  max-width: 320px;
  position: relative;
}

.header-search input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 40px;
  padding: 8px 16px 8px 36px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

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

.header-search input:focus {
  border-color: rgba(232, 67, 26, 0.4);
  background: rgba(255, 255, 255, 0.06);
}

.header-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

/* ── Hero Section (Homepage) ── */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(232, 67, 26, 0.1);
  border: 1px solid rgba(232, 67, 26, 0.25);
  border-radius: 40px;
  padding: 6px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-secondary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  margin-bottom: 20px;
}

.hero h1 .accent {
  color: var(--accent-primary);
  display: block;
  text-shadow: 0 0 60px rgba(232, 67, 26, 0.4);
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 48px;
  font-weight: 300;
}

/* ── Search Box (Homepage) ── */
.search-box {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 640px;
  margin: 0 auto;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.search-box:hover {
  border-color: rgba(232, 67, 26, 0.2);
  box-shadow: var(--shadow-hover);
}

.search-box-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 20px;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.select-wrapper {
  position: relative;
}

.select-wrapper select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 40px 12px 16px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.select-wrapper select:focus {
  border-color: rgba(232, 67, 26, 0.5);
  background: rgba(255, 255, 255, 0.07);
}

.select-wrapper select option {
  background: #1a1e28;
  color: var(--text-primary);
}

.select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  outline: none;
  letter-spacing: 0.03em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(232, 67, 26, 0.4);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: rgba(232, 67, 26, 0.06);
}

/* ── Stats Bar ── */
.stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 32px 0;
  flex-wrap: wrap;
}

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

.stat-number {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--accent-primary);
  letter-spacing: 0.02em;
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}

/* ── Brand Grid ── */
.section {
  padding: 60px 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
}

.section-title span {
  color: var(--accent-primary);
}

.section-link {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.section-link:hover {
  color: var(--accent-primary);
}

.brands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.brand-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.brand-card::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
  transform: scaleX(0);
  transition: var(--transition);
}

.brand-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(232, 67, 26, 0.25);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.brand-card:hover::before {
  transform: scaleX(1);
}

.brand-logo {
  font-size: 2rem;
  margin-bottom: 10px;
}

.brand-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.brand-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Problem Cards ── */
.page-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: 32px;
  padding: 32px 0;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: calc(var(--header-height) + 20px);
}

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}

.sidebar-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid var(--glass-border);
  margin: 3px;
  background: transparent;
  color: var(--text-secondary);
}

.filter-chip:hover, .filter-chip.active {
  background: rgba(232, 67, 26, 0.12);
  border-color: rgba(232, 67, 26, 0.3);
  color: var(--accent-secondary);
}

.car-info-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: rgba(232, 67, 26, 0.08);
  border: 1px solid rgba(232, 67, 26, 0.2);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.car-info-icon {
  font-size: 2rem;
}

.car-info-name {
  font-size: 1rem;
  font-weight: 700;
}

.car-info-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Problems Grid */
.problems-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.problems-count {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.problems-count span {
  color: var(--text-primary);
  font-weight: 600;
}

.sort-select {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  outline: none;
}

.problems-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.problem-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.problem-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: var(--severity-color, var(--accent-primary));
  opacity: 0;
  transition: var(--transition);
}

.problem-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.problem-card:hover::after {
  opacity: 1;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.card-category {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255,255,255,0.05);
  padding: 3px 8px;
  border-radius: 4px;
}

.severity-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.severity-high {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
  --severity-color: #ef4444;
}

.severity-medium {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.2);
  --severity-color: #f59e0b;
}

.severity-low {
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.15);
  --severity-color: #22c55e;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.meta-icon {
  font-size: 12px;
  opacity: 0.7;
}

.meta-cost {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-secondary);
  font-weight: 500;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
}

.card-solutions-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-cta {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-fast);
}

.problem-card:hover .card-cta {
  gap: 8px;
}

/* ── Ad Slots ── */
.ad-slot {
  background: rgba(255,255,255,0.02);
  border: 1px dashed rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  grid-column: 1 / -1;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-slot-inline {
  background: rgba(255,255,255,0.02);
  border: 1px dashed rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 24px 0;
}

/* ── Problem Detail Page ── */
.detail-hero {
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 40px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--text-muted);
  transition: var(--transition-fast);
}

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

.breadcrumb-sep {
  opacity: 0.4;
}

.detail-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.detail-title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
}

.detail-meta-row {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.detail-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.detail-meta-item strong {
  color: var(--text-primary);
}

.detail-cost {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent-secondary);
  font-weight: 500;
}

/* Detail Content Grid */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
}

.detail-main {}
.detail-aside {}

/* Content Sections */
.content-section {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
}

.content-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--glass-border);
}

.content-section-title .section-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.icon-symptoms { background: rgba(59, 130, 246, 0.15); }
.icon-solutions { background: rgba(34, 197, 94, 0.12); }
.icon-important { background: rgba(245, 158, 11, 0.12); }

/* Symptoms List */
.symptoms-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.symptoms-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 10px 14px;
  background: rgba(59, 130, 246, 0.05);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-blue);
}

.symptoms-list li::before {
  content: '◆';
  font-size: 6px;
  color: var(--accent-blue);
  flex-shrink: 0;
}

/* Solutions List */
.solutions-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  counter-reset: solution-counter;
}

.solutions-list li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  counter-increment: solution-counter;
  padding: 14px 16px;
  background: rgba(34, 197, 94, 0.04);
  border-radius: var(--radius-md);
  border: 1px solid rgba(34, 197, 94, 0.08);
  transition: var(--transition);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.solutions-list li:hover {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.15);
}

.solutions-list li::before {
  content: counter(solution-counter);
  min-width: 26px;
  height: 26px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.15));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-green);
  flex-shrink: 0;
}

/* Important Points */
.important-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.important-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 12px 14px;
  background: rgba(245, 158, 11, 0.05);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-yellow);
}

.important-list li::before {
  content: '⚠';
  font-size: 12px;
  color: var(--accent-yellow);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Parts Needed */
.parts-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.part-tag {
  padding: 6px 14px;
  background: rgba(232, 67, 26, 0.08);
  border: 1px solid rgba(232, 67, 26, 0.15);
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--accent-secondary);
  font-weight: 500;
}

/* DIY Difficulty */
.difficulty-bar {
  margin-top: 8px;
}

.difficulty-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.difficulty-track {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}

.difficulty-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.diff-easy .difficulty-fill { width: 25%; background: var(--accent-green); }
.diff-medium .difficulty-fill { width: 55%; background: var(--accent-yellow); }
.diff-hard .difficulty-fill { width: 85%; background: var(--accent-primary); }
.diff-expert .difficulty-fill { width: 100%; background: #8b5cf6; }

/* Aside Cards */
.aside-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 16px;
}

.aside-card-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
}

/* Cost Breakdown */
.cost-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.85rem;
}

.cost-row:last-child {
  border-bottom: none;
  font-weight: 700;
  color: var(--accent-secondary);
}

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

.cost-value {
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

/* Related Issues */
.related-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.related-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: var(--transition-fast);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.related-item:hover {
  background: rgba(232, 67, 26, 0.07);
  color: var(--text-primary);
}

.related-sev {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* FAQ Section */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-question {
  padding: 16px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: var(--transition-fast);
}

.faq-question:hover {
  background: rgba(255,255,255,0.03);
}

.faq-toggle {
  color: var(--text-muted);
  font-size: 16px;
  transition: transform 0.3s;
  flex-shrink: 0;
}

.faq-item.open .faq-toggle {
  transform: rotate(45deg);
  color: var(--accent-primary);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s;
}

.faq-item.open .faq-answer {
  max-height: 200px;
}

.faq-answer-inner {
  padding: 0 20px 16px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ── AI Chat Box ── */
.ai-box {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.06), rgba(232, 67, 26, 0.04));
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 20px;
}

.ai-box-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.ai-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(99, 102, 241, 0.3));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.ai-box-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-blue);
}

.ai-box-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.ai-input-row {
  display: flex;
  gap: 10px;
}

.ai-input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.ai-input:focus {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(255,255,255,0.07);
}

.ai-submit {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  color: var(--accent-blue);
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.ai-submit:hover {
  background: rgba(59, 130, 246, 0.3);
}

.ai-response {
  margin-top: 14px;
  padding: 14px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: none;
  line-height: 1.7;
}

.ai-response.visible {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* ── Footer ── */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--glass-border);
  padding: 60px 0 30px;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}

.footer-brand .logo {
  margin-bottom: 14px;
}

.footer-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 280px;
}

.footer-col-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.footer-links a:hover {
  color: var(--accent-primary);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--glass-border);
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 12px;
}

/* ── Page Hero (model/detail pages) ── */
.page-hero {
  padding: 48px 0 32px;
  position: relative;
}

.page-hero-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse 60% 100% at 50% 0%, rgba(232, 67, 26, 0.07), transparent 70%);
  pointer-events: none;
}

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(232, 67, 26, 0.2); }
  50% { box-shadow: 0 0 40px rgba(232, 67, 26, 0.4); }
}

.animate-in {
  animation: fadeIn 0.5s ease forwards;
  opacity: 0;
}

.animate-in-delay-1 { animation-delay: 0.1s; }
.animate-in-delay-2 { animation-delay: 0.2s; }
.animate-in-delay-3 { animation-delay: 0.3s; }

/* ── Loading State ── */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Utility ── */
.text-accent { color: var(--accent-primary); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-mono { font-family: var(--font-mono); }
.hidden { display: none !important; }

/* Scroll to top btn */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--accent-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  color: white;
  opacity: 0;
  transform: translateY(10px);
  transition: var(--transition);
  z-index: 999;
  border: none;
  box-shadow: 0 4px 20px rgba(232, 67, 26, 0.4);
}

.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .page-layout {
    grid-template-columns: 240px 1fr;
  }
  .detail-grid {
    grid-template-columns: 1fr 300px;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 768px) {
  .header-nav { display: none; }
  .header-search { max-width: 200px; }

  .page-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    display: flex;
    gap: 12px;
    overflow-x: auto;
  }

  .sidebar-card {
    flex-shrink: 0;
    min-width: 180px;
  }

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

  .search-row {
    grid-template-columns: 1fr;
  }

  .stats-bar {
    gap: 24px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero {
    padding: 40px 0 30px;
  }

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

@media (max-width: 480px) {
  .container { padding: 0 14px; }
  .search-box { padding: 20px; }
  .content-section { padding: 18px; }
  .detail-title { font-size: 1.4rem; }
}
