/* ============================================================
   BetterHealthTips.com – Main Stylesheet
   Design: Clean Medical · Calm Palette · DM Serif + DM Sans
   ============================================================ */

/* ── CSS Variables ── */
:root {
  --sky-50: #f0f9ff;
  --sky-100: #e0f2fe;
  --sky-200: #bae6fd;
  --sky-400: #38bdf8;
  --sky-500: #0ea5e9;
  --sky-600: #0284c7;
  --sky-700: #0369a1;
  --teal-400: #2dd4bf;
  --teal-500: #14b8a6;
  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --purple-400: #a78bfa;
  --purple-500: #8b5cf6;
  --rose-400: #fb7185;
  --amber-400: #fbbf24;
  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --white: #ffffff;

  --primary: var(--sky-500);
  --primary-dark: var(--sky-600);
  --primary-light: var(--sky-100);
  --accent: var(--teal-500);

  --bg: var(--white);
  --bg-2: var(--slate-50);
  --bg-3: var(--slate-100);
  --surface: var(--white);
  --surface-2: var(--slate-50);
  --border: var(--slate-200);
  --text: var(--slate-800);
  --text-2: var(--slate-600);
  --text-3: var(--slate-400);

  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06);
  --shadow-xl: 0 24px 60px rgba(0,0,0,.14);

  --header-h: 64px;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --transition: 200ms cubic-bezier(.4,0,.2,1);
  --transition-lg: 350ms cubic-bezier(.4,0,.2,1);
}

/* Dark Mode */
[data-theme="dark"] {
  --bg: #0d1117;
  --bg-2: #161b22;
  --bg-3: #1c2333;
  --surface: #161b22;
  --surface-2: #1c2333;
  --border: #30363d;
  --text: #e6edf3;
  --text-2: #8b949e;
  --text-3: #484f58;
  --primary-light: rgba(14,165,233,.15);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow: 0 4px 16px rgba(0,0,0,.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
}

/* ── 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: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition-lg), color var(--transition-lg);
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
button { font-family: var(--font-body); cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: var(--font-body); }
img { max-width: 100%; height: auto; }

/* ── Disclaimer Banner ── */
.disclaimer-banner {
  background: linear-gradient(135deg, var(--sky-600), var(--teal-500));
  color: white;
  text-align: center;
  padding: 10px 48px 10px 16px;
  font-size: .85rem;
  font-weight: 500;
  position: relative;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.disclaimer-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 1.2rem;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background var(--transition);
}
.disclaimer-close:hover { background: rgba(255,255,255,.2); }

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-lg);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text);
  white-space: nowrap;
}
.logo-icon { font-size: 1.5rem; }
.logo-accent { color: var(--primary); }
.nav {
  display: flex;
  gap: 4px;
  margin: 0 auto;
  overflow-x: auto;
}
.nav-link {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-2);
  transition: all var(--transition);
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--bg-2); }
.nav-link.active { color: var(--primary); background: var(--primary-light); }
.header-actions { display: flex; align-items: center; gap: 8px; }

/* Lang Switcher */
.lang-switcher { display: flex; gap: 2px; background: var(--bg-2); border-radius: 8px; padding: 2px; }
.lang-btn {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-2);
  transition: all var(--transition);
  letter-spacing: .03em;
}
.lang-btn.active, .lang-btn:hover { background: var(--primary); color: white; }

/* Theme Toggle */
.theme-toggle {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
}
.theme-toggle:hover { background: var(--bg-3); }

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 38px; height: 38px;
  align-items: center;
  justify-content: center;
  background: var(--bg-2);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.mobile-menu-btn span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

/* ── Main & Sections ── */
.main { min-height: calc(100vh - var(--header-h)); }
.section { display: none; max-width: 1280px; margin: 0 auto; padding: 40px 24px 80px; }
.section.active { display: block; animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.section-header { margin-bottom: 32px; }
.section-title { font-family: var(--font-display); font-size: 2rem; color: var(--text); margin-bottom: 6px; }
.section-sub { color: var(--text-2); font-size: 1rem; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(14,165,233,.35); }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-2); }
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-full { width: 100%; justify-content: center; }
.btn-arrow { transition: transform var(--transition); }
.btn-primary:hover .btn-arrow { transform: translateX(4px); }

/* ── Hero ── */
.hero-section {
  display: flex !important;
  align-items: center;
  min-height: calc(100vh - var(--header-h) - 42px);
  gap: 60px;
  position: relative;
  overflow: hidden;
  padding-top: 60px;
  padding-bottom: 60px;
}
.hero-bg-shapes { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .4;
}
[data-theme="dark"] .shape { opacity: .15; }
.shape-1 { width: 500px; height: 500px; background: radial-gradient(circle, var(--sky-200), transparent); top: -100px; right: -100px; }
.shape-2 { width: 300px; height: 300px; background: radial-gradient(circle, var(--teal-400), transparent); bottom: 0; left: 20%; opacity: .25; }
.shape-3 { width: 200px; height: 200px; background: radial-gradient(circle, var(--purple-400), transparent); top: 30%; left: -50px; opacity: .2; }

.hero-content { flex: 1; position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--sky-200);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
[data-theme="dark"] .hero-badge { border-color: rgba(14,165,233,.3); }
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 20px;
}
.hero-title em { color: var(--primary); font-style: italic; }
.hero-subtitle { font-size: 1.1rem; color: var(--text-2); max-width: 540px; margin-bottom: 32px; line-height: 1.7; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 48px; }
.hero-stats { display: flex; align-items: center; gap: 24px; }
.stat { display: flex; flex-direction: column; }
.stat strong { font-size: 1.4rem; font-weight: 700; color: var(--primary); font-family: var(--font-display); }
.stat span { font-size: .8rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.stat-divider { width: 1px; height: 36px; background: var(--border); }

.hero-visual { flex: 0 0 380px; position: relative; z-index: 1; }
.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-xl);
}
.hero-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-2);
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--emerald-500);
  box-shadow: 0 0 0 0 rgba(16,185,129,.4);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,.4); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.floating { animation: float 5s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.mini-stats { display: flex; flex-direction: column; gap: 12px; }
.mini-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-2);
  border-radius: var(--radius);
  padding: 12px 16px;
}
.mini-icon { font-size: 1.2rem; }
.mini-stat span { flex: 1; font-size: .85rem; color: var(--text-2); }
.mini-stat strong { font-weight: 700; color: var(--primary); font-size: 1.1rem; }

/* ── Dashboard ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.dash-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.dash-card-wide { grid-column: 1 / -1; }
.dash-card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  font-size: 1rem;
}
.dash-card-action {
  font-size: .8rem;
  color: var(--primary);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--primary-light);
  transition: all var(--transition);
}
.dash-card-action:hover { background: var(--sky-200); }
.dash-stats { display: flex; gap: 16px; flex-wrap: wrap; }
.dash-stat {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-2);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
  min-width: 160px;
}
.dash-stat:hover { background: var(--bg-3); transform: translateY(-1px); }
.dash-stat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.bg-blue { background: rgba(14,165,233,.15); }
.bg-green { background: rgba(16,185,129,.15); }
.bg-purple { background: rgba(139,92,246,.15); }
.dash-stat-info { display: flex; flex-direction: column; }
.dash-stat-num { font-size: 1.5rem; font-weight: 700; font-family: var(--font-display); color: var(--text); line-height: 1; }
.dash-stat-label { font-size: .78rem; color: var(--text-2); margin-top: 4px; }
.dash-list { display: flex; flex-direction: column; gap: 10px; }
.empty-state-small { color: var(--text-3); font-size: .85rem; text-align: center; padding: 16px; }
.reminder-list { display: flex; flex-direction: column; gap: 10px; }
.reminder-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-2);
  border-radius: var(--radius);
  font-size: .88rem;
  color: var(--text-2);
}
.reminder-icon { font-size: 1.1rem; }
.dash-appt-item, .dash-med-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-2);
  border-radius: var(--radius);
  font-size: .85rem;
}
.dash-appt-date { font-weight: 700; color: var(--primary); font-size: .8rem; }
.dash-appt-doctor { font-weight: 600; color: var(--text); }
.dash-appt-spec { color: var(--text-2); font-size: .78rem; }
.dash-med-name { font-weight: 600; color: var(--text); }
.dash-med-cat { color: var(--text-3); font-size: .78rem; }
.dash-card-cta {
  background: linear-gradient(135deg, var(--sky-600), var(--teal-500));
  border-color: transparent;
  text-align: center;
  color: white;
}
.dash-card-cta .dash-ai-icon { font-size: 2.5rem; margin-bottom: 12px; }
.dash-card-cta h3 { font-size: 1.1rem; font-weight: 700; color: white; margin-bottom: 8px; }
.dash-card-cta p { font-size: .85rem; color: rgba(255,255,255,.8); margin-bottom: 16px; }

/* ── Search Bar ── */
.search-bar-wrap { margin-bottom: 28px; }
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-bar:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(14,165,233,.1); }
.search-icon { font-size: 1.1rem; color: var(--text-3); }
.search-input {
  flex: 1;
  border: none;
  background: none;
  color: var(--text);
  font-size: .95rem;
  outline: none;
}
.search-input::placeholder { color: var(--text-3); }
.search-filter {
  border: none;
  background: var(--bg-2);
  color: var(--text);
  font-size: .85rem;
  padding: 6px 12px;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
}

/* ── Medication Grid ── */
.medication-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.med-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
}
.med-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: var(--primary); }
.med-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.med-name { font-weight: 700; font-size: 1.05rem; color: var(--text); }
.med-generic { font-size: .78rem; color: var(--text-3); margin-top: 2px; }
.med-category-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--primary-light);
  color: var(--primary);
  white-space: nowrap;
}
.med-description { font-size: .83rem; color: var(--text-2); margin-bottom: 12px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.med-card-footer { display: flex; align-items: center; justify-content: space-between; }
.med-save-btn {
  font-size: .8rem;
  color: var(--text-3);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.med-save-btn:hover, .med-save-btn.saved { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }
.med-view-btn { font-size: .8rem; color: var(--primary); font-weight: 600; }

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 640px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-xl);
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-2);
  font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.modal-close:hover { background: var(--bg-3); }
.modal-med-name { font-family: var(--font-display); font-size: 1.8rem; margin-bottom: 4px; }
.modal-med-generic { color: var(--text-3); font-size: .85rem; margin-bottom: 16px; }
.modal-section { margin-top: 20px; }
.modal-section-title { font-weight: 700; color: var(--text); font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.modal-section-title::before { content: ''; display: block; width: 3px; height: 14px; background: var(--primary); border-radius: 2px; }
.modal-section p, .modal-section ul { font-size: .9rem; color: var(--text-2); line-height: 1.65; }
.modal-section ul { padding-left: 16px; }
.modal-section ul li { margin-bottom: 4px; }
.warning-box {
  background: rgba(251,191,36,.12);
  border: 1px solid rgba(251,191,36,.3);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: .85rem;
  color: var(--text-2);
  margin-top: 8px;
}

/* ── Appointments ── */
.appointments-layout { display: grid; grid-template-columns: 360px 1fr; gap: 24px; }
.appt-form-card, .appt-list-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.appt-form-card h3, .note-form-card h3 { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 20px; color: var(--text); }

/* Forms */
.appt-form, .note-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group label { font-size: .82rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.form-input {
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-2);
  color: var(--text);
  font-size: .9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
}
.form-input:focus { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px rgba(14,165,233,.1); }
textarea.form-input { resize: vertical; min-height: 80px; }

/* Appointment List */
.appt-tabs { display: flex; gap: 4px; margin-bottom: 20px; background: var(--bg-2); padding: 4px; border-radius: 10px; }
.appt-tab { flex: 1; padding: 8px 16px; border-radius: 8px; font-size: .85rem; font-weight: 600; color: var(--text-2); transition: all var(--transition); }
.appt-tab.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.appointment-list { display: flex; flex-direction: column; gap: 12px; }
.appt-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--bg-2);
  border-radius: var(--radius);
  border-left: 3px solid var(--primary);
  position: relative;
}
.appt-item-date { text-align: center; min-width: 52px; }
.appt-item-day { font-family: var(--font-display); font-size: 1.6rem; line-height: 1; color: var(--primary); }
.appt-item-month { font-size: .7rem; text-transform: uppercase; color: var(--text-3); letter-spacing: .05em; }
.appt-item-info { flex: 1; }
.appt-item-doctor { font-weight: 700; font-size: .95rem; color: var(--text); }
.appt-item-spec { font-size: .8rem; color: var(--primary); font-weight: 500; }
.appt-item-clinic { font-size: .78rem; color: var(--text-3); margin-top: 2px; }
.appt-item-time { font-size: .8rem; color: var(--text-2); margin-top: 4px; }
.appt-item-notes { font-size: .78rem; color: var(--text-3); margin-top: 4px; font-style: italic; }
.appt-delete {
  position: absolute;
  top: 12px; right: 12px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-3);
  font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.appt-delete:hover { background: rgba(251,113,133,.15); color: var(--rose-400); }

/* Calendar */
.calendar-view { }
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal-title { font-family: var(--font-display); font-size: 1.2rem; color: var(--text); }
.cal-nav { width: 32px; height: 32px; border-radius: 8px; background: var(--bg-2); font-size: .9rem; display: flex; align-items: center; justify-content: center; transition: background var(--transition); }
.cal-nav:hover { background: var(--bg-3); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day-header { text-align: center; font-size: .72rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; padding: 8px 0; }
.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: .85rem;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.cal-day:hover { background: var(--bg-2); color: var(--text); }
.cal-day.today { background: var(--primary-light); color: var(--primary); font-weight: 700; }
.cal-day.has-appt::after { content: ''; position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--primary); }
.cal-day.other-month { opacity: .3; }

/* ── AI Assistant ── */
.disclaimer-box {
  background: var(--primary-light);
  border: 1px solid var(--sky-200);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  gap: 12px;
  font-size: .85rem;
  color: var(--text-2);
  margin-bottom: 24px;
  line-height: 1.6;
}
[data-theme="dark"] .disclaimer-box { border-color: rgba(14,165,233,.2); }
.disclaimer-box .disclaimer-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }

.chat-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  height: 560px;
  overflow: hidden;
}
.chat-messages { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.chat-msg { display: flex; gap: 12px; }
.chat-msg.user { flex-direction: row-reverse; }
.chat-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; background: var(--bg-2); border: 1px solid var(--border); }
.chat-msg.user .chat-avatar { background: var(--primary); }
.chat-bubble {
  max-width: 72%;
  padding: 14px 18px;
  border-radius: 18px;
  font-size: .9rem;
  line-height: 1.6;
  background: var(--bg-2);
  color: var(--text);
}
.chat-msg.user .chat-bubble { background: var(--primary); color: white; }
.quick-prompts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.quick-prompt {
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  font-size: .78rem;
  color: var(--text-2);
  background: var(--surface);
  transition: all var(--transition);
}
.quick-prompt:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.chat-input-wrap { padding: 16px 20px; border-top: 1px solid var(--border); }
.chat-input-row { display: flex; gap: 10px; align-items: flex-end; }
.chat-input {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  background: var(--bg-2);
  color: var(--text);
  font-size: .9rem;
  resize: none;
  outline: none;
  transition: border-color var(--transition);
  line-height: 1.5;
}
.chat-input:focus { border-color: var(--primary); background: var(--surface); }
.chat-send-btn {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  background: var(--primary);
  color: white;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.chat-send-btn:hover { background: var(--primary-dark); transform: scale(1.05); }
.chat-send-btn:disabled { opacity: .5; cursor: default; transform: none; }
.chat-disclaimer { font-size: .72rem; color: var(--text-3); text-align: center; margin-top: 8px; }
.typing-indicator { display: flex; gap: 4px; padding: 12px 16px; }
.typing-indicator span { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); animation: bounce .8s infinite; }
.typing-indicator span:nth-child(2) { animation-delay: .1s; }
.typing-indicator span:nth-child(3) { animation-delay: .2s; }
@keyframes bounce { 0%, 80%, 100% { transform: none; opacity: .5; } 40% { transform: translateY(-6px); opacity: 1; } }

/* ── Health Notes ── */
.notes-layout { display: grid; grid-template-columns: 340px 1fr; gap: 24px; }
.note-form-card, .notes-list-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.notes-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.note-filter-btn { padding: 6px 14px; border-radius: 100px; font-size: .78rem; font-weight: 600; color: var(--text-2); border: 1px solid var(--border); transition: all var(--transition); }
.note-filter-btn.active, .note-filter-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }
.notes-list { display: flex; flex-direction: column; gap: 12px; }
.note-card {
  background: var(--bg-2);
  border-radius: var(--radius);
  padding: 16px;
  border-left: 3px solid var(--teal-500);
  position: relative;
}
.note-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; }
.note-title { font-weight: 700; font-size: .95rem; color: var(--text); }
.note-category-badge { font-size: .7rem; font-weight: 600; text-transform: uppercase; padding: 2px 8px; border-radius: 100px; background: var(--primary-light); color: var(--primary); }
.note-date { font-size: .75rem; color: var(--text-3); margin-bottom: 6px; }
.note-content { font-size: .85rem; color: var(--text-2); line-height: 1.55; }
.note-delete { position: absolute; top: 12px; right: 12px; width: 24px; height: 24px; border-radius: 50%; color: var(--text-3); font-size: .85rem; display: flex; align-items: center; justify-content: center; transition: all var(--transition); }
.note-delete:hover { background: rgba(251,113,133,.15); color: var(--rose-400); }

/* ── Reports ── */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.report-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}
.report-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: var(--primary); }
.report-icon { font-size: 2.5rem; margin-bottom: 16px; }
.report-card h3 { font-family: var(--font-display); font-size: 1.1rem; color: var(--text); margin-bottom: 8px; }
.report-card p { font-size: .82rem; color: var(--text-2); margin-bottom: 20px; line-height: 1.5; }
.report-card-full { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; background: linear-gradient(135deg, var(--sky-50), var(--teal-400) 200%); border-color: var(--sky-200); }
[data-theme="dark"] .report-card-full { background: linear-gradient(135deg, rgba(14,165,233,.1), rgba(20,184,166,.05)); border-color: rgba(14,165,233,.2); }

/* ── Pricing ── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  align-items: stretch;
}
.pricing-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  transition: all var(--transition);
}
.pricing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.pricing-card-featured { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(14,165,233,.1); }
.pricing-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--bg-2);
  color: var(--text-2);
  margin-bottom: 12px;
  align-self: flex-start;
}
.pricing-badge-featured { background: var(--primary); color: white; }
.pricing-badge-enterprise { background: linear-gradient(135deg, var(--teal-500), var(--sky-600)); color: white; }
.pricing-price { font-family: var(--font-display); font-size: 2.5rem; font-weight: 400; color: var(--text); margin-bottom: 4px; }
.pricing-price span { font-size: 1rem; color: var(--text-3); }
.pricing-card h3 { font-size: 1rem; font-weight: 700; color: var(--text-2); margin-bottom: 20px; }
.pricing-features { list-style: none; flex: 1; margin-bottom: 24px; display: flex; flex-direction: column; gap: 10px; }
.pricing-features li { font-size: .85rem; color: var(--text-2); display: flex; align-items: flex-start; gap: 6px; }
.pricing-features li:has(✗) { color: var(--text-3); text-decoration: line-through; opacity: .6; }

/* ── Footer ── */
.footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 60px 0 0;
  margin-top: auto;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.5fr 2fr;
  gap: 60px;
  padding-bottom: 40px;
}
.footer-brand p { font-size: .85rem; color: var(--text-3); margin: 12px 0; max-width: 320px; line-height: 1.6; }
.footer-email { font-size: .85rem; color: var(--primary); font-weight: 600; }
.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.footer-col h4 { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); margin-bottom: 14px; }
.footer-col a, .footer-col span { display: block; font-size: .85rem; color: var(--text-3); margin-bottom: 8px; transition: color var(--transition); }
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: .78rem;
  color: var(--text-3);
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--slate-800);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 500;
  z-index: 500;
  transform: translateY(100px);
  opacity: 0;
  transition: all .3s ease;
  box-shadow: var(--shadow-lg);
  max-width: 320px;
}
.toast.show { transform: none; opacity: 1; }
[data-theme="dark"] .toast { background: var(--slate-100); color: var(--slate-800); }

/* ── Empty States ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-3);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; opacity: .5; }
.empty-state h3 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; color: var(--text-2); }
.empty-state p { font-size: .85rem; }

/* ── RTL Support ── */
[lang="ar"] { direction: rtl; text-align: right; }
[lang="ar"] .nav { flex-direction: row-reverse; }
[lang="ar"] .appt-form-card, [lang="ar"] .appt-list-card { direction: rtl; }
[lang="ar"] .appt-item { border-left: none; border-right: 3px solid var(--primary); }
[lang="ar"] .note-card { border-left: none; border-right: 3px solid var(--teal-500); }
[lang="ar"] .modal-section-title::before { margin-right: 0; margin-left: 8px; }
[lang="ar"] .chat-msg.user { flex-direction: row; }
[lang="ar"] .chat-msg.assistant { flex-direction: row-reverse; }
[lang="ar"] .chat-msg.user .chat-bubble { background: var(--bg-2); color: var(--text); }
[lang="ar"] .chat-msg.assistant .chat-bubble { background: var(--primary); color: white; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ── Print ── */
@media print {
  .header, .footer, .disclaimer-banner, .btn, .chat-input-wrap { display: none !important; }
  .section.active { padding: 0; }
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .hero-section { flex-direction: column; text-align: center; min-height: auto; padding-top: 40px; }
  .hero-content { max-width: 600px; }
  .hero-subtitle { max-width: 100%; }
  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-visual { width: 100%; max-width: 380px; }
  .appointments-layout { grid-template-columns: 1fr; }
  .notes-layout { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 768px) {
  .nav { display: none; position: fixed; top: var(--header-h); left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px; flex-direction: column; gap: 4px; box-shadow: var(--shadow-lg); z-index: 99; }
  .nav.open { display: flex; }
  .nav-link { padding: 12px 16px; border-radius: var(--radius); }
  .mobile-menu-btn { display: flex; }
  .header-inner { gap: 8px; }
  .dash-stats { flex-direction: column; }
  .pricing-grid { grid-template-columns: 1fr; }
  .footer-links { grid-template-columns: 1fr 1fr; }
  .section { padding: 24px 16px 60px; }
  .section-title { font-size: 1.5rem; }
  .hero-title { font-size: 2rem; }
  .lang-switcher { display: none; }
  .appt-form-card, .appt-list-card { padding: 16px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .medication-grid { grid-template-columns: 1fr; }
  .modal { padding: 20px 16px; max-height: 90vh; }
  .footer-inner { padding: 0 16px 24px; }
  .footer-links { grid-template-columns: 1fr; }
}
