/* ─────────────────────────────────────────────────────────
   gr-workstation.css — Phase 3.3 G3
   Workstation chrome: signal feed, tab strip, theater module
   scaffold, utility row, mobile breakpoint behavior.
   Variable namespace: --workstation-*
   ───────────────────────────────────────────────────────── */

:root {
  --workstation-signal-feed-height: 350px;
  --workstation-tab-height: 44px;
  --workstation-utility-tile-min-height: 88px;
  --workstation-padding-x: 52px;
  --workstation-tab-pulse-duration: 2.4s;
  --brand-gold: #c9a14a;
}


/* ─── Section labels ────────────────────────────────────── */

.workstation-section-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--cyan-dim);
  padding: 24px var(--workstation-padding-x) 12px;
}


/* ─── Workstation signal feed ───────────────────────────── */

.workstation-signal-feed {
  background: var(--navy-1);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.workstation-signal-feed > [data-signal-feed] {
  max-height: var(--workstation-signal-feed-height);
  overflow-y: auto;
  padding: 0 var(--workstation-padding-x) 24px;
}

.workstation-signal-feed > [data-signal-feed]::-webkit-scrollbar {
  width: 8px;
}
.workstation-signal-feed > [data-signal-feed]::-webkit-scrollbar-track {
  background: var(--navy-0);
}
.workstation-signal-feed > [data-signal-feed]::-webkit-scrollbar-thumb {
  background: var(--border);
}
.workstation-signal-feed > [data-signal-feed]::-webkit-scrollbar-thumb:hover {
  background: var(--border-lt);
}

/* Loading-state placeholder (re-added per G2 obligation).
   Used by signals.js while it fetches /data/signals.json, and by
   per-theater Live Signal Wires on theater pages. */
.gr-signal-empty {
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  text-align: center;
  padding: 28px 20px;
  border: 1px dashed var(--border);
  margin: 8px 0;
}


/* ─── Theater map container ─────────────────────────────── */

.workstation-map {
  background: var(--navy-0);
  border-bottom: 1px solid var(--border);
}

.workstation-map #hero-map {
  padding: 0 var(--workstation-padding-x) 24px;
}


/* ─── Tab strip ─────────────────────────────────────────── */

.workstation-tabs {
  display: flex;
  align-items: stretch;
  background: var(--navy-1);
  border-bottom: 1px solid var(--border);
}

.workstation-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--workstation-tab-height);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  text-decoration: none;
  border-right: 1px solid var(--border);
  background: var(--navy-1);
  cursor: pointer;
  transition: color 0.18s, background 0.18s;
}

.workstation-tab:last-child {
  border-right: none;
}

/* Hover only on non-active, non-disabled tabs */
.workstation-tab:not(.active):not(.disabled):hover {
  color: var(--cyan);
  background: var(--navy-2);
}

/* Active tab: lit + slowly pulsing per architecture §2.4 */
.workstation-tab.active {
  color: var(--cyan-dim);
  background: var(--navy-0);
  cursor: default;
  position: relative;
  animation: workstation-tab-pulse var(--workstation-tab-pulse-duration) ease-in-out infinite;
}

.workstation-tab.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--cyan);
}

@keyframes workstation-tab-pulse {
  0%, 100% { color: var(--cyan-dim); }
  50%      { color: var(--cyan); }
}

@media (prefers-reduced-motion: reduce) {
  .workstation-tab.active {
    animation: none;
  }
}

/* Disabled tab (Hybrid Warfare in Phase 3.3) */
.workstation-tab.disabled {
  color: var(--text-3);
  opacity: 0.4;
  cursor: not-allowed;
}


/* ─── Theater module scaffold ──────────────────────────── */

.theater-module {
  background: var(--navy-1);
  border-bottom: 1px solid var(--border);
  padding: 32px var(--workstation-padding-x);
}

.theater-module[hidden] {
  display: none;
}


/* ─── Bottom utility row ───────────────────────────────── */

.workstation-utility-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
}

.utility-tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: var(--workstation-utility-tile-min-height);
  padding: 20px 32px;
  background: var(--navy-0);
  text-decoration: none;
  color: inherit;
  transition: background 0.18s;
}

.utility-tile:hover {
  background: var(--navy-2);
}

.utility-tile-label {
  display: block;
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-1);
  margin-bottom: 4px;
}

.utility-tile-descriptor {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.06em;
}


/* ─── Mobile breakpoint ────────────────────────────────── */

@media (max-width: 767px) {
  .workstation-map,
  .workstation-tabs,
  .theater-module,
  .workstation-utility-row {
    display: none;
  }

  .workstation-section-label {
    padding: 20px 28px 10px;
  }

  .workstation-signal-feed > [data-signal-feed] {
    padding: 0 28px 20px;
    max-height: 60vh;
  }
}


/* ─── Motto band (between nav and workstation) ──────────── */

.motto-band {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-3);
  padding: 8px var(--workstation-padding-x);
  border-bottom: 1px solid var(--border-dim);
}

@media (max-width: 767px) {
  .motto-band {
    padding: 8px 28px;
    font-size: 10px;
  }
}


/* ─── Counter-to-map hover coupling ──────────────────────
   When a status counter is hovered, boost the matching theaters'
   glow on the map. Uses :has() at the .hero parent level and
   targets descendant SVG groups with matching data-status. */

.hero:has(.hero-counter[data-tier="critical"]:hover) #hero-map svg g[data-theater][data-status="crit"] > path,
.hero:has(.hero-counter[data-tier="critical"]:hover) #hero-map svg g[data-theater][data-status="crit"] > g[data-feature-type="countries"] > path {
  filter: drop-shadow(0 0 16px var(--status-crit-lt));
  animation: none;
}

.hero:has(.hero-counter[data-tier="elevated"]:hover) #hero-map svg g[data-theater][data-status="elevated"] > path,
.hero:has(.hero-counter[data-tier="elevated"]:hover) #hero-map svg g[data-theater][data-status="elevated"] > g[data-feature-type="countries"] > path {
  filter: drop-shadow(0 0 16px var(--status-elev-lt));
}

.hero:has(.hero-counter[data-tier="watch"]:hover) #hero-map svg g[data-theater][data-status="watch"] > path,
.hero:has(.hero-counter[data-tier="watch"]:hover) #hero-map svg g[data-theater][data-status="watch"] > g[data-feature-type="countries"] > path {
  filter: drop-shadow(0 0 16px var(--status-watch-lt));
}


/* ─── Section label inline-flex layout (icon adjacency) ── */

.workstation-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
}


/* ─── Signal-tower icon ──────────────────────────────────
   Inline SVG glyph adjacent to the // SIGNAL FEED label.
   Three concentric arcs pulse outward in staggered sequence
   (inner first, outer last). currentColor inherits the
   label's --cyan-dim. */

.signal-tower-icon {
  color: var(--brand-gold);
  flex-shrink: 0;
}

@keyframes signal-pulse {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 1; }
}

.signal-tower-icon .signal-arc-1 { animation: signal-pulse 2s ease-in-out infinite; }
.signal-tower-icon .signal-arc-2 { animation: signal-pulse 2s ease-in-out infinite 0.4s; }
.signal-tower-icon .signal-arc-3 { animation: signal-pulse 2s ease-in-out infinite 0.8s; }

@media (prefers-reduced-motion: reduce) {
  .signal-tower-icon .signal-arc-1,
  .signal-tower-icon .signal-arc-2,
  .signal-tower-icon .signal-arc-3 {
    animation: none;
    opacity: 1;
  }
}


/* ─── Theater module (G4) ────────────────────────────────
   Populated by /assets/js/theater-module.js on map click.
   Container styling (background, padding, border-bottom)
   defined earlier; inner content classes here. */

.theater-module-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.theater-module-status {
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid;
  border-radius: 1px;
}

.theater-module-status[data-status="crit"]     { color: var(--status-crit-lt);  border-color: var(--status-crit-lt); }
.theater-module-status[data-status="elevated"] { color: var(--status-elev-lt);  border-color: var(--status-elev-lt); }
.theater-module-status[data-status="watch"]    { color: var(--status-watch-lt); border-color: var(--status-watch-lt); }

.theater-module-title {
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-1);
  margin: 0;
  line-height: 1;
}

.theater-module-positioning {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
  max-width: 720px;
  margin-bottom: 24px;
}

.theater-module-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-dim);
}

.theater-module-meta-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.theater-module-meta-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}

.theater-module-meta-value {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.55;
}

.theater-module-signals {
  margin-bottom: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-dim);
}

.theater-module-section-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--cyan-dim);
  margin-bottom: 12px;
}

.theater-module-reports {
  margin-bottom: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-dim);
}

.theater-module-reports .theater-module-section-label {
  margin-top: 16px;
}

.theater-module-reports .theater-module-section-label:first-child {
  margin-top: 0;
}

.theater-module-report {
  display: block;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  text-decoration: none;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-dim);
  transition: color 0.15s;
}

.theater-module-report:hover {
  color: var(--cyan);
}

.theater-module-supplementary {
  list-style: none;
  margin: 0;
  padding: 0;
}

.theater-module-supplementary li {
  border-bottom: 1px solid var(--border-dim);
}

.theater-module-supplementary a {
  display: block;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-2);
  text-decoration: none;
  padding: 8px 0;
  transition: color 0.15s;
}

.theater-module-supplementary a:hover {
  color: var(--cyan);
}

.theater-module-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-dim);
  flex-wrap: wrap;
}

.theater-module-cta {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
  text-decoration: none;
  transition: color 0.15s;
}

.theater-module-cta:hover {
  color: var(--text-1);
}

.theater-module-updated {
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.10em;
  color: var(--text-3);
  font-style: italic;
}

.theater-module-error {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  padding: 24px;
}


/* ─── Theater hover tooltip (G4) ────────────────────────
   Single element appended to <body> by theater-module.js,
   positioned via cursor coordinates with 12px offset. */

.theater-tooltip {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  background: var(--navy-0);
  border: 1px solid var(--border-lt);
  padding: 8px 12px;
  font-family: var(--font-body);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 140px;
}

.theater-tooltip[hidden] {
  display: none;
}

.theater-tooltip-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: 0.04em;
}

.theater-tooltip-status {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}

.theater-tooltip[data-status="crit"]     .theater-tooltip-status { color: var(--status-crit-lt); }
.theater-tooltip[data-status="elevated"] .theater-tooltip-status { color: var(--status-elev-lt); }
.theater-tooltip[data-status="watch"]    .theater-tooltip-status { color: var(--status-watch-lt); }
