/* ─── Journal App Styles ─────────────────────────────────────────────────── */
/* Extends theme.css tokens. All colors use CSS custom properties from theme. */

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.journal-body {
  background: var(--cream);
  min-height: 100vh;
}

.journal-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 64px;
  background: var(--cream);
  border-bottom: 1px solid var(--cream-dark);
  backdrop-filter: blur(8px);
}

.journal-nav-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--black);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav-amp {
  color: var(--gold);
}

.journal-nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.journal-nav-date {
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.streak-badge {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(184,151,11,0.08);
  border: 1px solid rgba(184,151,11,0.25);
  padding: 4px 12px;
  border-radius: 20px;
}

.streak-flame {
  margin-right: 4px;
}

.journal-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ─── Sections ───────────────────────────────────────────────────────────── */
.journal-section {
  margin-bottom: 56px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--cream-dark);
}

.journal-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.section-subtitle {
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--muted);
  margin-bottom: 20px;
  margin-top: -8px;
}

/* ─── Affirmation ────────────────────────────────────────────────────────── */
.affirmation-section {
  text-align: center;
  padding: 48px 24px 56px;
  background: linear-gradient(135deg, var(--lavender-light) 0%, var(--cream-dark) 100%);
  border-radius: 2px;
  border-bottom: none;
  margin-bottom: 56px;
}

.affirmation-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.4rem, 3.5vw, 2.1rem);
  font-weight: 300;
  font-style: italic;
  color: var(--black);
  line-height: 1.45;
  margin-bottom: 24px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  quotes: none;
}

.affirmation-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

/* ─── Daily Prompt ───────────────────────────────────────────────────────── */
.daily-prompt {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.6;
  margin-bottom: 20px;
  font-style: italic;
}

/* ─── Textarea ───────────────────────────────────────────────────────────── */
.textarea-wrap {
  position: relative;
}

.journal-textarea {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--cream-dark);
  border-radius: 2px;
  padding: 20px 24px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--ink);
  line-height: 1.8;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  display: block;
}

.journal-textarea:focus {
  border-color: var(--gold-light);
  box-shadow: 0 0 0 3px rgba(184,151,11,0.06);
}

.journal-textarea--tall {
  min-height: 260px;
}

.journal-textarea::placeholder {
  color: #B5ADA7;
  font-weight: 300;
}

.char-count {
  position: absolute;
  bottom: 12px;
  right: 16px;
  font-size: 0.72rem;
  color: var(--muted);
  pointer-events: none;
}

/* ─── Input ──────────────────────────────────────────────────────────────── */
.journal-input {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--cream-dark);
  border-radius: 2px;
  padding: 12px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease;
  margin-top: 12px;
}

.journal-input:focus {
  border-color: var(--gold-light);
}

.journal-input::placeholder {
  color: #B5ADA7;
}

/* ─── Habit Groups ───────────────────────────────────────────────────────── */
.habit-group {
  margin-bottom: 36px;
}

.habit-group:last-child {
  margin-bottom: 0;
}

.habit-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 14px;
  letter-spacing: 0.01em;
}

/* ─── Mood Grid ──────────────────────────────────────────────────────────── */
.mood-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 4px;
}

@media (max-width: 480px) {
  .mood-grid { grid-template-columns: repeat(2, 1fr); }
}

.mood-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--white);
  border: 1px solid var(--cream-dark);
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-family: 'DM Sans', sans-serif;
}

.mood-btn:hover {
  border-color: var(--lavender);
  background: var(--lavender-light);
}

.mood-btn--active {
  border-color: var(--gold);
  background: rgba(184,151,11,0.05);
}

.mood-emoji {
  font-size: 1.5rem;
  line-height: 1;
}

.mood-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ─── Water Tracker ──────────────────────────────────────────────────────── */
.water-tracker {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.water-glass {
  width: 36px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--cream-dark);
  transition: color 0.15s, transform 0.1s;
}

.water-glass:hover {
  transform: translateY(-2px);
  color: var(--lavender);
}

.water-glass--filled {
  color: var(--lavender);
}

.water-glass svg {
  width: 100%;
  height: 100%;
}

.water-fill {
  transition: all 0.2s ease;
}

.water-count {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
  letter-spacing: 0.03em;
}

/* ─── Movement Toggle ────────────────────────────────────────────────────── */
.toggle-row {
  margin-bottom: 4px;
}

.toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: var(--white);
  border: 1px solid var(--cream-dark);
  border-radius: 2px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted);
  transition: all 0.2s ease;
}

.toggle-btn--yes {
  border-color: var(--gold);
  color: var(--ink);
  background: rgba(184,151,11,0.04);
}

.toggle-indicator {
  width: 14px;
  height: 14px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  transition: background 0.2s;
}

.toggle-btn--yes .toggle-indicator {
  background: var(--gold);
  border-color: var(--gold);
}

/* ─── Gratitude ──────────────────────────────────────────────────────────── */
.gratitude-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gratitude-item {
  display: flex;
  align-items: center;
  gap: 16px;
}

.gratitude-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--gold);
  min-width: 24px;
  text-align: center;
}

.gratitude-input {
  margin-top: 0;
  flex: 1;
}

/* ─── History ────────────────────────────────────────────────────────────── */
.history-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.history-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid var(--cream-dark);
  border-radius: 2px;
  min-width: 56px;
}

.history-day-label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.history-day-date {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1;
}

.history-day-mood {
  font-size: 1rem;
  min-height: 1.2em;
}

/* ─── Save Indicator ─────────────────────────────────────────────────────── */
.save-indicator {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 8px;
  min-height: 1em;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.save-indicator.saved {
  opacity: 1;
  color: var(--gold);
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn-ghost {
  background: none;
  border: 1px solid rgba(184,151,11,0.35);
  color: var(--gold);
  padding: 8px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.2s, border-color 0.2s;
}

.btn-ghost:hover {
  background: rgba(184,151,11,0.06);
  border-color: var(--gold);
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.journal-footer {
  text-align: center;
  padding: 32px 24px 48px;
  border-top: 1px solid var(--cream-dark);
}

.journal-footer .footer-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--black);
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.journal-footer .footer-copy {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 300;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .journal-nav { padding: 0 20px; }
  .journal-main { padding: 32px 16px 60px; }
  .journal-nav-date { display: none; }
  .affirmation-text { font-size: 1.3rem; }
}
