/* missions.css — Phase 47 mission HUD styles (slim).
 *
 * Mission-specific accordion + row styling for the left column's
 * MISSIONS section. The SHARED accordion pattern (inner flex, log
 * section flex-share, custom scrollbars, body show/hide) lives in
 * column-accordions.css — read that file first if you're touching
 * the accordion behavior.
 *
 * This file owns ONLY:
 *   - .apex-missions-section (container + expanded sizing)
 *   - .apex-missions-section__head (the clickable header strip)
 *   - .apex-missions-section__body (the body + native scrollbar)
 *   - .apex-missions__list / .apex-missions__empty
 *   - .apex-mission row chrome (header, title, pill, body, accept)
 *   - .apex-mission-toast (completion notification toast) */

/* ── Section container ───────────────────────────────────────────
 * Full-width edge-to-edge (margin pulls past the inner's 10px
 * horizontal padding). Header always visible; body shows when
 * data-expanded="true" via the rules below. */

.apex-missions-section {
  flex: 0 0 auto;            /* default: just the header height */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: 8px -10px 0;
  border-top: 1px solid rgba(120, 150, 175, 0.18);
}
.apex-missions-section[data-expanded="true"] {
  flex: 1 1 0;               /* equal share with siblings — see column-accordions.css */
  min-height: 0;
}

/* ── Header button (always visible) ──────────────────────────────
 * Mirrors the keybindings sticky's .kbs-head sizing (30px tall, 12px
 * text, uppercase, 0.05em tracking) so all column-bottom controls
 * read as one family. */

.apex-missions-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 30px;
  box-sizing: border-box;
  padding: 0 10px;
  margin: 0;
  width: 100%;
  background: rgba(20, 28, 40, 0.6);
  border: 0;
  border-bottom: 1px solid rgba(120, 150, 175, 0.25);
  color: rgba(220, 235, 250, 0.85);
  font-size: 12px;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  user-select: none;
}
.apex-missions-section__head:hover {
  background: rgba(28, 38, 52, 0.7);
}
.apex-missions__label {
  font-weight: 600;
  color: rgba(220, 235, 250, 0.95);
  flex: 1 1 auto;
  text-align: left;
}
.apex-missions__badge {
  background: rgba(77, 208, 197, 0.18);
  border: 1px solid rgba(77, 208, 197, 0.55);
  color: #a4ecdf;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 10px;
  letter-spacing: 0.05em;
}
.apex-missions__chev {
  opacity: 0.6;
  font-size: 11px;
  width: 12px;
  text-align: center;
}

/* ── Body (hidden when collapsed, scroll when expanded) ──────────
 * Native thin teal-grey scrollbar (Firefox + Chromium) when the
 * mission list overflows the section's flex-share. */

.apex-missions-section__body {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 10px 8px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 150, 175, 0.45) transparent;
}
.apex-missions-section[data-expanded="true"] .apex-missions-section__body {
  display: block;
}
.apex-missions-section__body::-webkit-scrollbar         { width: 6px; }
.apex-missions-section__body::-webkit-scrollbar-track   { background: transparent; }
.apex-missions-section__body::-webkit-scrollbar-thumb   { background: rgba(120, 150, 175, 0.4); border-radius: 3px; }
.apex-missions-section__body::-webkit-scrollbar-thumb:hover { background: rgba(120, 150, 175, 0.65); }

/* Mission list container inside the body. */
.apex-missions__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.apex-missions__empty {
  opacity: 0.55;
  font-style: italic;
  font-size: 12px;
  padding: 6px 2px;
  color: #d8e2ee;
}

/* ── Mission row ─────────────────────────────────────────────────
 * Each mission renders as a clickable row with a state pill and an
 * expandable body showing Setup / Goal / Success. Border-left color
 * encodes the mission state. */

.apex-mission {
  background: rgba(22, 30, 42, 0.65);
  border-left: 2px solid rgba(77, 208, 197, 0.65);
  border-radius: 2px;
}
.apex-mission[data-state="available"]   { border-left-color: rgba(245, 176, 86, 0.85); }
.apex-mission[data-state="accepted"]    { border-left-color: rgba(112, 191, 255, 0.85); }
.apex-mission[data-state="in_progress"] { border-left-color: rgba(77, 208, 197, 0.85); }

.apex-mission__header {
  appearance: none;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  text-align: left;
  cursor: pointer;
}
.apex-mission__header:hover { background: rgba(255, 255, 255, 0.04); }

.apex-mission__title {
  flex: 1 1 auto;
  font-weight: 600;
  color: #e6f7f5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.apex-mission__pill {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(120, 150, 175, 0.18);
  border: 1px solid rgba(120, 150, 175, 0.4);
}
.apex-mission__pill--available   { background: rgba(245, 176, 86, 0.18); border-color: rgba(245, 176, 86, 0.55); color: #f8d59c; }
.apex-mission__pill--accepted    { background: rgba(112, 191, 255, 0.16); border-color: rgba(112, 191, 255, 0.5);  color: #b9d8f5; }
.apex-mission__pill--in_progress { background: rgba(77, 208, 197, 0.18); border-color: rgba(77, 208, 197, 0.55); color: #a4ecdf; }

.apex-mission .apex-mission__chev {
  opacity: 0.55;
  font-size: 10px;
}

.apex-mission__body {
  padding: 4px 10px 9px 12px;
  border-top: 1px solid rgba(120, 150, 175, 0.18);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.apex-mission__row {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  font-size: 11px;
  line-height: 1.4;
}
.apex-mission__lbl {
  flex: 0 0 56px;
  color: rgba(120, 150, 175, 0.85);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
}
.apex-mission__val {
  flex: 1 1 auto;
  color: #d8e2ee;
}

.apex-mission__accept {
  margin-top: 6px;
  align-self: flex-start;
  background: rgba(77, 208, 197, 0.2);
  border: 1px solid rgba(77, 208, 197, 0.6);
  color: #d3f5ee;
  padding: 4px 10px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
}
.apex-mission__accept:hover {
  background: rgba(77, 208, 197, 0.32);
}

/* ── Completion toast — center-top, fades in/out ─────────────────
 * Fired by hud-missions.js when a mission flips from in_progress
 * to completed. Lives at document.body level so the section's
 * overflow:hidden can't clip it. */

.apex-mission-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translate(-50%, -8px);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 18px;
  background: rgba(15, 17, 23, 0.95);
  border: 1px solid rgba(77, 208, 197, 0.7);
  border-radius: 4px;
  color: #e6f7f5;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 320ms ease-out, transform 320ms ease-out;
  pointer-events: none;
}
.apex-mission-toast--on {
  opacity: 1;
  transform: translate(-50%, 0);
}
.apex-mission-toast__lbl {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10px;
  color: rgba(164, 236, 223, 0.95);
}
.apex-mission-toast__title {
  font-size: 13px;
  font-weight: 600;
}
