/* ============================================================
   Health Guide - theme.css (compatibility shim)
   Canonical tokens live in css/design-system.css (hg-*).
   This file only maps legacy variable names and provides
   shared header / mobile-nav so old pages stay consistent.
   Load order: design-system.css FIRST, then theme.css.
   ============================================================ */

:root {
  /* Map legacy names to canonical hg tokens (do not fork palette) */
  --primary-color: var(--hg-primary, #2563eb);
  --primary-dark: var(--hg-primary-dark, #1d4ed8);
  --secondary-color: var(--hg-teal, #0d9488);
  --accent-color: var(--hg-primary-dark, #1d4ed8);
  --primary: var(--hg-primary, #2563eb);
  --secondary: var(--hg-teal, #0d9488);
  --accent: var(--hg-primary-dark, #1d4ed8);
  --success-color: var(--hg-success, #10b981);
  --success: var(--hg-success, #10b981);
  --warning-color: var(--hg-warning, #f59e0b);
  --warning: var(--hg-warning, #f59e0b);
  --error-color: var(--hg-danger, #ef4444);
  --danger: var(--hg-danger, #ef4444);
  --danger-color: var(--hg-danger, #ef4444);
  --text-dark: var(--hg-ink, #0f172a);
  --text-color: var(--hg-body, #334155);
  --text-primary: var(--hg-ink, #0f172a);
  --text-light: var(--hg-muted, #64748b);
  --text-secondary: var(--hg-muted, #64748b);
  --white: #fff;
  --bg-primary: var(--hg-bg, #f4f8fc);
  --bg-secondary: var(--hg-card, #ffffff);
  --gray-light: var(--hg-bg, #f4f8fc);
  --gray-medium: var(--hg-line, #e2e8f0);
  --gray-100: var(--hg-line-soft, #eef3f9);
  --gray-200: var(--hg-line, #e2e8f0);
  --border-color: var(--hg-line, #e2e8f0);
  --light-blue: #e8f1fd;
  --light-green: #e6f7f1;
  --font-main: var(--hg-font-body, 'Tajawal', 'Cairo', sans-serif);
}

/* Shared header (uses canonical tokens) */
header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  box-shadow: var(--hg-shadow-md, 0 10px 30px rgba(15,23,42,0.08));
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: var(--hg-header-h, 76px);
}
.logo-container { display: flex; align-items: center; gap: 0.5rem; }
.logo-container i { font-size: 2rem; color: var(--hg-primary, #2563eb); }
.logo-container h1 { font-size: 1.6rem; font-weight: 800; color: var(--hg-navy, #0b2a4a); margin: 0; }
nav ul { display: flex; list-style: none; gap: 1rem; align-items: center; margin: 0; padding: 0; }
.nav-link {
  text-decoration: none; color: var(--hg-navy, #0b2a4a); font-weight: 700;
  padding: 0.5rem 1rem; border-radius: 999px; transition: all 0.28s ease;
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.nav-link:hover, .nav-link.active {
  background: var(--hg-primary, #2563eb); color: #fff;
  transform: translateY(-2px); box-shadow: var(--hg-shadow-brand, 0 12px 30px rgba(37,99,235,0.28));
}

/* Shared floating buttons */
.health-guide-btn {
  position: fixed; bottom: 30px; right: 30px; width: 70px; height: 70px;
  background: linear-gradient(135deg, var(--hg-primary, #2563eb), var(--hg-teal, #0d9488));
  color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  text-decoration: none; box-shadow: var(--hg-shadow-brand); z-index: 1000;
}
.back-to-top {
  position: fixed; bottom: 110px; left: 30px; width: 55px; height: 55px;
  background: var(--hg-primary, #2563eb); color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; text-decoration: none;
  box-shadow: var(--hg-shadow-md); z-index: 999;
}

/* Shared mobile nav */
.mobile-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,0.98); backdrop-filter: blur(10px);
  border-top: 1px solid var(--hg-line, #e2e8f0); z-index: 1000;
  padding: 0.5rem 1rem; box-shadow: 0 -2px 10px rgba(15,23,42,0.08);
}
.mobile-nav-items { display: flex; justify-content: space-around; align-items: center; }
.mobile-nav-item {
  display: flex; flex-direction: column; align-items: center; text-decoration: none;
  color: var(--hg-muted, #64748b); padding: 0.5rem; border-radius: 12px; min-width: 60px;
}
.mobile-nav-item:hover, .mobile-nav-item.active { color: var(--hg-primary, #2563eb); background: var(--hg-primary-soft, #dbeafe); }
.mobile-nav-item i { font-size: 1.4rem; margin-bottom: 0.25rem; }
.mobile-nav-item span { font-size: 0.8rem; font-weight: 600; }
.mobile-menu-btn { display: none; background: none; border: none; font-size: 24px; cursor: pointer; }

@media (max-width: 768px) {
  header { padding: 0.8rem 1rem; }
  .mobile-nav { display: block; }
  body { padding-bottom: 80px; }
  .mobile-menu-btn { display: block; }
}
