/* =========================================================
   Sakhi — Design tokens
   Palette: warm clay background, deep plum primary,
   sage = safe/calm, terracotta = fertile/alert, soft gold accent.
   Type: "Fraunces" (display serif, warm + a little unconventional)
         paired with "Inter" (clean body/UI face).
   ========================================================= */

:root {
  --clay-50:   #FBF6F1;   /* page background */
  --clay-100:  #F4EAE0;   /* card surfaces */
  --clay-200:  #E9D9C9;   /* borders / dividers */

  --plum-900:  #3D1F33;   /* primary text on light, deep accents */
  --plum-700:  #5C2A4D;   /* primary brand color */
  --plum-500:  #8C4B79;   /* hover/lighter brand */

  --sage-500:  #5C8A6A;   /* safe days */
  --sage-100:  #E3EDE3;

  --terracotta-500: #D98C5F; /* fertile window */
  --terracotta-100: #F6E4D5;

  --berry-600: #B23A48;   /* period / menstrual phase */
  --berry-100: #F5E0E1;

  --gold-400:  #D9A441;   /* small accents, stars, highlights */

  --ink-900: #2A2026;     /* body text */
  --ink-500: #6B5F66;     /* muted text */

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;

  --shadow-soft: 0 4px 20px rgba(61, 31, 51, 0.08);
  --shadow-lift: 0 8px 30px rgba(61, 31, 51, 0.14);

  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background-color: var(--clay-50);
  color: var(--ink-900);
  min-height: 100vh;
}

h1, h2, h3, h4, .display-font {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--plum-900);
  letter-spacing: -0.01em;
}

a { color: var(--plum-700); text-decoration: none; }
a:hover { color: var(--plum-500); }

/* ---------- Layout shells ---------- */

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(160deg, var(--clay-50) 0%, var(--clay-100) 100%);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  padding: 36px 28px;
}

.auth-card .brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.brand-mark .glyph {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--plum-700), var(--terracotta-500));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
  flex-shrink: 0;
}

.brand-mark .brand-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--plum-900);
}

.auth-subtitle { color: var(--ink-500); font-size: 0.92rem; margin-bottom: 24px; }

/* ---------- Form controls ---------- */

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--plum-900);
  margin-bottom: 4px;
}

.form-control, .form-select {
  border: 1.5px solid var(--clay-200);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.95rem;
  background-color: var(--clay-50);
}

.form-control:focus, .form-select:focus {
  border-color: var(--plum-500);
  box-shadow: 0 0 0 3px rgba(140, 75, 121, 0.15);
  background-color: #fff;
}

.btn {
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 10px 20px;
}

.btn-brand {
  background-color: var(--plum-700);
  border-color: var(--plum-700);
  color: #fff;
}
.btn-brand:hover { background-color: var(--plum-900); border-color: var(--plum-900); color: #fff; }

.btn-outline-brand {
  border: 1.5px solid var(--plum-700);
  color: var(--plum-700);
  background: transparent;
}
.btn-outline-brand:hover { background-color: var(--plum-700); color: #fff; }

/* ---------- App shell (logged-in pages) ---------- */

.app-navbar {
  background-color: #fff;
  border-bottom: 1px solid var(--clay-200);
  padding: 12px 0;
}

.app-navbar .brand-mark .brand-name { font-size: 1.2rem; }

.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--clay-200);
  display: flex;
  justify-content: space-around;
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  z-index: 1030;
  box-shadow: 0 -4px 20px rgba(61,31,51,0.06);
}

.bottom-nav a {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px;
  font-size: 0.68rem;
  color: var(--ink-500);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  flex: 1;
  text-align: center;
}

.bottom-nav a.active { color: var(--plum-700); font-weight: 700; }
.bottom-nav a svg { width: 22px; height: 22px; }

.app-main {
  padding: 20px 0 90px;
  min-height: 100vh;
}

@media (min-width: 768px) {
  .bottom-nav { display: none; }
  .app-main { padding-bottom: 40px; }
}

.sidebar-nav {
  display: none;
}
@media (min-width: 768px) {
  .sidebar-nav {
    display: block;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 16px;
    position: sticky;
    top: 90px;
  }
  .sidebar-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--ink-900);
    font-weight: 500;
    font-size: 0.92rem;
    margin-bottom: 4px;
  }
  .sidebar-nav a.active { background-color: var(--plum-700); color: #fff; }
  .sidebar-nav a:hover:not(.active) { background-color: var(--clay-100); }
}

/* ---------- Cards ---------- */

.card-soft {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: none;
  padding: 22px;
}

/* ---------- Cycle wheel / hero stat ---------- */

.cycle-hero {
  background: linear-gradient(135deg, var(--plum-700) 0%, var(--plum-900) 100%);
  border-radius: var(--radius-lg);
  color: #fff;
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
}

.cycle-hero::after {
  content: "";
  position: absolute;
  right: -40px; top: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}

.cycle-hero .phase-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.16);
  border-radius: 30px;
  padding: 5px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.cycle-hero .big-number {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
}

.stat-chip {
  background: var(--clay-100);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: center;
}
.stat-chip .stat-label { font-size: 0.72rem; color: var(--ink-500); text-transform: uppercase; letter-spacing: .04em; }
.stat-chip .stat-value { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; color: var(--plum-900); margin-top: 2px; }

.tag-badge {
  display: inline-block;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  margin: 3px 4px 3px 0;
}
.tag-safe { background: var(--sage-100); color: var(--sage-500); }
.tag-fertile { background: var(--terracotta-100); color: var(--terracotta-500); }
.tag-period { background: var(--berry-100); color: var(--berry-600); }

/* ---------- Calendar legend dots ---------- */
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }

/* ---------- FAQ accordion ---------- */
.faq-item { border-bottom: 1px solid var(--clay-200); padding: 14px 0; }
.faq-q { font-weight: 600; color: var(--plum-900); cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.faq-a { color: var(--ink-500); font-size: 0.92rem; margin-top: 8px; display: none; line-height: 1.55; }
.faq-item.open .faq-a { display: block; }
.faq-item.open .chev { transform: rotate(180deg); }
.chev { transition: transform 0.2s ease; }

/* ---------- Disclaimer banner ---------- */
.disclaimer-banner {
  background: var(--terracotta-100);
  border: 1px solid var(--terracotta-500);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 0.82rem;
  color: var(--plum-900);
}

/* ---------- Utility ---------- */
.text-muted-soft { color: var(--ink-500); }
.section-title { font-size: 1.1rem; margin-bottom: 14px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--ink-500); }

/* =========================================================
   Phase 2-6 additions
   ========================================================= */

/* --- Notification badge on navbar --- */
.app-navbar {
  background-color: #fff;
  border-bottom: 1px solid var(--clay-200);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 1020;
}

/* --- btn-ghost-nav (homepage & navbar links) --- */
.btn-ghost-nav {
  background: transparent; border: none;
  color: var(--ink-900); font-weight: 500;
  padding: 6px 12px; border-radius: 8px;
}
.btn-ghost-nav:hover, .btn-ghost-nav.active {
  background: var(--clay-100); color: var(--plum-700); font-weight: 600;
}

/* --- News cards (public pages) --- */
.news-card {
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform .2s, box-shadow .2s;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.news-card img { width: 100%; height: 180px; object-fit: cover; }

/* --- Product cards (public pages) --- */
.prod-card {
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
  position: relative;
}
.prod-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }

/* --- FAQ page hero --- */
.faq-hero {
  background: linear-gradient(135deg, var(--plum-700), var(--plum-900));
  color: #fff; padding: 48px 0 40px;
}
.faq-hero h1 {
  font-family: var(--font-display); font-size: 2rem; color: #fff; margin-bottom: .5rem;
}

/* --- Status pills (admin reused on user pages) --- */
.pill-answered  { background: var(--sage-100);        color: var(--sage-500); }
.pill-pending   { background: var(--terracotta-100);   color: var(--terracotta-500); }
.pill-faq       { background: var(--clay-200);         color: var(--plum-700); }
.pill-private   { background: var(--berry-100);        color: var(--berry-600); }
.pill-published { background: var(--sage-100);         color: var(--sage-500); }
.pill-draft     { background: var(--clay-200);         color: var(--ink-500); }

/* --- Question status badges (user Q&A page) --- */
.tag-private  { background: var(--berry-100);       color: var(--berry-600); }
.tag-answered { background: var(--sage-100);        color: var(--sage-500); }
.tag-pending  { background: var(--terracotta-100);  color: var(--terracotta-500); }

/* --- User dashboard quick-action card hover --- */
.quick-action-card {
  transition: transform .15s, box-shadow .15s;
  cursor: pointer;
}
.quick-action-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

/* --- Notification items --- */
.notif-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 0; border-bottom: 1px solid var(--clay-200);
}
.notif-item:last-child { border-bottom: none; }
.notif-icon { font-size: 1.4rem; flex-shrink: 0; }
.notif-unread { background: var(--clay-100); border-radius: var(--radius-md); padding: 10px 14px; }

/* --- Admin layout overrides for user pages that share classes --- */
.adm-table th {
  font-size: .78rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-500); font-weight: 600;
}
.adm-table td { vertical-align: middle; font-size: .88rem; }

/* --- Category chip (FAQ/news filter) --- */
.cat-chip {
  display: inline-block; padding: 6px 16px; border-radius: 30px;
  font-size: .82rem; font-weight: 600;
  background: var(--clay-100); color: var(--ink-900);
  text-decoration: none; margin: 3px;
  border: 1.5px solid transparent;
  transition: background .15s, color .15s;
}
.cat-chip:hover, .cat-chip.active {
  background: var(--plum-700); color: #fff;
  border-color: var(--plum-700);
}

/* --- Share buttons (article page) --- */
.share-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; font-size: .82rem;
  font-weight: 600; text-decoration: none; border: 1.5px solid;
}
.share-wa { background: #25D366; color: #fff; border-color: #25D366; }
.share-tw { background: #1DA1F2; color: #fff; border-color: #1DA1F2; }
.share-li { background: #0077B5; color: #fff; border-color: #0077B5; }
.share-cp { background: transparent; color: var(--plum-700); border-color: var(--plum-700); }

/* --- Featured badge on product cards --- */
.featured-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--gold-400); color: #fff;
  font-size: .62rem; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
}

/* --- Admin answer panel (rich text output) --- */
.answer-body h2, .answer-body h3 { color: var(--plum-900); margin-top: 1.2rem; }
.answer-body a { color: var(--plum-700); }
.answer-body img { max-width: 100%; border-radius: var(--radius-md); }

/* --- Pagination override for brand colours --- */
.page-link { color: var(--plum-700); }
.page-link:hover { background: var(--clay-100); color: var(--plum-900); }
.page-item.active .page-link {
  background: var(--plum-700); border-color: var(--plum-700);
}

/* --- Responsive tweaks --- */
@media (max-width: 576px) {
  .cycle-hero .big-number { font-size: 2rem; }
  .stat-chip .stat-value  { font-size: .95rem; }
}
