/* ═══════════════════════════════════════════════════
   Luminwell — Calendar Entry View
   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;
  --teal-deep:  #1d6e55;
  --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;
  --font-d:     "Fraunces", Georgia, 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, h3 { margin: 0; }

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

/* ══════════════════════════════════════════════════
   SIDEBAR  (identical across all calendar pages)
══════════════════════════════════════════════════ */
.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; }

/* ══════════════════════════════════════════════════
   ENTRY VIEW PAGE
══════════════════════════════════════════════════ */
.view-page {
  flex: 1;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  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; }

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

/* Card header — gradient banner */
.entry-card__head {
  padding: 28px 32px;
  background: linear-gradient(135deg, var(--sb-deep) 0%, var(--sb-bg) 100%);
  color: #fff;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.entry-card__head--session {
  background: linear-gradient(135deg, var(--teal-deep) 0%, var(--teal) 100%);
}

.entry-card__head-left { display: flex; flex-direction: column; gap: 6px; }

.entry-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  align-self: flex-start;
}
.entry-type-badge svg { width: 11px; height: 11px; }

.entry-card__title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.entry-card__date {
  font-size: 13px;
  font-weight: 500;
  opacity: .78;
}

.entry-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,.22);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.entry-avatar svg { width: 26px; height: 26px; }

/* Card body */
.entry-card__body {
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Mood row */
.mood-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--page-bg);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.mood-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.mood-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.mood-badge--low   { background: rgba(248,113,113,.12); color: #b91c1c; }
.mood-badge--okay  { background: rgba(245,158,11,.12);  color: #92400e; }
.mood-badge--good  { background: rgba(59,130,246,.12);  color: #1d4ed8; }
.mood-badge--great { background: rgba(16,185,129,.12);  color: #065f46; }

/* Journal text */
.journal-text {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Session info box */
.session-box {
  padding: 16px 18px;
  background: var(--teal-pale);
  border: 1px solid rgba(45,150,118,.18);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.session-box__heading {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--teal-deep);
}
.session-meta-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.session-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--teal-deep);
}
.session-meta-item svg { width: 14px; height: 14px; flex-shrink: 0; opacity: .75; }

/* Card footer */
.entry-card__foot {
  padding: 18px 32px;
  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: 999px;
  border: 1px solid var(--border);
  background: var(--page-bg);
}
.privacy-badge svg { width: 11px; height: 11px; }

.entry-card__actions { display: flex; gap: 8px; margin-left: auto; }

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

.btn-delete {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 10px;
  border: 1.5px solid rgba(239,68,68,.2);
  background: rgba(239,68,68,.05);
  color: #dc2626;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background .14s, border-color .14s;
  text-decoration: none;
}
.btn-delete:hover { background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.35); }
.btn-delete svg { width: 14px; height: 14px; }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 760px) {
  .view-page { padding: 20px 16px; }
  .entry-card__head, .entry-card__body, .entry-card__foot { padding: 20px; }
  .entry-card__title { font-size: 20px; }
  .entry-card__actions { margin-left: 0; }
}
@media (max-width: 520px) {
  .sidebar { display: none; }
}
