/* ============================================================
   Food Apps Directory — Shared Stylesheet
   Clean, modern, light theme. Mobile-first.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

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

:root {
  --font: 'Inter', system-ui, -apple-system, sans-serif;

  /* Brand colors */
  --primary: #16a34a;
  --primary-light: #dcfce7;
  --primary-dark: #15803d;

  /* Category colors */
  --cat-fodmap: #16a34a;
  --cat-fodmap-bg: #dcfce7;
  --cat-nutrition: #2563eb;
  --cat-nutrition-bg: #dbeafe;
  --cat-coaching: #7c3aed;
  --cat-coaching-bg: #ede9fe;
  --cat-allergy: #ea580c;
  --cat-allergy-bg: #ffedd5;

  /* UI */
  --text: #111827;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --bg: #ffffff;
  --bg-subtle: #f9fafb;
  --bg-card: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  /* Status */
  --green: #16a34a;
  --green-bg: #dcfce7;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --yellow: #d97706;
  --yellow-bg: #fef3c7;
}

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

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

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

img { max-width: 100%; height: auto; }

/* ——— Navigation ——— */
.nav {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-logo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.nav-logo span.dot {
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
  display: inline-block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--bg-subtle);
  text-decoration: none;
}

.nav-cta {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary) !important;
  border: 1.5px solid var(--primary) !important;
  padding: 6px 14px !important;
  border-radius: 20px !important;
  transition: all 0.15s !important;
}

.nav-cta:hover {
  background: var(--primary) !important;
  color: white !important;
}

/* ——— Container ——— */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

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

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none !important;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

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

.btn-outline:hover {
  background: var(--primary-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

/* ——— Star Ratings ——— */
.stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 1rem;
  line-height: 1;
}

.star-filled { color: #f59e0b; }
.star-half { color: #f59e0b; opacity: 0.6; }
.star-empty { color: #d1d5db; }

.rating-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-left: 4px;
}

.rating-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 2px;
}

/* ——— Category Tags ——— */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tag-fodmap { background: var(--cat-fodmap-bg); color: var(--cat-fodmap); }
.tag-nutrition { background: var(--cat-nutrition-bg); color: var(--cat-nutrition); }
.tag-coaching { background: var(--cat-coaching-bg); color: var(--cat-coaching); }
.tag-allergy { background: var(--cat-allergy-bg); color: var(--cat-allergy); }
.tag-calorie { background: var(--cat-nutrition-bg); color: var(--cat-nutrition); }
.tag-meal-planning { background: #fce7f3; color: #be185d; }

/* ——— Status badges ——— */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-yes { background: var(--green-bg); color: var(--green); }
.badge-no { background: var(--red-bg); color: var(--red); }
.badge-partial { background: var(--yellow-bg); color: var(--yellow); }

/* ——— App Cards ——— */
.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none !important;
  color: var(--text);
}

.app-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
  text-decoration: none;
}

.app-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.app-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.app-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.app-card-tagline {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.app-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

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

.app-price {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

/* ——— Section Headers ——— */
.section {
  padding: 48px 0;
}

.section-sm { padding: 32px 0; }
.section-lg { padding: 64px 0; }

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* ——— Grid ——— */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ——— Hero ——— */
.hero {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 50%, #f0f9ff 100%);
  border-bottom: 1px solid var(--border);
  padding: 56px 20px 48px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  max-width: 700px;
  margin: 0 auto 16px;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  margin-top: 32px;
}

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

.hero-stat-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}

.hero-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ——— Search & Filter Bar ——— */
.filter-bar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 60px;
  z-index: 90;
}

.filter-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 200px;
  max-width: 320px;
  padding: 9px 16px 9px 38px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: var(--font);
  background: var(--bg-subtle);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}

.search-input:focus {
  border-color: var(--primary);
  background-color: var(--bg);
}

.filter-btn {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  transition: all 0.15s;
  font-family: var(--font);
}

.filter-btn:hover,
.filter-btn.active {
  border-color: currentColor;
  color: var(--text);
}

.filter-btn.active[data-filter="all"] { color: var(--text); border-color: var(--text); }
.filter-btn.active[data-filter="fodmap"] { color: var(--cat-fodmap); border-color: var(--cat-fodmap); background: var(--cat-fodmap-bg); }
.filter-btn.active[data-filter="nutrition"] { color: var(--cat-nutrition); border-color: var(--cat-nutrition); background: var(--cat-nutrition-bg); }
.filter-btn.active[data-filter="coaching"] { color: var(--cat-coaching); border-color: var(--cat-coaching); background: var(--cat-coaching-bg); }
.filter-btn.active[data-filter="allergy"] { color: var(--cat-allergy); border-color: var(--cat-allergy); background: var(--cat-allergy-bg); }

/* ——— App Page Layout ——— */
.app-hero {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 40px 0 32px;
}

.app-hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.app-hero-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.app-hero-info { flex: 1; }

.app-hero-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.app-hero-tagline {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

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

.app-layout {
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
}

@media (max-width: 768px) {
  .app-layout { grid-template-columns: 1fr; }
}

/* ——— Content Blocks ——— */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 500px) {
  .pros-cons { grid-template-columns: 1fr; }
}

.pros-list, .cons-list { list-style: none; }

.pros-list li, .cons-list li {
  font-size: 0.9rem;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
}

.pros-list li:last-child, .cons-list li:last-child { border-bottom: none; }

.pros-list li::before {
  content: "✓";
  color: var(--green);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.cons-list li::before {
  content: "✗";
  color: var(--red);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ——— Feature Grid ——— */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.feature-item {
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.feature-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.feature-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

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

.sidebar-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

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

.spec-row:last-child { border-bottom: none; }

.spec-label {
  color: var(--text-muted);
  flex-shrink: 0;
}

.spec-value {
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

/* ——— Verdict Box ——— */
.verdict-box {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 20px 0;
}

.verdict-header {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.verdict-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.verdict-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ——— Screenshot Placeholder ——— */
.screenshot-placeholder {
  background: var(--bg-subtle);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.875rem;
  font-style: italic;
  text-align: center;
  padding: 20px;
}

.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}

@media (max-width: 500px) {
  .screenshots-grid { grid-template-columns: 1fr; }
}

/* ——— Compare Table ——— */
.compare-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: var(--bg);
  min-width: 900px;
}

.compare-table th {
  background: var(--bg-subtle);
  padding: 14px 16px;
  text-align: left;
  font-weight: 700;
  color: var(--text);
  border-bottom: 2px solid var(--border);
  font-size: 0.85rem;
  white-space: nowrap;
}

.compare-table th.col-app {
  min-width: 160px;
  position: sticky;
  left: 0;
  background: var(--bg-subtle);
  z-index: 2;
}

.compare-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.compare-table td.col-app {
  font-weight: 600;
  position: sticky;
  left: 0;
  background: var(--bg);
  z-index: 1;
}

.compare-table tr:hover td { background: var(--bg-subtle); }
.compare-table tr:hover td.col-app { background: var(--bg-subtle); }
.compare-table tr:last-child td { border-bottom: none; }

.compare-table .rating-cell {
  white-space: nowrap;
}

.tick { color: var(--green); font-size: 1rem; }
.cross { color: var(--red); font-size: 1rem; }
.partial { color: var(--yellow); font-size: 0.8rem; }

/* ——— Breadcrumb ——— */
.breadcrumb {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

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

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

.breadcrumb .sep { color: var(--border); }

/* ——— Footer ——— */
.footer {
  background: var(--text);
  color: rgba(255,255,255,0.6);
  padding: 40px 20px;
  margin-top: 64px;
  font-size: 0.875rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-brand {
  font-weight: 700;
  color: white;
  font-size: 1rem;
  margin-bottom: 8px;
}

.footer-desc {
  max-width: 320px;
  line-height: 1.6;
}

.footer-links {
  list-style: none;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-links a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.875rem;
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  max-width: 1100px;
  margin: 24px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
}

/* ——— About page ——— */
.about-content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin: 32px 0 12px;
}

.about-content p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 16px;
}

.about-content ul {
  margin: 0 0 16px 20px;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.8;
}

/* ——— Related Apps ——— */
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 600px) {
  .related-grid { grid-template-columns: 1fr 1fr; }
}

.related-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  text-decoration: none !important;
  color: var(--text);
  transition: all 0.15s;
  display: block;
}

.related-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.related-card .icon { font-size: 1.8rem; margin-bottom: 6px; }
.related-card .name { font-size: 0.85rem; font-weight: 600; }

/* ——— Utility ——— */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-32 { margin-top: 32px; }

/* ——— Responsive ——— */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .hero { padding: 40px 16px 32px; }
  .hero h1 { font-size: 1.7rem; }
  .filter-inner { gap: 8px; }
  .search-input { max-width: 100%; }
  .app-hero-inner { flex-direction: column; }
  .app-hero-icon { width: 64px; height: 64px; font-size: 1.8rem; }
  .feature-grid { grid-template-columns: 1fr; }
  .screenshots-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { flex-direction: column; gap: 20px; }
  .footer-links { gap: 16px; }
  .pros-cons { grid-template-columns: 1fr; }
}
