/* ═══════════════════════════════════════════════════
   Luminwell — Add New Journal Entry
   Pure CSS, no JavaScript
═══════════════════════════════════════════════════ */

/* ── Tokens ───────────────────────────────────────── */
:root {
  --sb-bg:      #175d92;
  --sb-deep:    #134a75;
  --sb-hover:   rgba(255,255,255,.1);
  --sb-active:  rgba(255,255,255,.18);
  --sb-line:    rgba(255,255,255,.12);
  --sb-text:    #f4f8fc;
  --sb-muted:   rgba(244,248,252,.58);

  --page-bg:    #f8f9fb;
  --surface:    #ffffff;
  --teal:       #2d9676;
  --teal-pale:  #eaf5f1;
  --text:       #0c1929;
  --muted:      #64748b;
  --soft:       #94a3b8;
  --border:     rgba(12,25,41,.09);
  --shadow:     0 1px 3px rgba(12,25,41,.05), 0 8px 28px rgba(12,25,41,.06);
  --r:          12px;
  --r-full:     9999px;
  --sb-width:   268px;
  --font:       "DM Sans", system-ui, -apple-system, sans-serif;
}

/* ── Reset ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
}
a    { color: inherit; text-decoration: none; }
p    { margin: 0; }
h1, h2 { margin: 0; }

/* ── App shell ────────────────────────────────────── */
.app {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ══════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════ */
.sidebar {
  width: var(--sb-width);
  flex-shrink: 0;
  background: var(--sb-bg);
  color: var(--sb-text);
  display: flex;
  flex-direction: column;
  padding: 16px 14px 14px;
  overflow: hidden;
}
.sidebar__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 18px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--sb-line);
}
.sidebar__logo-img { width: 30px; height: 30px; object-fit: contain; flex-shrink: 0; border-radius: 6px; }
.sidebar__logo     { font-size: 11px; font-weight: 700; letter-spacing: .18em; flex: 1; min-width: 0; }

.sidebar__block       { margin-bottom: 18px; }
.sidebar__block--fill { flex: 1; display: flex; flex-direction: column; min-height: 0; margin-bottom: 0; }
.sidebar__label       { padding: 0 8px 8px; font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--sb-muted); }

.sidebar__new {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; height: 36px; padding: 0 12px;
  border: 1px solid rgba(255,255,255,.22); border-radius: 10px;
  background: rgba(255,255,255,.06); color: var(--sb-text);
  font-size: 13px; font-weight: 600; font-family: var(--font);
  cursor: pointer; transition: background .15s, border-color .15s;
}
.sidebar__new:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.3); }
.sidebar__new svg { width: 16px; height: 16px; flex-shrink: 0; }

.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.sb-nav__link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  color: var(--sb-text); font-size: 13px; font-weight: 500;
  transition: background .15s;
}
.sb-nav__link:hover    { background: var(--sb-hover); }
.sb-nav__link.is-active { background: var(--sb-active); box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); }
.sb-nav__icon { width: 17px; height: 17px; flex-shrink: 0; opacity: .92; }

.sb-recent { flex: 1; min-height: 60px; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; margin: 0 -2px; padding: 0 2px 4px; }
.sb-recent__btn { width: 100%; padding: 8px 10px; border: none; border-radius: 8px; background: transparent; color: inherit; cursor: pointer; text-align: left; font-family: var(--font); transition: background .15s; }
.sb-recent__btn:hover { background: var(--sb-hover); }
.sb-recent__title { font-size: 12px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sb-recent__meta  { font-size: 11px; color: var(--sb-muted); margin-top: 2px; }

.sidebar__foot {
  padding-top: 12px; margin-top: auto;
  border-top: 1px solid var(--sb-line);
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.sidebar__avatar { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar__avatar svg { width: 17px; height: 17px; }
.sidebar__who     { flex: 1; min-width: 0; }
.sidebar__name    { font-size: 13px; font-weight: 700; }
.sidebar__credits { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--sb-muted); margin-top: 1px; }
.sidebar__credits svg { width: 12px; height: 12px; }

/* ══════════════════════════════════════════════════
   MAIN + TOPBAR
══════════════════════════════════════════════════ */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 56px; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border-bottom: 1px solid var(--border);
  flex-shrink: 0; gap: 12px;
}
.topbar__left  { display: flex; align-items: center; gap: 10px; }
.topbar__logo-img { width: 30px; height: 30px; object-fit: contain; border-radius: 6px; }
.topbar__title { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.topbar__right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.topbar__crisis { padding: 5px 12px; border-radius: var(--r-full); background: rgba(239,68,68,.09); color: #b91c1c; font-size: 12px; font-weight: 700; transition: background .15s; }
.topbar__crisis:hover { background: rgba(239,68,68,.16); }
.topbar__icon-btn { width: 34px; height: 34px; border-radius: 8px; border: none; background: transparent; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s; }
.topbar__icon-btn:hover { background: rgba(12,25,41,.05); color: var(--text); }
.topbar__icon-btn svg { width: 18px; height: 18px; }

/* ══════════════════════════════════════════════════
   ADD ENTRY PAGE
══════════════════════════════════════════════════ */
.add-page {
  flex: 1;
  padding: 32px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.breadcrumb a { color: var(--muted); transition: color .15s; }
.breadcrumb a:hover { color: var(--sb-bg); }
.breadcrumb svg { width: 14px; height: 14px; flex-shrink: 0; }
.breadcrumb__sep { opacity: .4; }

/* Form card */
.add-card {
  width: 100%;
  max-width: 640px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Card header */
.add-card__head {
  padding: 24px 28px;
  background: linear-gradient(135deg, var(--sb-deep) 0%, var(--sb-bg) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
}
.add-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.add-card__icon svg { width: 22px; height: 22px; }
.add-card__head-text { display: flex; flex-direction: column; gap: 3px; }
.add-card__title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.add-card__subtitle { font-size: 13px; opacity: .75; font-weight: 500; }

/* Form body */
.add-card__body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.form-field { display: flex; flex-direction: column; gap: 7px; }

.form-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

.form-label span {
  font-weight: 500;
  color: var(--soft);
  text-transform: none;
  letter-spacing: 0;
}

.form-input {
  width: 100%;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  background: var(--page-bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  transition: border-color .14s, box-shadow .14s, background .14s;
}
.form-input:focus {
  outline: none;
  border-color: var(--sb-bg);
  box-shadow: 0 0 0 3px rgba(23,93,146,.12);
  background: #fff;
}

.form-input--date {
  color: var(--muted);
  font-size: 14px;
  cursor: default;
  background: rgba(12,25,41,.03);
}

.form-textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  font-weight: 400;
  color: var(--text);
  background: var(--page-bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 13px 14px;
  min-height: 180px;
  resize: vertical;
  transition: border-color .14s, box-shadow .14s, background .14s;
}
.form-textarea:focus {
  outline: none;
  border-color: var(--sb-bg);
  box-shadow: 0 0 0 3px rgba(23,93,146,.12);
  background: #fff;
}
.form-textarea::placeholder { color: var(--soft); }
.form-input::placeholder     { color: var(--soft); }

/* Mood picker — CSS-only radio pills */
.mood-radio { display: none; }

.mood-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mood-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--border);
  background: var(--page-bg);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all .14s;
  user-select: none;
}
.mood-pill:hover {
  border-color: var(--sb-bg);
  color: var(--sb-bg);
}

/* Active pill — uses :has() or adjacent sibling */
.mood-radio:checked + .mood-pill {
  border-color: var(--sb-bg);
  background: rgba(23,93,146,.08);
  color: var(--sb-bg);
}

/* Prompt tip */
.prompt-tip {
  padding: 14px 16px;
  background: #eff6ff;
  border: 1px solid rgba(59,130,246,.18);
  border-radius: 10px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.prompt-tip__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #3b82f6;
  margin-top: 1px;
}
.prompt-tip__text {
  font-size: 13px;
  font-weight: 500;
  color: #1d4ed8;
  line-height: 1.55;
}
.prompt-tip__text strong { font-weight: 700; }

/* Privacy note */
.privacy-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--soft);
}
.privacy-note svg { width: 13px; height: 13px; flex-shrink: 0; }

/* Card footer */
.add-card__foot {
  padding: 18px 28px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--soft);
  padding: 4px 10px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--page-bg);
}
.privacy-badge svg { width: 11px; height: 11px; }

.form-actions { display: flex; gap: 8px; margin-left: auto; }

.btn-cancel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background .14s, color .14s;
  text-decoration: none;
}
.btn-cancel:hover { background: rgba(12,25,41,.04); color: var(--text); }

.btn-save {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: 10px;
  border: none;
  background: var(--sb-bg);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background .14s, box-shadow .14s;
  text-decoration: none;
}
.btn-save:hover { background: var(--sb-deep); box-shadow: 0 4px 14px rgba(23,93,146,.35); }
.btn-save svg { width: 15px; height: 15px; }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 760px) {
  .add-page { padding: 20px 16px; }
  .add-card__head, .add-card__body, .add-card__foot { padding: 20px; }
  .form-actions { margin-left: 0; }
}
@media (max-width: 520px) {
  .sidebar { display: none; }
}
