/* ============================================================
   TEAM LOG — JSON-backed running record
   Search toolbar, status legend, status/tag chips, bullet feed,
   week dividers, load-error and empty states.
   Depends on base.css for tokens, page bar, masthead, tags, footer.
   ============================================================ */

/* Overrides to establish Ceramic body canvas and Cream pagebar */
body {
  background-color: var(--canvas-soft) !important; /* Ceramic #edebe9 */
}

.pagebar {
  background: var(--canvas) !important; /* Cream #f2f0eb */
}

/* ──────────  MASTHEAD  ────────── */

.masthead {
  padding: 64px 0 40px;
  text-align: center;
}

.dek {
  max-width: 620px;
  color: var(--body);
}


/* ──────────  TOOLBAR (search + legend)  ────────── */

.toolbar {
  position: sticky;
  top: 64px;
  z-index: 99;
  background: var(--canvas-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  padding: 16px 0;
  margin-bottom: 24px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.search-wrap {
  flex: 1 1 280px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 40px;
  border: 1px solid var(--hairline-strong);
  border-radius: 8px; /* rounded.md */
  font-family: "Inter", sans-serif;
  font-size: 15px;
  background: var(--surface-card);
  color: var(--ink);
  transition: border 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}

.search-input::placeholder {
  color: var(--muted-soft);
}

.search-input:focus {
  outline: none;
  border: 2px solid var(--green-accent);
  padding: 11px 15px 11px 39px;
  box-shadow: 0 0 0 4px rgba(0, 117, 74, 0.15);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-soft);
  pointer-events: none;
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  color: var(--muted);
}

.legend-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 8px;
}

.status {
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 16px; /* Increased padding for higher readability */
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  line-height: 1.1;
  transition: all 0.2s var(--ease-out);
}

.legend .status {
  cursor: pointer;
  outline: none;
}

.legend .status:hover {
  transform: translateY(-1px);
}

.legend .status:active {
  transform: var(--press);
}

.toolbar-right {
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

/* ──────────  STATUS + TAG CHIPS  ────────── */

/* Active and Hover Fill States for Status Buttons */
.status-done {
  color: var(--status-done);
  background: rgba(0, 98, 65, 0.08);
  border: 1px solid rgba(0, 98, 65, 0.15);
}
.status-done.active, .status-done:hover {
  background: var(--status-done) !important;
  color: var(--on-primary) !important;
  border-color: var(--status-done) !important;
  box-shadow: 0 2px 4px rgba(0, 98, 65, 0.2);
}

.status-in-progress {
  color: var(--status-progress);
  background: rgba(138, 90, 14, 0.08);
  border: 1px solid rgba(138, 90, 14, 0.15);
}
.status-in-progress.active, .status-in-progress:hover {
  background: var(--status-progress) !important;
  color: var(--on-primary) !important;
  border-color: var(--status-progress) !important;
  box-shadow: 0 2px 4px rgba(138, 90, 14, 0.2);
}

.status-blocked {
  color: var(--status-blocked);
  background: rgba(176, 26, 16, 0.08);
  border: 1px solid rgba(176, 26, 16, 0.15);
}
.status-blocked.active, .status-blocked:hover {
  background: var(--status-blocked) !important;
  color: var(--on-primary) !important;
  border-color: var(--status-blocked) !important;
  box-shadow: 0 2px 4px rgba(176, 26, 16, 0.2);
}

.status-planned {
  color: var(--status-planned);
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.10);
}
.status-planned.active, .status-planned:hover {
  background: #5a626a !important; /* Solid accessible gray to prevent background bleed-through */
  color: var(--on-primary) !important;
  border-color: #5a626a !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Bullet feed tags */
.tag {
  font-size: 13px;
  padding: 4px 12px;
  letter-spacing: 0.01em;
  background: var(--canvas); /* Cream */
  border: 1px solid var(--hairline-strong);
  transition: all 0.2s var(--ease-out);
}

.tag:hover {
  background: var(--green-accent);
  color: var(--on-primary);
  border-color: var(--green-accent);
  transform: translateY(-1px);
}

/* Handwritten Barista Cup Name Tag */
.tag-person {
  font-family: "Kalam", "Comic Sans MS", cursive;
  font-size: 14px;
  font-weight: 700;
  background: var(--canvas-soft); /* Ceramic */
  color: var(--green-house);
  border: 1px dashed var(--green-starbucks);
  padding: 3px 10px;
}

.tag-person:hover {
  background: var(--green-starbucks);
  color: var(--on-primary);
  border-color: var(--green-starbucks);
}

/* ──────────  LOG (bullet feed)  ────────── */

.log {
  padding: 0 0 64px;
}

.week-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 48px 0 20px;
  font-family: "Lora", "Iowan Old Style", Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--green-starbucks);
  letter-spacing: -0.01em;
}

.week-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hairline-strong);
  opacity: 0.8;
}

.week-divider:first-child {
  margin-top: 16px;
}

.bullet {
  background: var(--surface-card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  padding: 28px 32px;
  margin-bottom: 16px;
  border-left: 4px solid transparent;
  transition: border-color 0.3s var(--ease-out),
              box-shadow 0.3s var(--ease-out),
              transform 0.3s var(--ease-out);
  overflow: hidden; /* keeps left border aligned inside card radius */
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bullet:hover {
  border-color: var(--hairline-strong);
  box-shadow: var(--shadow-lift);
  transform: translateY(-1px);
}

.bullet[data-status="done"]        { border-left-color: var(--status-done); }
.bullet[data-status="in-progress"] { border-left-color: var(--status-progress); }
.bullet[data-status="blocked"]     { border-left-color: var(--status-blocked); }
.bullet[data-status="planned"]     { border-left-color: var(--hairline-strong); }

.bullet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.bullet .date {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.bullet-text {
  font-family: "Inter", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--body);
  white-space: pre-wrap;
  margin: 0;
  letter-spacing: -0.01em;
  max-width: 680px; /* highly readable line-length */
}

/* ──────────  ENTRY BODY: headline · points · the long version  ──────────

   Long entries lead with a headline and a short list of points; the full
   prose sits collapsed underneath. Older entries carry only `text` and
   still render as the single paragraph above.
   ──────────────────────────────────────────────────────────────────── */

.bullet-headline {
  font-family: "Lora", "Iowan Old Style", Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--green-house);
  margin: 0;
  max-width: 46ch;
  text-wrap: balance;
}

.bullet-headline + .bullet-points {
  margin-top: -4px;
}

.bullet-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  max-width: 680px;
}

.bullet-points li {
  position: relative;
  padding-left: 22px;
  font-family: "Inter", sans-serif;
  font-size: 15.5px;
  line-height: 1.6;
  letter-spacing: -0.005em;
  color: var(--body);
}

.bullet-points li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green-accent);
}

/* Inline code — identifiers, fields, query params */
.bullet code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.86em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-strong);
  color: var(--green-house);
  white-space: nowrap;
}

/* The long version — progressive disclosure for the full prose */
.bullet-more {
  margin: 0;
}

.bullet-more > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
  padding: 4px 2px;
  border-radius: 6px;
  transition: color 0.25s var(--ease-out);
}

.bullet-more > summary::-webkit-details-marker {
  display: none;
}

.bullet-more > summary:hover {
  color: var(--green-accent);
}

.bullet-more > summary:focus-visible {
  outline: 2px solid var(--green-accent);
  outline-offset: 3px;
}

.bullet-more .caret {
  flex: none;
  transition: transform 0.3s var(--ease-out);
}

.bullet-more[open] > summary .caret {
  transform: rotate(90deg);
}

.bullet-more .bullet-text {
  margin-top: 14px;
  padding-left: 18px;
  border-left: 1px solid var(--hairline-strong);
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--muted);
}

.bullet-more[open] .bullet-text {
  animation: bullet-unfold 0.4s var(--ease-out) both;
}

@keyframes bullet-unfold {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bullet-more .caret,
  .bullet-more[open] .bullet-text {
    transition: none;
    animation: none;
  }
}

/* Card Footer: Reorganized Metadata */
.bullet-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  margin-top: 4px;
}

.bullet-footer-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.bullet-footer-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* Handwritten Barista Author Signatures */
.bullet-author {
  font-family: "Kalam", "Comic Sans MS", cursive;
  font-size: 16px;
  font-weight: 700;
  color: var(--green-accent);
  background: transparent;
  padding: 2px 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}

mark {
  background: rgba(0, 117, 74, 0.12);
  color: var(--ink);
  padding: 0 4px;
  border-radius: 4px;
}

/* ──────────  LOAD ERROR  ────────── */

.load-error {
  background: rgba(176, 26, 16, 0.05);
  border: 1px dashed rgba(176, 26, 16, 0.20);
  border-radius: 12px;
  padding: 32px;
  margin-top: 24px;
  color: var(--status-blocked);
}

.load-error-title {
  font-family: "Lora", serif;
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--status-blocked);
}

.load-error-detail {
  font-family: "Inter", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--body);
  margin: 0;
}

/* ──────────  EMPTY STATE  ────────── */

.empty-state {
  display: none;
  padding: 96px 0;
  text-align: center;
  color: var(--muted);
  font-family: "Lora", "Iowan Old Style", Georgia, serif;
  font-size: 18px;
}

.empty-state.show {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.empty-state p {
  margin: 0;
  font-style: italic;
}

.empty-cup {
  font-size: 56px;
  line-height: 1;
  opacity: 0.45;
  animation: cupFloat 3s ease-in-out infinite;
  user-select: none;
}

@keyframes cupFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Gold status pill for search results count */
.result-count {
  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #cba258; /* Gold */
  border: 1.5px solid #cba258;
  border-radius: 50px;
  padding: 4px 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: transparent;
  display: inline-block;
}

/* ──────────  FOOTER (House Green & Gold)  ────────── */

.footer {
  background: var(--green-house);
  color: rgba(255, 255, 255, 0.70);
  padding: 64px 0;
  text-align: center;
  border-top: none;
  width: 100%;
  margin-top: 64px;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 32px;
}

.footer p {
  color: rgba(255, 255, 255, 0.70);
  font-family: "Inter", sans-serif;
  font-size: 14px;
  letter-spacing: 0.05em;
  margin: 0;
}

.footer .gold-star {
  color: #cba258; /* Gold */
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ──────────  BARISTA FLOATING BUTTON (DESIGN.md Frap Signature)  ────────── */

.barista-btn {
  position: fixed;
  right: 24px;
  bottom: 96px; /* stack nicely above the back-to-top button which sits at 24px */
  z-index: 198;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: var(--green-starbucks);
  color: #ffffff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 0 6px rgba(0,0,0,0.24), 0 8px 12px rgba(0,0,0,0.14);
  transition: all 0.2s var(--ease-out);
  outline: none;
}

.barista-btn span {
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
}

.barista-btn:hover {
  background: var(--green-accent);
  transform: scale(1.05);
  box-shadow: 0 0 6px rgba(0,0,0,0.24), 0 10px 18px rgba(0,0,0,0.18);
}

.barista-btn:active {
  transform: scale(0.95);
  box-shadow: 0 0 6px rgba(0,0,0,0.24), 0 8px 12px rgba(0,0,0,0);
}

/* ──────────  BARISTA DRAWER (Slide-out panel overlay)  ────────── */

.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.barista-drawer {
  position: fixed;
  top: 0;
  right: -460px; /* slide out view initially */
  width: 440px;
  max-width: 90vw;
  height: 100vh;
  background: var(--canvas); /* warm cream canvas */
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: right 0.3s var(--ease-out);
}

.barista-drawer.open {
  right: 0;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  background: var(--surface-card);
  border-bottom: 1px solid var(--rule);
}

.drawer-header h2 {
  font-family: "Lora", serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--green-starbucks);
  margin: 0;
}

.drawer-close {
  background: transparent;
  border: none;
  font-size: 28px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease;
  line-height: 1;
}

.drawer-close:hover {
  color: var(--status-blocked);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

/* ──────────  FORM DESIGN ELEMENTS  ────────── */

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

.section-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}

.field-hint {
  display: block;
  font-size: 11px;
  color: var(--muted-soft);
  margin-top: 4px;
  font-style: italic;
}

.input-wrap {
  position: relative;
  margin-top: 8px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  background: var(--surface-card);
  color: var(--ink);
  outline: none;
  transition: all 0.25s var(--ease-out);
}

.form-input:focus {
  border-color: var(--green-accent);
  box-shadow: 0 0 0 4px rgba(0, 117, 74, 0.12);
}

textarea.form-input {
  resize: vertical;
}

/* Floating Label CSS rules */
.floating-label {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--muted-soft);
  pointer-events: none;
  transition: all 0.2s var(--ease-out);
}

textarea.form-input + .floating-label {
  top: 20px;
  transform: none;
}

.form-input:focus ~ .floating-label,
.form-input:not(:placeholder-shown) ~ .floating-label {
  top: 0;
  left: 12px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-card);
  padding: 0 6px;
  color: var(--green-accent);
  transform: translateY(-50%);
}

/* Radio status buttons selectors */
.status-option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.status-radio-label {
  cursor: pointer;
}

.status-radio-label input {
  display: none;
}

.status-radio-pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid var(--hairline-strong);
  background: var(--surface-card);
  color: var(--muted);
  transition: all 0.2s var(--ease-out);
}

.status-radio-pill:hover {
  transform: translateY(-1px);
}

/* Radio active fill states on check */
.status-radio-label input:checked + .status-radio-pill.status-done {
  background: var(--status-done) !important;
  color: #ffffff !important;
  border-color: var(--status-done) !important;
  box-shadow: 0 2px 4px rgba(0, 98, 65, 0.2);
}

.status-radio-label input:checked + .status-radio-pill.status-in-progress {
  background: var(--status-progress) !important;
  color: #ffffff !important;
  border-color: var(--status-progress) !important;
  box-shadow: 0 2px 4px rgba(138, 90, 14, 0.2);
}

.status-radio-label input:checked + .status-radio-pill.status-blocked {
  background: var(--status-blocked) !important;
  color: #ffffff !important;
  border-color: var(--status-blocked) !important;
  box-shadow: 0 2px 4px rgba(176, 26, 16, 0.2);
}

.status-radio-label input:checked + .status-radio-pill.status-planned {
  background: var(--status-planned) !important;
  color: #ffffff !important;
  border-color: var(--status-planned) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Dynamic code block outputs */
.json-preview-container {
  background: var(--green-house); /* House Green Espresso */
  border-radius: 8px;
  padding: 16px;
  overflow: auto; /* scroll in both directions if code is long */
  max-height: 180px; /* keep container compact to prevent drawer spillage */
  margin-top: 8px;
  border: 1px solid var(--hairline-strong);
}

.json-preview-container pre {
  margin: 0;
}

.json-preview-container code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  white-space: pre;
}

/* Button UI Components */
.drawer-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  padding-bottom: 24px;
}

.btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 50px; /* full pill */
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  outline: none;
  border: 1.5px solid transparent;
  letter-spacing: 0.01em;
  text-align: center;
  box-sizing: border-box;
}

.btn:active {
  transform: scale(0.95);
}

.btn-filled {
  background: var(--green-accent);
  color: #ffffff;
}

.btn-filled:hover {
  background: var(--green-starbucks);
  box-shadow: 0 2px 8px rgba(0, 98, 65, 0.2);
}

.btn-outlined {
  background: transparent;
  border-color: var(--green-accent);
  color: var(--green-accent);
}

.btn-outlined:hover {
  background: rgba(0, 117, 74, 0.05);
}

.btn.success {
  background: var(--status-done) !important;
  border-color: var(--status-done) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(0, 98, 65, 0.2);
}

/* ──────────  RESPONSIVE  ────────── */

@media (max-width: 768px) {
  .masthead {
    padding: 48px 0 24px;
  }

  .dashboard-card {
    flex-direction: column;
    padding: 24px;
    gap: 24px;
  }

  .dashboard-left {
    padding-right: 0;
  }

  .dashboard-right {
    justify-content: flex-start;
  }

  .dashboard-stats {
    width: 100%;
    justify-content: space-between;
  }

  .stat-box {
    flex: 1;
    min-width: 0;
    padding: 12px 8px;
  }

  .toolbar {
    position: relative; /* flow naturally on mobile to maximize viewport height */
    top: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 12px 0;
  }

  .legend {
    justify-content: flex-start;
    gap: 6px;
  }

  .toolbar-right {
    align-items: stretch;
  }
  
  .result-count {
    text-align: center;
    margin-top: 4px;
  }

  .bullet {
    padding: 20px 24px;
  }

  .bullet-headline {
    font-size: 19px;
    max-width: none;
  }

  .bullet-points li {
    font-size: 15px;
    padding-left: 18px;
  }

  .bullet-points li::before {
    left: 2px;
  }

  .bullet code {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .bullet-more .bullet-text {
    padding-left: 14px;
    font-size: 15px;
  }
  
  .bullet-meta {
    gap: 8px;
  }
  
  .bullet-author {
    margin-left: 0;
    width: 100%;
    margin-top: 4px;
    padding-left: 0;
  }

  .barista-drawer {
    width: 100%;
    max-width: 100%;
    right: -100%;
  }

  .barista-btn {
    bottom: 84px;
    right: 16px;
  }
}
