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

:root {
  --primary: #2563EB;
  --primary-light: #60A5FA;
  --primary-dark: #1D4ED8;
  --teal: #0D9488;
  --teal-light: #5EEAD4;
  --orange: #F59E0B;
  --orange-light: #FDE68A;
  --bg: #F8FAFC;
  --white: #FFFFFF;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --red: #EF4444;
  --green: #10B981;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 25px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
  --shadow-lg: 0 20px 40px -4px rgba(0,0,0,0.1);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --radius-full: 9999px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ===== HEADER / NAV ===== */
.header {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 24px;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

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

.logo-icon {
  width: 36px;
  height: 36px;
}

.logo-text {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.search-bar {
  flex: 1;
  max-width: 420px;
  margin: 0 32px;
  position: relative;
}

.search-bar input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-family: inherit;
  background: var(--gray-50);
  color: var(--gray-800);
  transition: var(--transition);
  outline: none;
}

.search-bar input:focus {
  border-color: var(--primary-light);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.search-bar .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 16px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-actions a, .header-actions button {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  font-family: inherit;
}

.header-actions a:hover, .header-actions button:hover { color: var(--primary); }

.menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--gray-600);
}

/* ===== AGE GROUP TABS (category view header) ===== */
.age-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.age-tabs::-webkit-scrollbar { display: none; }

.age-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
  white-space: nowrap;
  transition: var(--transition);
  gap: 2px;
}

.age-tab .tab-emoji { font-size: 20px; }
.age-tab .tab-range { font-size: 10px; color: var(--gray-400); }

.age-tab:hover { background: var(--gray-100); color: var(--gray-700); }

.age-tab.active {
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow);
}
.age-tab.active .tab-range { color: rgba(255,255,255,0.8); }

/* ===== HERO SECTION ===== */
.hero {
  text-align: center;
  padding: 48px 24px 32px;
  max-width: 700px;
  margin: 0 auto;
}

.hero-logo {
  width: 80px;
  height: 80px;
  margin-bottom: 16px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #EFF6FF, #E0F2FE);
  border: 1px solid rgba(37,99,235,0.15);
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 28px;
}

.hero-badge svg { width: 18px; height: 18px; }

.hero h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.hero p {
  font-size: 16px;
  color: var(--gray-500);
  max-width: 480px;
  margin: 0 auto;
}

/* ===== AGE GROUP CARDS (Homepage) ===== */
.age-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 800px;
  margin: 0 auto 40px;
  padding: 0 24px;
}

.age-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  border: 1.5px solid var(--gray-100);
  position: relative;
}

.age-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.age-card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  object-position: center top;
}

.age-card-body {
  padding: 16px;
}

.age-card-body h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 2px;
}

.age-card-body span {
  font-size: 13px;
  color: var(--gray-400);
  font-weight: 400;
}

/* ===== TRUST BANNER ===== */
.trust-banner {
  max-width: 800px;
  margin: 0 auto 32px;
  padding: 0 24px;
}

.trust-banner-inner {
  background: linear-gradient(135deg, #EFF6FF 0%, #E0F2FE 100%);
  border: 1px solid rgba(37,99,235,0.1);
  border-radius: var(--radius);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.trust-icon {
  width: 48px;
  height: 48px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
  font-size: 22px;
}

.trust-banner-inner h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.trust-banner-inner p {
  font-size: 13px;
  color: var(--gray-500);
}

/* ===== TRUST BADGES (bottom) ===== */
.trust-badges {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 800px;
  margin: 0 auto 40px;
  padding: 0 24px;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.trust-badge-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.trust-badge-icon.blue { background: #DBEAFE; color: var(--primary); }
.trust-badge-icon.green { background: #D1FAE5; color: var(--green); }
.trust-badge-icon.orange { background: #FEF3C7; color: var(--orange); }
.trust-badge-icon.purple { background: #EDE9FE; color: #7C3AED; }

.trust-badge h5 {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 1px;
}

.trust-badge p {
  font-size: 11px;
  color: var(--gray-400);
}

/* ===== CATEGORY VIEW ===== */
.category-view { display: none; }
.category-view.active { display: block; }
.home-view.hidden { display: none; }

.category-hero {
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  padding: 32px 24px;
  display: flex;
  align-items: center;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto 32px;
  border-radius: 0 0 var(--radius) var(--radius);
}

.category-hero-text h2 {
  font-size: 28px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.category-hero-text .age-range {
  font-size: 15px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 10px;
}

.category-hero-text p {
  font-size: 14px;
  color: var(--gray-500);
  max-width: 380px;
}

.category-hero-img {
  width: 140px;
  height: 140px;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
}

/* ===== BROWSE BY TOPIC ===== */
.topics-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 32px;
}

.topics-section h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 20px;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

.topic-card {
  background: var(--white);
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 20px 12px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.topic-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.topic-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  font-size: 24px;
}

.topic-icon.blue { background: #DBEAFE; }
.topic-icon.red { background: #FEE2E2; }
.topic-icon.green { background: #D1FAE5; }
.topic-icon.purple { background: #EDE9FE; }
.topic-icon.orange { background: #FEF3C7; }
.topic-icon.teal { background: #CCFBF1; }
.topic-icon.pink { background: #FCE7F3; }
.topic-icon.indigo { background: #E0E7FF; }
.topic-icon.yellow { background: #FEF9C3; }

.topic-card span {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
}

/* ===== POPULAR SEARCHES ===== */
.popular-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 24px;
}

.popular-section h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 14px;
}

.popular-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.popular-tag {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-family: inherit;
}

.popular-tag:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #EFF6FF;
}

/* ===== EMERGENCY BANNER ===== */
.emergency-banner {
  max-width: 1200px;
  margin: 0 auto 24px;
  padding: 0 24px;
}

.emergency-inner {
  background: linear-gradient(135deg, #FEF2F2, #FEE2E2);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.emergency-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.emergency-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.emergency-inner h4 {
  font-size: 14px;
  font-weight: 700;
  color: #991B1B;
  margin-bottom: 2px;
}

.emergency-inner p {
  font-size: 12px;
  color: #B91C1C;
}

.emergency-link {
  padding: 8px 20px;
  border: 1.5px solid #FCA5A5;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: #B91C1C;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition);
}

.emergency-link:hover {
  background: #FCA5A5;
  color: #7F1D1D;
}

/* ===== SYMPTOM DETAIL VIEW ===== */
.symptom-view { display: none; max-width: 800px; margin: 0 auto; padding: 0 24px 100px; }
.symptom-view.active { display: block; }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  padding: 12px 0;
  transition: var(--transition);
}
.back-btn:hover { opacity: 0.7; }

.symptom-header {
  margin-bottom: 24px;
}

.symptom-header h2 {
  font-size: 26px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 6px;
}

.symptom-header p {
  font-size: 14px;
  color: var(--gray-500);
}

.info-card {
  background: var(--white);
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.info-card h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-card ul {
  list-style: none;
  padding: 0;
}

.info-card ul li {
  padding: 8px 0;
  font-size: 14px;
  color: var(--gray-600);
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.info-card ul li:last-child { border-bottom: none; }
.info-card ul li::before { content: '•'; color: var(--primary); font-weight: 700; }

.info-card p {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.7;
}

.warning-card {
  background: #FEF2F2;
  border-color: rgba(239,68,68,0.15);
}

.warning-card h4 { color: #991B1B; }

/* ===== AD PLACEHOLDER ===== */
.ad-slot {
  background: var(--gray-100);
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 32px;
  text-align: center;
  margin: 24px 0;
  font-size: 13px;
  color: var(--gray-400);
  font-weight: 500;
}

/* ===== BOTTOM NAV (Mobile) ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 env(safe-area-inset-bottom, 8px);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 500;
  color: var(--gray-400);
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  transition: var(--transition);
  text-decoration: none;
}

.nav-item .nav-icon { font-size: 22px; }
.nav-item:hover, .nav-item.active { color: var(--primary); }

/* ===== DISCLAIMER FOOTER ===== */
.disclaimer-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 120px;
  text-align: center;
  border-top: 1px solid var(--gray-200);
}

.disclaimer-footer p {
  font-size: 12px;
  color: var(--gray-400);
  margin-bottom: 8px;
  line-height: 1.6;
}

.disclaimer-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.disclaimer-footer a:hover { text-decoration: underline; }

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--white);
  border-radius: var(--radius);
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 32px;
  animation: modalIn 0.3s ease;
}

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

.modal h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 16px;
}

.modal p, .modal li {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.7;
  margin-bottom: 8px;
}

.modal ul { padding-left: 20px; }

.modal-close {
  float: right;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--gray-400);
}
.modal-close:hover { color: var(--gray-800); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .header-inner { height: 56px; }
  .search-bar { display: none; }
  .header-actions > a { display: none; }
  .menu-btn { display: block; }

  .hero { padding: 32px 20px 24px; }
  .hero h1 { font-size: 24px; }
  .hero p { font-size: 14px; }

  .age-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    padding: 0 16px;
  }

  .age-card-img { height: 120px; }

  .trust-badges {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 0 16px;
  }

  .trust-banner { padding: 0 16px; }

  .category-hero {
    flex-direction: column-reverse;
    text-align: center;
    padding: 24px 16px;
    gap: 16px;
  }

  .category-hero-img { width: 100px; height: 100px; }

  .topics-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .emergency-inner { flex-direction: column; text-align: center; }
  .emergency-left { flex-direction: column; }
}

@media (max-width: 480px) {
  .age-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .topics-grid { grid-template-columns: repeat(3, 1fr); }
  .trust-badges { grid-template-columns: 1fr 1fr; }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.2s; }
.animate-in:nth-child(5) { animation-delay: 0.25s; }
.animate-in:nth-child(6) { animation-delay: 0.3s; }
