/* ═══════════════════════════════════════════════════
   PHANTOM ZENITH ORIGIN — FIELD REFERENCE PAGE STYLES
   assets/css/pages/field-reference.css
   ─────────────────────────────────────────────────
   Depends on: tokens.css, base.css, topbar.css

   Covers all styles unique to field-reference/index.html.
   Shared chrome is in base.css / topbar.css.

   Component inventory:
     - #root container
     - .container
     - Category navigation grid (.cat-grid-wrap,
       .cat-section, .cat-tile, .cat-glyph, .cat-label)
     - Access Denied placeholder (.access-denied + children)
     - Expandable cards (.card, .card-header, .card-body,
       .card-icon, .card-title, .card-subtitle, .chevron)
     - Dossier sections (.dossier-section, .section-label)
     - Body text, tag pills, trait rows, callout blocks
     - Entry animation (.card-animate)
     - Typewriter cursor (.typewriter-line, .typewriter-cursor)
     - Page-level entrance animations
   ═══════════════════════════════════════════════════ */

/* ─── REACT ROOT ─── */
#root { position: relative; z-index: 1; }

/* ─── LAYOUT ─── */
.container { width: 100%; }

/* ─── CATEGORY NAVIGATION GRID ─── */
/* Top-of-page pill/tile navigation that filters the card list. */
.cat-grid-wrap {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 10px 6px;
  margin-bottom: 28px;
}

.cat-section {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 6px;
}

.cat-section:last-child { margin-bottom: 0; }

.cat-section-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan-dim);
  padding: 12px 4px 6px;
  border-top: 1px solid var(--border-dim);
  margin-top: 4px;
}

/* First label has no top border — it's flush with the container edge */
.cat-section:first-child .cat-section-label {
  border-top: none;
  margin-top: 0;
  padding-top: 2px;
}

.cat-tile-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}

/* Individual category tiles — icon + label stacked vertically */
.cat-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 110px;
  padding: 14px 8px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-align: center;
  overflow: hidden;
  flex-shrink: 0;
}

/* Bottom accent bar shown when active */
.cat-tile::after {
  content: '';
  position: absolute;
  bottom: 0; left: 10%; right: 10%;
  height: 2px;
  border-radius: 2px 2px 0 0;
  opacity: 0;
  transition: opacity 0.15s;
}

.cat-tile:hover {
  background: var(--bg-surface);
  border-color: var(--border-dim);
}

.cat-tile:hover .cat-glyph,
.cat-tile:hover .cat-label { color: var(--text-hi); }

.cat-tile.active { background: var(--bg-surface); }
.cat-tile.active::after { opacity: 1; }

/* Glow effect on active tile's icon */
.cat-tile.active .cat-glyph {
  filter: drop-shadow(0 0 6px var(--c-accent, var(--cyan)));
}

.cat-glyph {
  font-size: 1.2rem;
  line-height: 1;
  color: var(--text-lo);
  transition: color 0.15s, filter 0.15s;
  font-family: var(--mono);
}

.cat-label {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-lo);
  transition: color 0.15s;
  line-height: 1.2;
}

@media (max-width: 500px) {
  .cat-tile  { width: 88px; padding: 12px 4px 10px; }
  .cat-label { font-size: 0.6rem; }
}

/* ─── ACCESS DENIED PLACEHOLDER ─── */
/* Red-themed locked content panel for unimplemented categories. */
.access-denied {
  border: 1px solid rgba(248, 113, 113, 0.25);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(61, 13, 13, 0.6) 0%, rgba(15, 25, 35, 0.9) 60%);
  padding: 40px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Diagonal stripe texture inside denied panel */
.access-denied::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent, transparent 8px,
    rgba(248, 113, 113, 0.03) 8px, rgba(248, 113, 113, 0.03) 9px
  );
  pointer-events: none;
}

.access-denied-icon {
  font-family: var(--mono);
  font-size: 2rem;
  color: var(--red-dim);
  display: block;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 12px rgba(248, 113, 113, 0.6));
  animation: redpulse 2.5s ease-in-out infinite;
}

@keyframes redpulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

@keyframes badgeFadeIn {
  0%   { opacity: 0; transform: translateY(32px); box-shadow: none; }
  100% { opacity: 1; transform: translateY(0);    box-shadow: 0 0 12px rgba(248, 113, 113, 0.35); }
}

.access-denied-code {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red-dim);
  margin-bottom: 10px;
  opacity: 0.7;
}

.access-denied-title {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red-dim);
  margin-bottom: 12px;
  text-shadow: 0 0 20px rgba(248, 113, 113, 0.5);
}

.access-denied-body {
  font-size: 0.84rem;
  color: var(--text-mid);
  line-height: 1.7;
  max-width: 480px;
  margin: 0 auto 20px;
  text-align: left;
}

.access-denied-log {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--red-dim);
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 4px;
  padding: 6px 14px;
  text-transform: uppercase;
}

/* ─── EXPANDABLE CARDS ─── */
/* Each entry in the field reference is a collapsible card. */
.card {
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.18s;
}

.card:hover { border-color: var(--border); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  cursor: pointer;
  user-select: none;
  gap: 12px;
  flex-wrap: wrap;
}

.card-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.card-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.card-header-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

@media (max-width: 480px) {
  .card-header         { padding: 12px 14px; }
  .card-header-right   { width: 100%; justify-content: space-between; }
  .card-header-tags    { justify-content: flex-start; flex: 1; }
}

.card-icon {
  width: 38px; height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.card-title    { font-size: 1rem; font-weight: 600; color: var(--text-hi); }
.card-subtitle { font-size: 0.75rem; color: var(--text-lo); margin-top: 2px; font-family: var(--mono); }

/* Expand/collapse chevron arrow */
.chevron      { color: var(--text-lo); font-size: 0.75rem; transition: transform 0.2s; flex-shrink: 0; }
.chevron.open { transform: rotate(180deg); }

.card-body {
  padding: 0 22px 22px 22px;
  border-top: 1px solid var(--border-dim);
}

/* ─── DOSSIER SECTIONS (inside expanded card) ─── */
.dossier-section { margin-top: 18px; }

.dossier-section + .dossier-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-dim);
}

/* Small-caps eyebrow label above a data group */
.section-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-lo);
  margin-bottom: 10px;
  font-family: var(--mono);
}

/* ─── BODY TEXT ─── */
.body-text              { font-size: 0.87rem; line-height: 1.75; color: var(--text-mid); }
.body-text + .body-text { margin-top: 10px; }

/* ─── TAG PILLS ─── */
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 2px; }

.tag {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: 0.02em;
  font-family: var(--mono);
}

/* Tag color variants — one per color key for easy composition */
.tag.cyan    { background: #0e3a47; color: var(--cyan); border: 1px solid #164f63; }
.tag.purple  { background: #2d1b69; color: #a78bfa; border: 1px solid #3d2882; }
.tag.orange  { background: #3d1f00; color: #fb923c; border: 1px solid #6b3200; }
.tag.green   { background: #0d2b1a; color: #4ade80; border: 1px solid #134d28; }
.tag.red     { background: #3d0d0d; color: var(--red-dim); border: 1px solid #6b1414; }
.tag.gray    { background: #1a2535; color: var(--text-lo); border: 1px solid var(--border-dim); }
.tag.fuchsia { background: #3d0d3a; color: var(--fuchsia); border: 1px solid #6b1464; }
.tag.yellow  { background: #2a2000; color: #fde047; border: 1px solid #5a4500; }
.tag.white   { background: #1e2430; color: var(--text-hi); border: 1px solid #8899aa; }
.tag.tan     { background: #2a1f10; color: #c4a882; border: 1px solid #7a5c38; }

/* ─── TRAIT ROWS ─── */
/* Two-column key–value layout inside a dossier section. */
.trait-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
  font-size: 0.86rem;
}

.trait-key {
  color: var(--text-lo);
  min-width: 120px;
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
}

.trait-val { color: var(--text-mid); line-height: 1.5; }

/* ─── CALLOUT BLOCKS ─── */
/* Left-bordered highlight boxes for notes, warnings, or rules. */
.callout {
  background: var(--bg-deep);
  border: 1px solid var(--border-dim);
  border-left: 3px solid;
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 0.84rem;
  line-height: 1.7;
  color: var(--text-mid);
  margin-top: 10px;
}

.callout.cyan   { border-left-color: var(--cyan); }
.callout.purple { border-left-color: #a78bfa; }
.callout.orange { border-left-color: #fb923c; }
.callout.red    { border-left-color: var(--red-dim); }
.callout.green   { border-left-color: #4ade80; }
.callout.fuchsia { border-left-color: var(--fuchsia); }
.callout.gray     { border-left-color: #94a3b8; }
.callout.yellow   { border-left-color: #facc15; }

.callout.restricted {
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-left-width: 1px;
  background: rgba(248, 113, 113, 0.06);
  color: var(--red-dim);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  animation: redpulse 2.5s ease-in-out infinite;
}

/* ─── STAT HEXAGON ─── */
/* SVG radar chart showing L1 vs L20 attribute spread for a Runner Type. */
.stat-hex-wrap {
  display: flex;
  justify-content: center;
  padding: 4px 0 8px;
}

.stat-hexagon {
  width: 100%;
  max-width: 280px;
  height: auto;
}

@media (max-width: 480px) {
  .stat-hexagon { max-width: 240px; }
}

/* ─── MISC ─── */
.stage-num { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; font-family: var(--mono); }
.empty     { text-align: center; color: var(--text-lo); padding: 48px 0; font-size: 0.9rem; font-family: var(--mono); }

@media (max-width: 600px) {
  .card-header { padding: 14px 16px; }
  .card-body   { padding: 0 16px 16px 16px; }
  .trait-key   { min-width: 90px; }
}

/* ─── COLLAPSIBLE GROUP HEADERS ─── */
/* Faction-aligned group bars for categories with grouped entries.
   The .fr-group container IS the card — border wraps header + entries. */
.fr-group {
  margin-bottom: 10px;
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.18s;
}

.fr-group-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  cursor: pointer;
  user-select: none;
  transition: background 0.18s;
}

.fr-group-header:hover {
  background: var(--bg-surface);
}

.fr-group-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  flex-shrink: 0;
}

.fr-group-text {
  flex: 1;
  min-width: 0;
}

.fr-group-label {
  font-family: var(--mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-hi);
  letter-spacing: 0.02em;
}

.fr-group-hint {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-lo);
  margin-top: 2px;
  letter-spacing: 0.04em;
}

.fr-group-chevron {
  color: var(--text-lo);
  font-size: 0.75rem;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.fr-group-chevron.open {
  transform: rotate(180deg);
}

.fr-group-entries {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border-dim);
}

@media (max-width: 480px) {
  .fr-group-header { padding: 14px 16px; gap: 10px; }
  .fr-group-icon   { width: 26px; height: 26px; }
  .fr-group-label  { font-size: 0.8rem; }
}

/* ─── SUBCATEGORY TAB BAR ─── */
/* Horizontal tab bar for categories with subcategories (Equipment). */
/* Pattern mirrors .ops-tool-menu / .ops-tool-tab from operations.css. */
.fr-subcat-bar {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  margin-bottom: 20px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  flex-wrap: wrap;
}

.fr-subcat-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  position: relative;
  overflow: hidden;
}

.fr-subcat-tab:hover {
  background: var(--bg-surface);
  border-color: var(--border-dim);
}

.fr-subcat-tab:hover .fr-subcat-glyph,
.fr-subcat-tab:hover .fr-subcat-label {
  color: var(--text-hi);
}

.fr-subcat-tab.active {
  background: var(--bg-surface);
  border-color: var(--border);
}

.fr-subcat-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 12%;
  right: 12%;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--c-accent, var(--orange));
}

.fr-subcat-tab.active .fr-subcat-glyph {
  color: var(--c-accent, var(--orange));
  filter: drop-shadow(0 0 6px var(--c-accent, var(--orange)));
}

.fr-subcat-tab.active .fr-subcat-label {
  color: var(--c-accent, var(--orange));
}

.fr-subcat-glyph {
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text-lo);
  transition: color 0.15s, filter 0.15s;
  font-family: var(--mono);
}

.fr-subcat-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-lo);
  transition: color 0.15s;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .fr-subcat-tab   { padding: 10px 14px; gap: 8px; }
  .fr-subcat-label { font-size: 0.66rem; }
}

/* ─── CARD STAGGER ENTRY ANIMATION ─── */
/* Applied by JS to each card as the list renders. */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-animate {
  opacity: 0;
  animation: cardIn 0.28s ease forwards;
}

/* ─── TYPEWRITER CURSOR ─── */
/* Used in the access-denied panel's animated log message. */
.typewriter-line {
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}

.typewriter-cursor {
  display: inline-block;
  width: 1ch;
  background: var(--red-dim);
  animation: blink 0.7s step-end infinite;
  margin-left: 1px;
  vertical-align: middle;
  height: 1.1em;
  position: relative;
  top: -1px;
}

.typewriter-cursor.teal { background: var(--cyan); }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ─── PAGE ENTRANCE ANIMATIONS ─── */
/* fadeUp keyframe defined in base.css */
.page-header         { animation: fadeUp 0.5s ease both; }
.construction-banner { animation: fadeUp 0.5s 0.1s ease both; }
#root                { animation: fadeUp 0.5s 0.2s ease both; }
