/* ===========================
   MindBloom — Mental Health Mood Tracker
   SDG 3: Good Health & Well-being
   =========================== */

:root {
  --green-deep: #1a3d2b;
  --green-mid: #2d6a4f;
  --green-light: #52b788;
  --green-pale: #b7e4c7;
  --cream: #fefae0;
  --cream-dark: #f0e9d2;
  --rose: #e8998d;
  --rose-dark: #c97b6e;
  --gold: #d4a853;
  --text-dark: #1a2c1f;
  --text-mid: #3d5a42;
  --text-light: #7a9e82;
  --white: #ffffff;
  --shadow: 0 8px 32px rgba(26, 61, 43, 0.12);
  --shadow-lg: 0 20px 60px rgba(26, 61, 43, 0.18);
  --radius: 20px;
  --radius-sm: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--text-dark);
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(82, 183, 136, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 85% 80%, rgba(212, 168, 83, 0.06) 0%, transparent 50%);
}

/* ===== HEADER ===== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 40px;
  background: var(--white);
  box-shadow: 0 2px 20px rgba(26,61,43,0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--green-deep);
  letter-spacing: -0.5px;
}

nav { display: flex; gap: 8px; flex-wrap: wrap; }

.nav-btn {
  padding: 8px 18px;
  border: 2px solid transparent;
  border-radius: 50px;
  background: none;
  color: var(--text-mid);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
}

.nav-btn:hover {
  background: var(--green-pale);
  color: var(--green-deep);
}

.nav-btn.active {
  background: var(--green-mid);
  color: var(--white);
  border-color: var(--green-mid);
}

/* ===== PAGES ===== */
.page { display: none; padding: 48px 40px 80px; max-width: 960px; margin: 0 auto; animation: fadeUp 0.4s ease; }
.page.active { display: block; }

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

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 60px 20px;
}

.hero-badge {
  display: inline-block;
  background: var(--green-pale);
  color: var(--green-deep);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 6px 18px;
  border-radius: 50px;
  margin-bottom: 24px;
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 900;
  line-height: 1.15;
  color: var(--green-deep);
  margin-bottom: 20px;
}

.accent { color: var(--green-light); }

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 520px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.cta-btn {
  background: var(--green-mid);
  color: var(--white);
  border: none;
  padding: 16px 36px;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(45,106,79,0.35);
  transition: all 0.3s ease;
  letter-spacing: 0.3px;
}

.cta-btn:hover {
  background: var(--green-deep);
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(45,106,79,0.4);
}

/* ===== STATS ROW ===== */
.stats-row {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 20px 0 48px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 32px;
  text-align: center;
  box-shadow: var(--shadow);
  min-width: 140px;
  transition: transform 0.2s ease;
}

.stat-card:hover { transform: translateY(-4px); }

.stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--green-mid);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* ===== FEATURES ===== */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 8px;
}

.feature-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border-top: 4px solid var(--green-pale);
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.feature-icon { font-size: 2rem; margin-bottom: 14px; }

.feature-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--green-deep);
  margin-bottom: 10px;
}

.feature-card p { color: var(--text-light); line-height: 1.65; font-size: 0.95rem; }

/* ===== PAGE HEADER ===== */
.page-header {
  margin-bottom: 40px;
}

.page-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  color: var(--green-deep);
  margin-bottom: 8px;
}

.page-header p {
  color: var(--text-light);
  font-size: 1rem;
}

/* ===== MOOD SELECTOR ===== */
.mood-selector {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.mood-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 24px;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.25s ease;
  border: 3px solid transparent;
  min-width: 100px;
}

.mood-option:hover {
  transform: translateY(-6px) scale(1.05);
  box-shadow: var(--shadow-lg);
  border-color: var(--green-light);
}

.mood-option.selected {
  border-color: var(--green-mid);
  background: var(--green-pale);
  transform: translateY(-4px);
}

.mood-emoji { font-size: 2.4rem; }
.mood-label { font-size: 0.85rem; font-weight: 600; color: var(--text-mid); }

/* ===== LOG FORM ===== */
.log-form {
  background: var(--white);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.35s ease;
}

.form-group { margin-bottom: 28px; }

.form-group label {
  display: block;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 10px;
  font-size: 0.95rem;
}

textarea {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  resize: vertical;
  background: var(--cream);
  color: var(--text-dark);
  transition: border-color 0.2s;
  line-height: 1.6;
}

textarea:focus {
  outline: none;
  border-color: var(--green-light);
  background: var(--white);
}

.radio-group, .checkbox-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.radio-option, .check-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--cream);
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
  border: 2px solid transparent;
}

.radio-option:hover, .check-option:hover {
  background: var(--green-pale);
}

input[type="radio"], input[type="checkbox"] {
  accent-color: var(--green-mid);
  width: 16px;
  height: 16px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--green-mid);
  height: 6px;
  margin-top: 8px;
}

.submit-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--green-mid), var(--green-light));
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 6px 20px rgba(45,106,79,0.3);
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(45,106,79,0.4);
}

/* ===== TIP BOX ===== */
.tip-box {
  margin-top: 24px;
  padding: 24px 28px;
  background: linear-gradient(135deg, var(--green-pale), #d8f3dc);
  border-radius: var(--radius);
  border-left: 5px solid var(--green-mid);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--green-deep);
  animation: fadeUp 0.4s ease;
}

.tip-box h4 { font-family: 'Playfair Display', serif; font-size: 1.1rem; margin-bottom: 8px; }

/* ===== CHART ===== */
.chart-container {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-label {
  color: var(--text-light);
  font-size: 1rem;
  text-align: center;
}

/* ===== HISTORY LIST ===== */
.history-list { display: flex; flex-direction: column; gap: 16px; }

.history-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  transition: transform 0.2s;
}

.history-card:hover { transform: translateX(4px); }

.h-emoji { font-size: 2rem; }

.h-info h4 {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.h-info p { font-size: 0.85rem; color: var(--text-light); }

.h-date {
  font-size: 0.8rem;
  color: var(--text-light);
  text-align: right;
  white-space: nowrap;
}

.score-badge {
  background: var(--green-pale);
  color: var(--green-deep);
  border-radius: 50px;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 4px;
  display: inline-block;
}

/* ===== TIPS GRID ===== */
.tips-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }

.tip-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--green-light);
  transition: transform 0.25s, box-shadow 0.25s;
}

.tip-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

.tip-card-icon { font-size: 2rem; margin-bottom: 14px; }

.tip-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  color: var(--green-deep);
  margin-bottom: 10px;
}

.tip-card p { color: var(--text-light); line-height: 1.65; font-size: 0.92rem; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--green-deep);
  color: var(--white);
  padding: 14px 28px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.4s cubic-bezier(.34,1.56,.64,1);
  z-index: 999;
  box-shadow: 0 8px 28px rgba(0,0,0,0.25);
  pointer-events: none;
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 24px 20px;
  background: var(--green-deep);
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  line-height: 1.6;
}

.footer strong { color: var(--green-pale); }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .header { padding: 14px 18px; flex-wrap: wrap; gap: 12px; }
  .page { padding: 32px 18px 60px; }
  .mood-option { min-width: 80px; padding: 16px 14px; }
  .mood-emoji { font-size: 1.8rem; }
  .log-form { padding: 24px 18px; }
  .history-card { grid-template-columns: auto 1fr; }
  .h-date { grid-column: 2; }
}
