/* ═══════════════════════════════════════════════════════════════════
   MOOD JOURNAL SECTION
═══════════════════════════════════════════════════════════════════ */
.section-mood { overflow-y: auto; padding-bottom: 40px; }

.mood-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; margin-bottom: 16px;
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow);
}
.mood-toolbar .toolbar-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem; font-weight: 700; color: var(--text);
  letter-spacing: -0.3px;
}
.mood-toolbar .toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.mood-toolbar .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); }
.mood-toolbar .status-dot.saving { background: var(--sun); }
.mood-toolbar .status-dot.error { background: #c44040; }
.mood-toolbar .status-text { font-size: 0.72rem; font-weight: 700; color: var(--muted); }

/* "+ New entry" button — gradient pill matching the Quick-Mood FAB vibe */
#moodLogNew.btn-ghost {
  background: linear-gradient(135deg, var(--pink), var(--violet));
  color: white;
  border: none;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(167, 139, 250, 0.32);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: inline-flex; align-items: center; gap: 6px;
}
#moodLogNew.btn-ghost:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(167, 139, 250, 0.42);
  color: white;
}
#moodLogNew.btn-ghost .btn-label { letter-spacing: 0.2px; }

.mood-body { padding: 0 18px; display: flex; flex-direction: column; gap: 16px; }

.mood-metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  background: var(--surface); border-radius: 18px;
  padding: 16px 18px; box-shadow: var(--shadow);
}
.mood-metric {
  text-align: center;
  padding: 6px 0;
}
.mood-metric-label { font-size: 0.64rem; font-weight: 800; color: var(--muted); letter-spacing: 0.9px; text-transform: uppercase; }
.mood-metric-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.45rem; font-weight: 700; color: var(--text);
  margin-top: 4px; font-variant-numeric: tabular-nums;
}
.mood-metric-value small { font-size: 0.7rem; color: var(--muted); font-weight: 600; }
.mood-metrics-caveat {
  text-align: center; font-size: 0.78rem; color: var(--text2); font-style: italic;
  padding: 4px 0;
}
@media (max-width: 600px) {
  .mood-metrics { grid-template-columns: repeat(2, 1fr); }
}

/* Timeline */
.mood-timeline { display: flex; flex-direction: column; gap: 18px; }
.mood-day { }
.mood-day-label {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem; font-weight: 700; color: var(--text2);
  padding: 4px 2px 8px;
}
.mood-day-entries { display: flex; flex-direction: column; gap: 8px; }

.mood-entry {
  background: var(--surface); border-radius: 16px;
  padding: 14px 16px; box-shadow: var(--shadow);
  animation: mood-entry-in 0.4s ease backwards;
}
.mood-entry-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 4px;
}
.mood-entry-bits { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 0; }
.mood-bit {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 0.82rem; font-weight: 700;
  background: var(--bg-1);
}
.mood-bit-face { font-size: 1.1rem; padding: 2px 8px; background: transparent; }
.mood-bit-energy { color: var(--violet-d); background: rgba(167,139,250,0.15); }
.mood-bit-gratitude { color: var(--pink-d); background: rgba(255,107,157,0.15); }
.mood-entry-time {
  font-size: 0.72rem; font-weight: 700; color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mood-entry-edit {
  background: transparent; border: none; cursor: pointer; padding: 4px 8px;
  border-radius: 8px; font-size: 0.9rem; color: var(--text2);
}
.mood-entry-edit:hover { background: var(--bg-1); color: var(--text); }
.mood-entry-body {
  padding-top: 6px;
}
.mood-entry-note {
  font-size: 0.9rem; color: var(--text); line-height: 1.5;
  padding: 2px 0;
}
.mood-entry-gratitude-note {
  font-family: 'Playfair Display', serif;
  font-style: italic; font-size: 0.92rem; color: var(--text2);
  padding: 4px 12px; margin-top: 6px;
  background: linear-gradient(135deg, rgba(255,107,157,0.08), rgba(255,193,160,0.08));
  border-radius: 10px; border-left: 3px solid var(--pink);
  line-height: 1.5;
}

.mood-empty {
  text-align: center; padding: 60px 24px;
  background: var(--surface); border-radius: 22px; box-shadow: var(--shadow);
}
.mood-empty-emoji { font-size: 3rem; margin-bottom: 12px; }
.mood-empty-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem; font-weight: 700; color: var(--text); margin-bottom: 6px;
}
.mood-empty-sub { font-size: 0.92rem; color: var(--text2); margin-bottom: 20px; font-style: italic; }
.mood-start-btn {
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--pink), var(--violet));
  color: white; border: none; border-radius: 14px;
  font-family: inherit; font-size: 0.92rem; font-weight: 800; cursor: pointer;
  box-shadow: 0 8px 20px rgba(167, 139, 250, 0.3);
}

/* Entry modal */
.mood-pick-faces { display: flex; gap: 8px; justify-content: center; padding: 8px 0; }
.mood-pick-face {
  font-size: 1.6rem; background: var(--bg-1); border: 2px solid transparent;
  border-radius: 14px; padding: 8px 12px; cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.mood-pick-face:hover { transform: scale(1.08); }
.mood-pick-face.selected { border-color: var(--pink); background: rgba(255,107,157,0.12); transform: scale(1.1); }

.mood-pick-dots { display: flex; gap: 6px; justify-content: center; padding: 8px 0; }
.mood-pick-dot {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--bg-1); border: 2px solid transparent;
  border-radius: 12px; padding: 6px 10px; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 0.78rem;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.mood-pick-dot:hover { transform: scale(1.06); }
.mood-pick-dot.selected { border-color: var(--violet); background: rgba(167,139,250,0.12); transform: scale(1.08); }
.mood-pick-dot span:first-child { font-size: 1.1rem; }
.mood-pick-dot-num { color: var(--text2); }
.mood-pick-gratitude.selected { border-color: var(--pink); background: rgba(255,107,157,0.12); }

.mood-entry-empty-hint {
  text-align: center; font-size: 0.82rem; color: var(--muted); font-style: italic;
  padding: 8px 0 4px;
}

@keyframes mood-entry-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════
   QUICK-MOOD FLOATING WIDGET (Planner + Budget only)
═══════════════════════════════════════════════════════════════════ */
.quick-mood-fab {
  position: fixed;
  /* Lift above the iPhone home indicator */
  bottom: calc(20px + env(safe-area-inset-bottom));
  right: calc(20px + env(safe-area-inset-right));
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--violet));
  color: white; border: none;
  font-size: 1.5rem; cursor: pointer;
  box-shadow: 0 10px 26px rgba(167, 139, 250, 0.4);
  z-index: 400;
  display: none;
  align-items: center; justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: fab-in 0.4s ease;
}
.quick-mood-fab.visible { display: flex; }
.quick-mood-fab:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 14px 32px rgba(167, 139, 250, 0.5); }

@keyframes fab-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.quick-mood-popover {
  position: fixed;
  bottom: calc(86px + env(safe-area-inset-bottom));
  right: calc(20px + env(safe-area-inset-right));
  background: var(--surface);
  border-radius: 20px;
  padding: 14px 16px;
  box-shadow: 0 16px 40px rgba(167, 139, 250, 0.28);
  z-index: 401;
  display: none;
  min-width: 280px;
  animation: popover-in 0.22s ease;
}
.quick-mood-popover.open { display: block; }
.quick-mood-title { font-size: 0.82rem; font-weight: 800; color: var(--text2); margin-bottom: 10px; letter-spacing: 0.5px; text-transform: uppercase; }
.quick-mood-faces { display: flex; gap: 4px; justify-content: space-between; margin-bottom: 10px; }
.quick-mood-face {
  font-size: 1.8rem; background: var(--bg-1); border: 2px solid transparent;
  border-radius: 14px; padding: 8px 10px; cursor: pointer;
  transition: transform 0.12s ease;
  flex: 1;
}
.quick-mood-face:hover { transform: scale(1.08); border-color: var(--pink); }
.quick-mood-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 8px; border-top: 1px dashed var(--border);
}
.quick-mood-more-btn {
  background: transparent; border: none; color: var(--violet-d);
  font-family: inherit; font-size: 0.82rem; font-weight: 700; cursor: pointer;
  padding: 4px 8px; border-radius: 8px;
}
.quick-mood-more-btn:hover { background: var(--bg-1); }
.quick-mood-close {
  background: transparent; border: none; color: var(--muted);
  font-size: 1rem; cursor: pointer; padding: 4px 8px;
}

@keyframes popover-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 500px) {
  .quick-mood-fab { width: 52px; height: 52px; bottom: calc(16px + env(safe-area-inset-bottom)); right: calc(16px + env(safe-area-inset-right)); }
  .quick-mood-popover { bottom: calc(80px + env(safe-area-inset-bottom)); right: calc(12px + env(safe-area-inset-right)); left: calc(12px + env(safe-area-inset-left)); min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .mood-entry, .quick-mood-fab, .quick-mood-popover { animation: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════
   PULSE HIGHLIGHT — fired when an entry is targeted via snippet click
═══════════════════════════════════════════════════════════════════ */
.mood-entry.mood-entry-pulse {
  animation: mood-entry-pulse 2.1s ease;
  box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.0), var(--shadow);
}
@keyframes mood-entry-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(255, 107, 157, 0.0), var(--shadow); background: var(--surface); }
  12%  { box-shadow: 0 0 0 4px rgba(255, 107, 157, 0.45), var(--shadow); background: rgba(255, 107, 157, 0.08); }
  55%  { box-shadow: 0 0 0 6px rgba(255, 107, 157, 0.15), var(--shadow); background: rgba(255, 107, 157, 0.04); }
  100% { box-shadow: 0 0 0 0   rgba(255, 107, 157, 0.0), var(--shadow); background: var(--surface); }
}
@media (prefers-reduced-motion: reduce) {
  .mood-entry.mood-entry-pulse {
    animation: none !important;
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.3), var(--shadow) !important;
    transition: box-shadow 1.5s ease;
  }
}
