/* ============================================================
   AyurVeda AI — Stylesheet
   Aesthetic: Organic Botanical Luxury — Deep Forest, Warm Gold
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,600&family=Karla:wght@300;400;500;600&display=swap');

/* ── Root Variables ─────────────────────────────────────── */
:root {
  --bg:          #080e08;
  --bg-2:        #0f180f;
  --bg-3:        #162116;
  --surface:     #1a2a1a;
  --surface-2:   #213321;
  --border:      #2d4a2d;
  --border-2:    #3d6e3d;

  --gold:        #c8a84b;
  --gold-light:  #e8c87a;
  --gold-dim:    #8a6e28;

  --green:       #5aaf5a;
  --green-dim:   #3a8a3a;
  --green-glow:  rgba(90,175,90,0.15);

  --terracotta:  #c46a3a;
  --rose:        #c4607a;
  --sky:         #5aa8c4;
  --lavender:    #9870c4;

  --text:        #f0ead8;
  --text-muted:  #a09880;
  --text-dim:    #6a6455;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Karla', system-ui, sans-serif;

  --radius:      12px;
  --radius-lg:   20px;
  --radius-xl:   28px;

  --shadow:      0 4px 24px rgba(0,0,0,0.5);
  --shadow-gold: 0 0 30px rgba(200,168,75,0.15);
  --glow-green:  0 0 20px rgba(90,175,90,0.25);

  --transition:  0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Botanical background texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(90,175,90,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(200,168,75,0.03) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%232d4a2d' fill-opacity='0.15'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ─────────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg-3) 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  overflow: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: -100px;
  left: -50px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(90,175,90,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.sidebar-logo .logo-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}

.sidebar-logo h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--gold-light);
  letter-spacing: 0.5px;
}

.sidebar-logo p {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-user {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}

.sidebar-user:hover { background: var(--surface); }

.sidebar-user .user-dosha {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  color: var(--gold);
  margin-top: 4px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  text-decoration: none;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.nav-item.active {
  background: linear-gradient(135deg, var(--surface-2), rgba(200,168,75,0.08));
  color: var(--gold-light);
  border-color: rgba(200,168,75,0.3);
}

.nav-item .nav-icon { font-size: 18px; min-width: 22px; }

.sidebar-bottom {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

.dosha-badge {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

.dosha-dots {
  display: flex;
  gap: 4px;
}

.dosha-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}

.dosha-dot.vata   { background: #9870c4; }
.dosha-dot.pitta  { background: #c46a3a; }
.dosha-dot.kapha  { background: #5aa8c4; }

/* ── Main Content ────────────────────────────────────────── */
.main-content {
  margin-left: 260px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-header {
  padding: 28px 36px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 300;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.page-title em {
  font-style: italic;
  color: var(--gold);
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 6px;
}

.content-area {
  padding: 24px 36px 40px;
  flex: 1;
}

/* ── Page Sections ───────────────────────────────────────── */
.page-section { display: none; }
.page-section.active { display: block; animation: fadeUp 0.35s ease; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--transition);
}

.card:hover { border-color: var(--border-2); }

.card-gold {
  background: linear-gradient(135deg, var(--surface), rgba(200,168,75,0.05));
  border-color: rgba(200,168,75,0.25);
}

.card-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Stats Grid ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--border-2);
  transform: translateY(-2px);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  transform: translate(20px, -20px);
  opacity: 0.1;
}

.stat-card.gold::before  { background: var(--gold); }
.stat-card.green::before { background: var(--green); }
.stat-card.rose::before  { background: var(--rose); }
.stat-card.sky::before   { background: var(--sky); }

.stat-icon  { font-size: 24px; margin-bottom: 10px; }
.stat-value {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card.gold  .stat-value { color: var(--gold); }
.stat-card.green .stat-value { color: var(--green); }
.stat-card.rose  .stat-value { color: var(--rose); }
.stat-card.sky   .stat-value { color: var(--sky); }

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

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

/* ── Consultation Form ───────────────────────────────────── */
.consult-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.form-header {
  padding: 28px 32px 24px;
  background: linear-gradient(135deg, var(--surface-2), rgba(90,175,90,0.05));
  border-bottom: 1px solid var(--border);
}

.form-header h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}

.form-header p { color: var(--text-muted); font-size: 14px; }

.form-body { padding: 28px 32px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.form-row.full { grid-template-columns: 1fr; }

.form-group { display: flex; flex-direction: column; gap: 8px; }

label {
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}

input, select, textarea {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  transition: all var(--transition);
  outline: none;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(200,168,75,0.1);
}

input::placeholder, textarea::placeholder { color: var(--text-dim); }

textarea {
  resize: vertical;
  min-height: 120px;
}

select option { background: var(--surface); }

.symptom-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.chip:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
  background: rgba(200,168,75,0.05);
}

.chip.selected {
  border-color: var(--gold);
  background: rgba(200,168,75,0.12);
  color: var(--gold-light);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all var(--transition);
  text-decoration: none;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, #4a8a40, #3a7030);
  color: #fff;
  box-shadow: 0 4px 16px rgba(90,175,90,0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(90,175,90,0.4);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: var(--bg);
  box-shadow: 0 4px 16px rgba(200,168,75,0.3);
  font-weight: 700;
}

.btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(200,168,75,0.4);
}

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

.btn-outline:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
  background: rgba(200,168,75,0.05);
}

.btn-sm { padding: 8px 18px; font-size: 12px; }
.btn-lg { padding: 16px 40px; font-size: 16px; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ── Loading State ───────────────────────────────────────── */
.loading-overlay {
  display: none;
  text-align: center;
  padding: 48px;
}

.loading-overlay.visible { display: block; }

.herb-spinner {
  font-size: 48px;
  animation: spin 2s linear infinite;
  display: block;
  margin-bottom: 16px;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.loading-text {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--gold);
  font-style: italic;
}

/* ── AI Response Panel ───────────────────────────────────── */
.ai-response-panel {
  display: none;
  background: linear-gradient(135deg, #0f1a0f, #141f14);
  border: 1px solid rgba(90,175,90,0.3);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-top: 24px;
  box-shadow: var(--glow-green);
}

.ai-response-panel.visible { display: block; animation: fadeUp 0.4s ease; }

.ai-response-header {
  padding: 20px 28px;
  border-bottom: 1px solid rgba(90,175,90,0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(90,175,90,0.05);
}

.ai-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--green);
  font-weight: 600;
}

.ai-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.ai-response-body {
  padding: 28px 32px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
}

/* Markdown-rendered content */
.ai-response-body h3 { 
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--gold-light);
  margin: 20px 0 10px;
  font-weight: 600;
}

.ai-response-body strong { color: var(--gold); }

.ai-response-body ul {
  margin: 8px 0;
  padding-left: 24px;
}

.ai-response-body li {
  margin-bottom: 6px;
  color: var(--text);
}

.ai-response-body li::marker { color: var(--green); }

.ai-response-body p { margin-bottom: 12px; }

.ai-response-footer {
  padding: 16px 28px;
  border-top: 1px solid rgba(90,175,90,0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.severity-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.severity-mild { background: rgba(90,175,90,0.15); color: var(--green); border: 1px solid rgba(90,175,90,0.3); }
.severity-moderate { background: rgba(200,168,75,0.15); color: var(--gold); border: 1px solid rgba(200,168,75,0.3); }
.severity-seek_doctor { background: rgba(196,106,58,0.15); color: var(--terracotta); border: 1px solid rgba(196,106,58,0.3); }

.star-rating {
  display: flex;
  gap: 4px;
}

.star-rating .star {
  font-size: 20px;
  cursor: pointer;
  color: var(--border-2);
  transition: color var(--transition);
}

.star-rating .star:hover,
.star-rating .star.active { color: var(--gold); }

/* ── Herb Cards ──────────────────────────────────────────── */
.herbs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.herb-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.herb-card::before {
  content: '';
  position: absolute;
  bottom: -20px; right: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(90,175,90,0.1) 0%, transparent 70%);
  transition: all var(--transition);
}

.herb-card:hover {
  border-color: rgba(90,175,90,0.4);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.herb-card:hover::before {
  width: 120px; height: 120px;
}

.herb-source-link {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 18px;
  opacity: 0.6;
  transition: opacity var(--transition);
  text-decoration: none;
}

.herb-source-link:hover {
  opacity: 1;
}

.herb-emoji { font-size: 36px; margin-bottom: 12px; }
.herb-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.herb-sanskrit {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.herb-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.herb-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.tag-category { background: rgba(90,175,90,0.12); color: var(--green); border: 1px solid rgba(90,175,90,0.2); }
.tag-potency-heating { background: rgba(196,106,58,0.12); color: var(--terracotta); border: 1px solid rgba(196,106,58,0.2); }
.tag-potency-cooling { background: rgba(90,168,196,0.12); color: var(--sky); border: 1px solid rgba(90,168,196,0.2); }
.tag-dosha { background: rgba(200,168,75,0.1); color: var(--gold); border: 1px solid rgba(200,168,75,0.2); }

/* ── Herb Modal ──────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop.open { display: flex; }

.modal {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-header {
  padding: 28px 28px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-2);
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.modal-close {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.modal-close:hover { color: var(--text); border-color: var(--border-2); }

.modal-body { padding: 24px 28px 28px; }

.modal-section {
  margin-bottom: 20px;
}

.modal-section-label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.modal-section-content {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

.modal-section-content strong { color: var(--gold); }

/* ── History Timeline ────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, var(--green), var(--border) 80%);
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
}

.timeline-item:hover {
  border-color: var(--border-2);
  transform: translateX(4px);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 22px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--bg);
  box-shadow: 0 0 8px rgba(90,175,90,0.5);
}

.timeline-date {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.timeline-symptoms {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 8px;
}

.timeline-preview {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Energy Chart ────────────────────────────────────────── */
.chart-wrapper {
  height: 200px;
  position: relative;
  margin-top: 16px;
}

.energy-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 160px;
  padding-bottom: 24px;
}

.energy-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
  gap: 6px;
}

.energy-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  transition: height 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-height: 4px;
  background: linear-gradient(180deg, var(--green), rgba(90,175,90,0.4));
  cursor: pointer;
  position: relative;
}

.energy-bar:hover::after {
  content: attr(data-value);
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--text);
  white-space: nowrap;
}

.energy-bar-date {
  font-size: 9px;
  color: var(--text-dim);
  position: absolute;
  bottom: 0;
  text-align: center;
  width: 100%;
}

/* ── Dosha Quiz ──────────────────────────────────────────── */
.quiz-progress {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
}

.quiz-step {
  height: 4px;
  flex: 1;
  border-radius: 2px;
  background: var(--surface-2);
  transition: background 0.5s ease;
}

.quiz-step.done { background: var(--green); }
.quiz-step.active { background: var(--gold); }

.quiz-question {
  display: none;
}

.quiz-question.active {
  display: block;
  animation: fadeUp 0.3s ease;
}

.quiz-q-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 24px;
  line-height: 1.4;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--transition);
}

.quiz-option:hover {
  border-color: var(--border-2);
  background: var(--surface-2);
}

.quiz-option.selected {
  border-color: var(--gold);
  background: rgba(200,168,75,0.08);
}

.option-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-2);
  flex-shrink: 0;
  margin-top: 2px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-option.selected .option-dot {
  border-color: var(--gold);
  background: var(--gold);
}

.quiz-option.selected .option-dot::after {
  content: '✓';
  font-size: 10px;
  color: var(--bg);
  font-weight: bold;
}

.option-label { font-size: 14px; line-height: 1.5; }
.option-dosha {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ── Journal ─────────────────────────────────────────────── */
.journal-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 24px;
}

.mood-selector {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.mood-btn {
  flex: 1;
  padding: 12px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-3);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
  color: var(--text-muted);
  font-size: 13px;
}

.mood-btn:hover {
  border-color: var(--border-2);
  background: var(--surface);
}

.mood-btn.selected {
  border-color: var(--gold);
  background: rgba(200,168,75,0.08);
  color: var(--gold-light);
}

.mood-emoji { font-size: 22px; display: block; margin-bottom: 4px; }

.energy-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--rose), var(--gold) 50%, var(--green));
  outline: none;
  border: none;
  padding: 0;
}

.energy-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  border: 2px solid var(--bg);
  box-shadow: 0 2px 8px rgba(200,168,75,0.4);
}

/* ── Recommendations ─────────────────────────────────────── */
.reco-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.reco-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition);
}

.reco-card:hover {
  border-color: var(--border-2);
  transform: translateY(-2px);
}

.reco-category-badge {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
  font-weight: 600;
}

.cat-lifestyle { background: rgba(90,175,90,0.12); color: var(--green); }
.cat-diet { background: rgba(200,168,75,0.12); color: var(--gold); }
.cat-herbs { background: rgba(90,168,196,0.12); color: var(--sky); }
.cat-breath { background: rgba(152,112,196,0.12); color: var(--lavender); }
.cat-yoga { background: rgba(196,106,58,0.12); color: var(--terracotta); }
.cat-meditation { background: rgba(196,96,122,0.12); color: var(--rose); }

.reco-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.reco-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Daily Tip Banner ────────────────────────────────────── */
.daily-tip-banner {
  background: linear-gradient(135deg, rgba(200,168,75,0.08), rgba(90,175,90,0.05));
  border: 1px solid rgba(200,168,75,0.25);
  border-radius: var(--radius-xl);
  padding: 20px 28px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.tip-icon { font-size: 32px; }
.tip-content {}
.tip-label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 4px;
}

.tip-text {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--text);
  line-height: 1.5;
  font-style: italic;
}

/* ── Profile Section ─────────────────────────────────────── */
.profile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 16px;
}

/* ── Filter Bar ──────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  align-items: center;
}

.filter-btn {
  padding: 7px 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
}

.filter-btn:hover {
  border-color: var(--border-2);
  color: var(--text);
}

.filter-btn.active {
  border-color: var(--green);
  background: rgba(90,175,90,0.1);
  color: var(--green);
}

.search-input-wrap {
  position: relative;
  flex: 1;
  max-width: 300px;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 14px;
  pointer-events: none;
}

.search-input-wrap input {
  padding-left: 38px;
}

/* ── Dosha Result Card ───────────────────────────────────── */
.dosha-result {
  text-align: center;
  padding: 40px;
}

.dosha-name {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 700;
  text-transform: capitalize;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dosha-score-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 28px 0;
  text-align: left;
}

.dosha-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dosha-bar-label {
  min-width: 50px;
  font-size: 13px;
  color: var(--text-muted);
  text-transform: capitalize;
  font-weight: 500;
}

.dosha-bar-track {
  flex: 1;
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
}

.dosha-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dosha-bar-fill.vata  { background: linear-gradient(90deg, #7850a4, #9870c4); }
.dosha-bar-fill.pitta { background: linear-gradient(90deg, #a44a1a, #c46a3a); }
.dosha-bar-fill.kapha { background: linear-gradient(90deg, #2a88a4, #5aa8c4); }

.dosha-bar-value {
  min-width: 30px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: right;
}

/* ── Toast Notifications ─────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease;
  pointer-events: all;
  max-width: 320px;
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--rose); }
.toast.info    { border-left: 3px solid var(--gold); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Empty States ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 40px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.empty-state p { font-size: 14px; }

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

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform var(--transition); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .grid-2 { grid-template-columns: 1fr; }
  .journal-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-header { padding: 20px 20px 0; }
  .content-area { padding: 20px; }
}

/* ── Utility ─────────────────────────────────────────────── */
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.text-muted { color: var(--text-muted); font-size: 13px; }
.text-gold { color: var(--gold); }
.text-green { color: var(--green); }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--border); margin: 24px 0; }

/* ── AI Provider Cards ───────────────────────────────────── */
.provider-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  position: relative;
}

.provider-card:hover { border-color: var(--border-2); }

.provider-card.active-provider {
  border-color: var(--green);
  box-shadow: var(--glow-green);
}

.provider-card-header {
  padding: 18px 20px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.provider-icon-wrap {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.provider-card-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.provider-card-badge {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(90,175,90,0.12);
  color: var(--green);
  border: 1px solid rgba(90,175,90,0.2);
  font-weight: 600;
}

.active-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(90,175,90,0.6);
  animation: pulse 1.5s infinite;
  position: absolute;
  top: 14px; right: 14px;
}

.provider-card-body { padding: 16px 20px; }

.provider-key-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.key-input-wrap {
  position: relative;
  flex: 1;
}

.key-input-wrap input {
  padding-right: 36px;
  font-family: monospace;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.key-toggle-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  padding: 2px;
  transition: color var(--transition);
}

.key-toggle-btn:hover { color: var(--text); }

.key-status {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
}

.key-status.has-key { color: var(--green); }
.key-status.no-key  { color: var(--text-dim); }

.model-select-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

.model-select-row select { flex: 1; font-size: 13px; }

.provider-card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-3);
}

.test-result {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  display: none;
}

.test-result.success { background: rgba(90,175,90,0.12); color: var(--green); display: block; }
.test-result.error   { background: rgba(196,96,122,0.12); color: var(--rose); display: block; }

.provider-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

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

code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
  color: var(--gold);
}

a { color: var(--gold); }
a:hover { color: var(--gold-light); }
