:root {
  --primary: #2D6A4F;
  --primary-light: #40916C;
  --primary-dark: #1B4332;
  --accent: #D4A574;
  --accent-light: #E8C4A0;
  --accent-dark: #B8860B;
  --text-dark: #2C2416;
  --text-light: #8B8680;
  --bg-light: #F5F0E8;
  --bg-white: #FDFBF7;
  --border: #E8E3DB;
  --line: #DDD7CF;
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --free: #D4EDDA;
  --free-text: #155724;
  --under-20: #CFE2FF;
  --under-20-text: #084298;
  --over-20: #F8D7DA;
  --over-20-text: #842029;
}

[data-theme="dark"] {
  --primary: #5A9F7D;
  --primary-light: #6FB59A;
  --primary-dark: #3D6B52;
  --accent: #C4956F;
  --accent-light: #D4A884;
  --accent-dark: #9D7250;
  --text-dark: #E8E3DB;
  --text-light: #B8B0A8;
  --bg-light: #2A2420;
  --bg-white: #3C3530;
  --border: #4A4440;
  --line: #5A5450;
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --free: #1E4620;
  --free-text: #A8E6B8;
  --under-20: #1E3A5F;
  --under-20-text: #93C5FD;
  --over-20: #5F1F1F;
  --over-20-text: #FCA5A5;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Source Sans 3', sans-serif;
  color: var(--text-dark);
  background-color: var(--bg-light);
  line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
  color: var(--primary-dark);
}

h2 {
  font-size: 2rem;
  color: var(--primary);
  margin-top: 2rem;
}

h3 {
  font-size: 1.5rem;
  color: var(--primary);
}

p {
  margin-bottom: 1rem;
  color: var(--text-dark);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-light);
  text-decoration: underline;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  background-color: var(--bg-white);
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  gap: 1rem;
}

.theme-toggle {
  padding: 0.5rem 1rem;
  background-color: var(--bg-light);
  border: 1px solid var(--border);
  color: var(--text-dark);
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.theme-toggle:hover {
  background-color: var(--accent-light);
  border-color: var(--accent);
}

[data-theme="dark"] .theme-toggle {
  background-color: var(--bg-light);
  border-color: var(--border);
}

[data-theme="dark"] .theme-toggle:hover {
  background-color: var(--accent-light);
  border-color: var(--accent);
}

.logo {
  font-family: 'Fraunces', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-dark);
  text-decoration: none;
  transition: color 0.2s ease;
}

.logo:hover {
  color: var(--primary-light);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-link {
  color: var(--text-dark);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s ease;
  position: relative;
}

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

.nav-link.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.25rem;
}

/* Hero Section */
.hero {
  padding: 3rem 0;
  text-align: center;
}

.hero-content h1 {
  margin-bottom: 1rem;
  font-size: 2.5rem;
}

.hero-content p {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 700px;
  margin: 0 auto 2rem;
}

/* Controls Section */
.controls-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.filter-controls {
  flex: 1;
  min-width: 300px;
}

.filter-group {
  margin-bottom: 1.5rem;
}

.filter-label {
  display: block;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.filter-pill {
  padding: 0.5rem 1rem;
  border: 2px solid var(--border);
  background-color: var(--bg-white);
  color: var(--text-dark);
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.filter-pill.active {
  background-color: var(--primary);
  color: var(--bg-white);
  border-color: var(--primary);
}

.checklist-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--bg-white);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(45, 106, 79, 0.2);
}

.btn-primary:disabled {
  background-color: var(--border);
  color: var(--text-light);
  cursor: not-allowed;
}

.btn-secondary {
  background-color: var(--bg-white);
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-secondary:hover {
  background-color: var(--primary);
  color: var(--bg-white);
}

.checklist-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  background-color: var(--accent);
  color: var(--bg-white);
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.8rem;
}

/* Data Disclaimer */
.data-disclaimer {
  background-color: #FEF3C7;
  border-left: 4px solid #F59E0B;
  padding: 1rem;
  margin: 2rem 0;
  border-radius: 4px;
}

.data-disclaimer strong {
  color: #92400E;
}

.data-disclaimer p {
  color: #78350F;
  margin-bottom: 0;
}

/* Swap Container */
.swap-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-light);
  font-size: 1.1rem;
}

/* Swap Card */
.swap-card {
  background-color: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.swap-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.swap-card-header {
  background-color: var(--bg-light);
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.swap-card-header h3 {
  margin: 0;
  flex: 1;
  font-size: 1.25rem;
}

.cost-badge {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  text-transform: uppercase;
}

.cost-free {
  background-color: var(--free);
  color: var(--free-text);
}

.cost-under_20 {
  background-color: var(--under-20);
  color: var(--under-20-text);
}

.cost-over_20 {
  background-color: var(--over-20);
  color: var(--over-20-text);
}

.swap-card-content {
  padding: 1.5rem;
  flex: 1;
}

.swap-comparison {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

.swap-old, .swap-new {
  flex: 1;
}

.swap-old strong, .swap-new strong {
  display: block;
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.swap-old p, .swap-new p {
  font-size: 0.9rem;
  color: var(--text-light);
  margin: 0;
}

.swap-arrow {
  font-size: 1.5rem;
  color: var(--primary);
  flex-shrink: 0;
}

.swap-details {
  background-color: var(--bg-light);
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.detail-row:last-child {
  margin-bottom: 0;
}

.detail-label {
  font-weight: 600;
  color: var(--primary);
}

.detail-value {
  color: var(--text-dark);
}

.swap-description {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.affiliate-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: var(--accent-light);
  color: var(--primary-dark);
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.affiliate-link:hover {
  background-color: var(--accent);
  text-decoration: none;
}

.swap-card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background-color: var(--bg-light);
}

.btn-checklist {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--primary);
  background-color: var(--bg-white);
  color: var(--primary);
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-checklist:hover {
  background-color: var(--primary);
  color: var(--bg-white);
}

.btn-checklist.active {
  background-color: var(--primary);
  color: var(--bg-white);
}

/* Content Section */
.content-section {
  background-color: var(--bg-white);
  padding: 2rem;
  border-radius: 8px;
  margin: 2rem 0;
}

.content-section h1 {
  margin-bottom: 1.5rem;
}

.content-section h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.content-section h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.content-section ul, .content-section ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.content-section li {
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.content-section a {
  color: var(--primary);
  text-decoration: underline;
}

.content-section a:hover {
  color: var(--primary-light);
}

/* FAQ Styles */
.faq-item {
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 1.25rem;
  background-color: var(--bg-light);
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  color: var(--primary-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s ease;
}

.faq-question:hover {
  background-color: #E8F5E9;
}

.faq-toggle {
  transition: transform 0.2s ease;
  font-size: 0.8rem;
}

.faq-item.open .faq-toggle {
  transform: rotate(180deg);
}

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

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

.faq-answer-content {
  padding: 1.25rem;
  color: var(--text-dark);
}

.faq-answer-content p {
  margin-bottom: 0.75rem;
}

.faq-answer-content p:last-child {
  margin-bottom: 0;
}

/* Ad Slot */
.ad-slot {
  background-color: var(--bg-light);
  border: 2px dashed var(--border);
  border-radius: 6px;
  padding: 2rem;
  text-align: center;
  color: var(--text-light);
  margin: 2rem 0;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Footer */
.site-footer {
  background-color: var(--primary-dark);
  color: var(--bg-white);
  padding: 2rem 0;
  margin-top: 3rem;
  border-top: 2px solid var(--primary);
}

.site-footer p {
  margin: 0;
  text-align: center;
  color: var(--bg-white);
}

.site-footer a {
  color: var(--accent-light);
  text-decoration: underline;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  .header-content {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .nav-links {
    gap: 1rem;
    font-size: 0.85rem;
    order: 3;
    flex-basis: 100%;
  }

  .theme-toggle {
    order: 2;
  }

  .controls-section {
    flex-direction: column;
  }

  .filter-controls {
    width: 100%;
  }

  .checklist-controls {
    width: 100%;
  }

  .checklist-controls .btn {
    flex: 1;
  }

  .swap-container {
    grid-template-columns: 1fr;
  }

  .swap-comparison {
    flex-direction: column;
  }

  .swap-arrow {
    transform: rotate(90deg);
  }

  .content-section {
    padding: 1.5rem;
  }

  .hero-content h1 {
    font-size: 1.75rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  .logo {
    font-size: 1.25rem;
  }

  .nav-links {
    gap: 0.5rem;
    font-size: 0.75rem;
  }

  .filter-pills {
    gap: 0.5rem;
  }

  .filter-pill {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  .btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }

  .swap-card-header {
    padding: 1rem;
  }

  .swap-card-content {
    padding: 1rem;
  }

  .swap-card-footer {
    padding: 0.75rem 1rem;
  }

  .detail-row {
    flex-direction: column;
    gap: 0.25rem;
  }
}

@media print {
  body {
    background-color: var(--bg-white);
  }

  .site-header, .site-footer, .controls-section, .ad-slot, .data-disclaimer {
    display: none;
  }

  .swap-container {
    grid-template-columns: 1fr;
  }

  .swap-card {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid var(--border);
  }
}