/* ============================================================
   Wellness Tracker — Shared Stylesheet
   Theme: Beautiful, Feminine, Inspiring
   ============================================================ */

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

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --bg-main:       #FAF7F4;
  --bg-card:       #FFFFFF;
  --bg-alt:        #FDF0EC;
  --bg-subtle:     #F7F2EF;

  --rose:          #C27182;
  --rose-dark:     #9E4F5E;
  --rose-light:    #F0D5D9;
  --rose-xlight:   #FAF0F2;

  --mauve:         #9B7A8B;
  --mauve-light:   #E8D8E0;

  --sage:          #6B9E7E;
  --sage-dark:     #4D7E61;
  --sage-light:    #C8E0D2;
  --sage-xlight:   #EBF5EF;

  --gold:          #C89566;
  --gold-light:    #F0DCC8;
  --gold-xlight:   #FBF3EA;

  --lavender:      #9B8FBC;
  --lavender-light:#DDD8EF;
  --lavender-xlight:#F3F1FA;

  --sky:           #7DAFC4;
  --sky-light:     #CDEAF5;
  --sky-xlight:    #EDF6FA;

  --text-dark:     #2D2229;
  --text-med:      #6B5B65;
  --text-light:    #9E8E98;
  --text-xlight:   #C4B8BF;

  --border:        #EDE4E0;
  --border-light:  #F5EFED;

  --shadow-sm:     0 2px 8px rgba(45, 34, 41, 0.06);
  --shadow:        0 4px 20px rgba(45, 34, 41, 0.09);
  --shadow-md:     0 8px 32px rgba(45, 34, 41, 0.12);
  --shadow-lg:     0 16px 48px rgba(45, 34, 41, 0.15);

  --radius-sm:     8px;
  --radius:        14px;
  --radius-lg:     22px;
  --radius-xl:     32px;

  --transition:    all 0.22s ease;
  --transition-slow: all 0.38s ease;

  --font-serif:    'Playfair Display', Georgia, serif;
  --font-sans:     'DM Sans', system-ui, -apple-system, sans-serif;
}

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-dark);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul, ol { list-style: none; }

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-family: var(--font-serif);
  line-height: 1.25;
  color: var(--text-dark);
}
h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 600; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 500; }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.55rem); font-weight: 500; }
h4 { font-size: 1.1rem; font-weight: 500; font-family: var(--font-sans); }
p  { color: var(--text-med); }
small { font-size: 0.8rem; }

/* ── Navigation ────────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 247, 244, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  padding: 0 1.5rem;
}

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

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--rose-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}
.nav-logo span { font-style: italic; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-med);
  transition: var(--transition);
  white-space: nowrap;
}
.nav-link:hover,
.nav-link.active {
  background: var(--rose-xlight);
  color: var(--rose-dark);
}
.nav-link .nav-icon { font-size: 1rem; }

/* ── Page Wrapper ──────────────────────────────────────────── */
.page-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* ── Page Header ───────────────────────────────────────────── */
.page-header {
  margin-bottom: 2.5rem;
}
.page-header .eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rose);
  margin-bottom: 0.5rem;
}
.page-header h1 { margin-bottom: 0.5rem; }
.page-header p { font-size: 1.05rem; max-width: 600px; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow); }

.card-sm { padding: 1.25rem; }
.card-lg { padding: 2.25rem; }

/* ── Section Headers ───────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.section-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.section-icon.rose    { background: var(--rose-xlight); }
.section-icon.sage    { background: var(--sage-xlight); }
.section-icon.gold    { background: var(--gold-xlight); }
.section-icon.lavender{ background: var(--lavender-xlight); }
.section-icon.sky     { background: var(--sky-xlight); }
.section-icon.mauve   { background: #F4EDF1; }

.section-header-text h2 { font-size: 1.4rem; }
.section-header-text p  { font-size: 0.9rem; margin-top: 0.25rem; }

/* ── Divider ───────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ── Badge / Tag ───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.badge-rose      { background: var(--rose-xlight);     color: var(--rose-dark); }
.badge-sage      { background: var(--sage-xlight);     color: var(--sage-dark); }
.badge-gold      { background: var(--gold-xlight);     color: #8C5E30; }
.badge-lavender  { background: var(--lavender-xlight); color: #5A4E80; }
.badge-sky       { background: var(--sky-xlight);      color: #2C6E85; }
.badge-mauve     { background: var(--mauve-light);     color: #5A3848; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--rose);
  color: #fff;
}
.btn-primary:hover {
  background: var(--rose-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn-outline {
  background: transparent;
  color: var(--rose);
  border-color: var(--rose-light);
}
.btn-outline:hover {
  background: var(--rose-xlight);
  border-color: var(--rose);
}
.btn-ghost {
  background: transparent;
  color: var(--text-med);
}
.btn-ghost:hover {
  background: var(--bg-subtle);
  color: var(--text-dark);
}
.btn-sage {
  background: var(--sage);
  color: #fff;
}
.btn-sage:hover {
  background: var(--sage-dark);
  transform: translateY(-1px);
}

/* ── Checklist ─────────────────────────────────────────────── */
.checklist { display: flex; flex-direction: column; gap: 0.6rem; }
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  transition: var(--transition);
  cursor: pointer;
}
.checklist-item:hover { background: var(--bg-alt); }
.checklist-item.done  { background: var(--sage-xlight); }
.checklist-item.done .check-label { color: var(--text-med); }

.checklist-item input[type="checkbox"] { display: none; }
.custom-check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
  margin-top: 1px;
}
.checklist-item.done .custom-check {
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
}
.custom-check::after { content: ''; }
.checklist-item.done .custom-check::after { content: '✓'; font-size: 0.85rem; font-weight: 700; }

.check-label { font-size: 0.9rem; color: var(--text-dark); line-height: 1.45; flex: 1; }

/* ── Progress Bar ──────────────────────────────────────────── */
.progress-bar-wrap {
  background: var(--border);
  border-radius: 50px;
  height: 8px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 50px;
  background: linear-gradient(90deg, var(--rose) 0%, var(--mauve) 100%);
  transition: width 0.5s ease;
}
.progress-bar-fill.sage {
  background: linear-gradient(90deg, var(--sage) 0%, var(--sage-dark) 100%);
}

/* ── Tooltip ───────────────────────────────────────────────── */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-dark);
  color: #fff;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-family: var(--font-sans);
  font-weight: 400;
  white-space: nowrap;
  max-width: 240px;
  white-space: normal;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 50;
  line-height: 1.4;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ── Grid utilities ────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .nav-links .nav-link span { display: none; }
  .nav-logo { font-size: 1rem; }
  .page-wrapper { padding: 1.5rem 1rem 3rem; }
}

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-xlight);
  font-size: 0.82rem;
  border-top: 1px solid var(--border-light);
  font-style: italic;
  font-family: var(--font-serif);
}

/* ── Meal card macros pill row ─────────────────────────────── */
.macro-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}
.macro-pill {
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-med);
  background: var(--bg-subtle);
}
.macro-pill.cal    { background: var(--gold-xlight);     color: #8C5E30; }
.macro-pill.pro    { background: var(--rose-xlight);     color: var(--rose-dark); }
.macro-pill.carb   { background: var(--sky-xlight);      color: #2C6E85; }
.macro-pill.fat    { background: var(--lavender-xlight); color: #5A4E80; }
.macro-pill.fib    { background: var(--sage-xlight);     color: var(--sage-dark); }

/* ── Scroll animations ─────────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}
