/* right-column-thin.css — Phase 195 (2026-07-16, Maurice).
 *
 * Thin / minimized mode for the right column (#hud-right-panel). A header
 * minimize button flips #hud-right-panel[data-thin="true"] (see
 * hud-right-column-thin.js). Distinct from the full-collapse
 * (data-collapsed, width 0) owned by hud.js — thin mode keeps the column
 * present as a scannable rail of per-event colored ticks.
 *
 * Owns ONLY the [data-thin="true"] rail styling + the minimize button
 * chrome + the hover drawer chrome. The normal (full) layout is untouched
 * and lives in hud-side-panels.css / log-panel-style siblings.
 */

/* ── Player Actions header → silhouette icon + "History" label ────── */
/* The whole header is the toggle (no separate button — Maurice). */
#hud-right-panel .apex-actions-section .hud-side-panel-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
}
#hud-right-panel .apex-actions-section .hud-side-panel-heading::after {
  display: none;            /* drop the left-aligned accent underline */
}
.apex-rc-hicon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(220, 235, 250, 0.9);
}
.apex-rc-hicon svg { display: block; width: 24px; height: 24px; }
.apex-rc-hlabel {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(220, 235, 250, 0.9);
}

/* Move the right column up to the top — the space above it was a remnant of
   an older UI that had a widget there (now empty). Override the shared inner
   top padding for the right panel only. Phase 195 rev (Maurice). */
#hud-right-panel .hud-side-panel-inner {
  padding-top: 10px;
}

/* ── Bottom icon dock (Glossary + Keybindings stand-ins) ──────────── */

.apex-rc-dock { display: none; }
#hud-right-panel[data-thin="true"] .apex-rc-dock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: auto;            /* sink to the bottom of the rail */
  padding: 10px 0 6px;
  border-top: 1px solid rgba(120, 150, 175, 0.22);
}
.apex-rc-dockbtn {
  width: 30px;
  height: 30px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(120, 150, 175, 0.35);
  border-radius: 6px;
  background: rgba(20, 28, 40, 0.6);
  color: rgba(210, 228, 245, 0.9);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.apex-rc-dockbtn:hover {
  background: rgba(40, 84, 120, 0.55);
  color: #fff;
}
.apex-rc-dockbtn svg {
  display: block;
  width: 19px;
  height: 19px;
}

/* ── Match REP/POP badge height to the SOL / event blocks (42px) ──── */
/* The badges live in the #apexRepToasts overlay outside the panel, so this
   is scoped via the body.apex-rc-thin hook set by hud-right-column-thin.js.
   box-sizing:border-box makes 42px the OUTER height so it lines up with the
   rail blocks; flex-centering keeps the REP label + delta centered. */
body.apex-rc-thin .apex-rep-badge {
  height: 42px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* hud-rep-toasts anchors each badge at row.top + 2px; cancel that 2px so
     the badge's top edge lines up exactly with its SOL / event block. */
  transform: translateY(-2px);
}

/* ── Rail width when thin (animated by .hud-side-panel width transition) ── */

#hud-right-panel[data-thin="true"] {
  /* Phase 195 rev (Maurice): a touch wider so the tick icons have breathing room. */
  width: var(--apex-rightcol-thin-w, 46px);
}
#hud-right-panel[data-thin="true"] .hud-side-panel-inner {
  min-width: 0;
  padding-left: 0;
  padding-right: 0;
  overflow-x: hidden;
}

/* Hide the real Glossary + Keybindings panels in thin mode. They mount INTO
   their sections as #apexGlossarySticky / #apexKeybindingsSticky, and the
   accordion framework sets their display via !important — so a plain
   display:none loses the specificity battle (the headers were showing cut
   off). Target the panels by id + !important, and collapse the now-empty
   section wrappers too. The bottom icon dock stands in for them. */
#hud-right-panel[data-thin="true"] #apexGlossarySticky,
#hud-right-panel[data-thin="true"] #apexKeybindingsSticky {
  display: none !important;
}
#hud-right-panel[data-thin="true"] .apex-glossary-section,
#hud-right-panel[data-thin="true"] .apex-keybindings-section {
  display: none !important;
}

/* ── Thin header: icon becomes a full-width portrait chip, label hidden ── */

#hud-right-panel[data-thin="true"] .apex-actions-section .hud-side-panel-heading {
  padding: 4px 3px;
  min-height: 44px;
  overflow: hidden;
}
#hud-right-panel[data-thin="true"] .apex-rc-hlabel {
  display: none;
}
#hud-right-panel[data-thin="true"] .apex-rc-hicon {
  width: 100%;
  height: 38px;
  border: 1px solid rgba(120, 150, 175, 0.5);
  border-radius: 6px;
  background: rgba(20, 28, 40, 0.6);
}
#hud-right-panel[data-thin="true"] .apex-rc-hicon svg {
  width: 26px;
  height: 26px;
}

/* ── Event feed → stacked colored ticks ───────────────────────────── */

#hud-right-panel[data-thin="true"] .apex-actions-body {
  gap: 4px;
  padding-right: 0;
  align-items: stretch;
}
#hud-right-panel[data-thin="true"] .apex-actions-body .empty {
  font-size: 0;              /* hide "No actions yet" text in the rail */
}

/* Each event collapses to a short segment. Phase 195 rev (Maurice): the tick's
   left border reads in the CURRENT PLAYER's color (identity), while the icon
   carries the base color (which base). Overrides the per-kind border colors
   from hud-player-actions-styles.js in the rail (id selector out-specifies). */
#hud-right-panel[data-thin="true"] .apex-action {
  flex: 0 0 auto;
  /* Tall enough for a full REP/POP badge (~40px stacked) to render
     without overlapping the next row's badge. Phase 195 rev (Maurice). */
  min-height: 42px;
  height: 42px;
  padding: 0;
  gap: 0;
  border-left-width: 2px;
  border-left-color: var(--apex-player-color, rgba(245, 176, 86, 0.7)) !important;
  border-radius: 0 2px 2px 0;
  background: rgba(20, 28, 40, 0.4);
  overflow: hidden;
  cursor: pointer;
}
/* Hide all row text in thin mode (title, meta, building pill). */
#hud-right-panel[data-thin="true"] .apex-action > * {
  display: none;
}

/* ── Per-kind type icon (thin rail only) ──────────────────────────── */
/* Hidden in the full layout; in the rail it becomes the tick's glyph so
   the event type reads at a glance (route, buildings, repair, …). The
   `> .apex-action__ticon` selector out-specifies the "hide all children"
   rule above. Phase 195 rev (Maurice). */
.apex-action__ticon { display: none; }
#hud-right-panel[data-thin="true"] .apex-action > .apex-action__ticon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  /* currentColor for the inline structure glyphs (ApexShapes svgShape). */
  color: rgba(220, 235, 250, 0.92);
}
#hud-right-panel[data-thin="true"] .apex-action > .apex-action__ticon img {
  display: block;
  width: 18px;
  height: 18px;
  opacity: 0.9;
}
#hud-right-panel[data-thin="true"] .apex-action > .apex-action__ticon svg {
  display: block;
  width: 20px;
  height: 20px;
}
/* Ticks that already convey their type another way get no icon: end-of-Sol
   ticks show "SOL n", and REP/POP rows carry a floating badge over the tick. */
#hud-right-panel[data-thin="true"] .apex-action[data-kind="sol_advanced"] > .apex-action__ticon,
#hud-right-panel[data-thin="true"] .apex-action[data-rep] > .apex-action__ticon,
#hud-right-panel[data-thin="true"] .apex-action[data-pop] > .apex-action__ticon {
  display: none;
}
#hud-right-panel[data-thin="true"] .apex-action:hover {
  background: rgba(40, 84, 120, 0.5);
}
/* the "you" ::before marker is noise in the rail */
#hud-right-panel[data-thin="true"] .apex-action--mine .apex-action__title::before {
  content: none;
}

/* ── End-of-Sol ticks: taller + a tiny S<n> label ────────────────── */

#hud-right-panel[data-thin="true"] .apex-action[data-kind="sol_advanced"] {
  height: 42px;
  display: flex;
  flex-direction: column;      /* "SOL" over the number */
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 0;
  background: rgba(245, 176, 86, 0.14);
}
/* Line 1: the word SOL (small). */
#hud-right-panel[data-thin="true"] .apex-action[data-kind="sol_advanced"]::before {
  content: "SOL";
  font: 700 8px/1 system-ui, sans-serif;
  letter-spacing: 0.1em;
  color: rgba(250, 205, 150, 0.82);
}
/* Line 2: the Sol number (larger). */
#hud-right-panel[data-thin="true"] .apex-action[data-kind="sol_advanced"]::after {
  content: attr(data-sol);
  font: 800 14px/1 system-ui, sans-serif;
  color: rgba(250, 205, 150, 0.98);
}
/* Older rows without data-sol still show the SOL label (no number). */
#hud-right-panel[data-thin="true"] .apex-action[data-kind="sol_advanced"]:not([data-sol])::after {
  content: "";
}

/* ── Hover drawer (built by hud-right-column-thin.js) ─────────────── */

.apex-thin-drawer {
  position: fixed;
  z-index: 60;                 /* above panel (35) + rep badges */
  max-width: 260px;
  min-width: 120px;
  padding: 8px 11px;
  border-radius: 6px;
  border: 1px solid rgba(120, 150, 175, 0.4);
  border-left: 3px solid rgba(245, 176, 86, 0.9);
  background: rgba(14, 20, 30, 0.96);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.5);
  color: #e6f1fb;
  font: 12px/1.35 system-ui, -apple-system, "Segoe UI", sans-serif;
  pointer-events: none;        /* never steals hover — closes on mouse-out */
  opacity: 0;
  transform: translateX(6px);
  transition: opacity .12s ease, transform .12s ease;
}
.apex-thin-drawer.is-open {
  opacity: 1;
  transform: translateX(0);
}
.apex-thin-drawer__title {
  font-weight: 700;
  color: #eafaf8;
  margin-bottom: 3px;
}
.apex-thin-drawer__meta {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(150, 178, 200, 0.9);
}
