/*
 * Athena Display System — Shared Styles
 * Dark dashboard theme adapted from Marked 2 style.
 * Owner: Archimedes. Consumers: all display views.
 * Colors: bg #1a1a2e, gold #f0c040, slate blue #8eaadc, green #a8d8a8
 */

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary: #1a1a2e;
  --bg-card: #16213e;
  --bg-card-hover: #1a2847;
  --bg-badge: #0d1b0d;
  --text-primary: #e0e0e0;
  --text-secondary: #c8c8d8;
  --text-muted: #a0a0b8;
  --text-dim: #707088;
  --gold: #f0c040;
  --gold-dim: #f0c04050;
  --white: #ffffff;
  --blue: #8eaadc;
  --blue-dim: #8eaadc40;
  --green: #a8d8a8;
  --green-bg: #0d1b0d;
  --green-border: #a8d8a830;
  --link: #6ea8fe;
  --red: #e06060;
  --orange: #e8a040;
  --border-subtle: #ffffff10;
  --border-light: #ffffff15;
  --radius: 6px;
  --radius-lg: 10px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  padding: 0;
  margin: 0;
  min-height: 100vh;
}

/* === Layout Container === */
.display-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px;
}

/* === Header === */
.display-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 2px solid var(--gold-dim);
  padding-bottom: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 8px;
}

.display-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.02em;
}

.display-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.display-meta {
  font-size: 11px;
  color: var(--text-dim);
}

/* === Section Headers === */
.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
  margin-top: 28px;
  margin-bottom: 12px;
  letter-spacing: 0.01em;
}

.section-subtitle {
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
  margin-top: 20px;
  margin-bottom: 8px;
}

/* === Cards === */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 12px;
  transition: background-color 0.15s;
}

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

.card-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.card-row .card {
  flex: 1;
  min-width: 280px;
  margin-bottom: 0;
}

/* === Tables === */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 16px 0;
  font-size: 13px;
}

thead th {
  background-color: var(--bg-card);
  color: var(--blue);
  font-weight: 600;
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid var(--blue-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: top;
}

tbody tr:nth-child(even) {
  background-color: #16213e30;
}

tbody tr:hover {
  background-color: #16213e80;
}

/* === Badges / Tags === */
.badge {
  display: inline-block;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.badge-des { background: #2d1f4e; color: #c4a0ff; border: 1px solid #c4a0ff30; }
.badge-bld { background: #0d1b2e; color: #6ea8fe; border: 1px solid #6ea8fe30; }
.badge-exp { background: #1b2e0d; color: #a8d8a8; border: 1px solid #a8d8a830; }
.badge-cap { background: #2e2a0d; color: #f0c040; border: 1px solid #f0c04030; }
.badge-ver { background: #2e0d0d; color: #e06060; border: 1px solid #e0606030; }
.badge-org { background: #0d2e2a; color: #60e0c0; border: 1px solid #60e0c030; }
.badge-rev { background: #2e1a0d; color: #e8a040; border: 1px solid #e8a04030; }

.badge-s { background: #1a2e1a; color: #80c080; }
.badge-m { background: #2e2a1a; color: #c0b060; }
.badge-l { background: #2e1a1a; color: #c08080; }

.badge-status-active { background: #0d2e0d; color: #60e060; border: 1px solid #60e06030; }
.badge-status-waiting { background: #2e2e0d; color: #e0c040; border: 1px solid #e0c04030; }
.badge-status-preop { background: #2e1a0d; color: #e08040; border: 1px solid #e0804030; }
.badge-status-parked { background: #1a1a2e; color: #8080a0; border: 1px solid #8080a030; }

/* === Progress / Health Indicators === */
.health-bar {
  height: 6px;
  background: var(--border-subtle);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}

.health-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}

.health-good { background: var(--green); }
.health-warn { background: var(--orange); }
.health-alert { background: var(--red); }

/* === Stat blocks === */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-block {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 12px 16px;
  text-align: center;
}

.stat-number {
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.2;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.stat-sublabel {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* === Dual Vocabulary === */
.dual-vocab {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}

.kurt-term {
  color: var(--white);
  font-weight: 600;
}

.claude-term {
  color: var(--blue);
  font-size: 12px;
  font-family: "SF Mono", "Fira Code", monospace;
  opacity: 0.8;
}

/* === Sticky Top Nav === */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  gap: 6px;
  padding: 10px 24px;
  margin: 0 -24px 16px -24px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* === Nav bar (bottom) === */
.display-nav {
  display: flex;
  gap: 8px;
  padding: 12px 0;
  margin-top: 28px;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.nav-link {
  display: inline-block;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  transition: all 0.15s;
}

.nav-link:hover, .nav-link.active {
  color: var(--gold);
  border-color: var(--gold-dim);
  background: #f0c04010;
}

/* === Responsive === */

/*
 * === Device-Adaptive Content Visibility ===
 * Use these classes to show/hide content per device.
 * Plain language: "desktop-only" means it only appears on the big screen.
 * Technical: CSS breakpoint-driven display toggling.
 *
 * Classes:
 *   .desktop-only     — visible on desktop (>1024px), hidden on tablet/phone
 *   .tablet-up        — visible on tablet+ (>768px), hidden on phone
 *   .phone-only       — visible on phone only (<=430px)
 *   .phone-hide       — hidden on phone, visible everywhere else
 *   .phone-compact    — on phone: smaller text, tighter spacing
 */
.phone-only { display: none; }

/* iPad landscape */
@media (max-width: 1024px) {
  .display-container { padding: 16px 20px; }
  .top-nav { padding: 10px 20px; margin: 0 -20px 16px -20px; }
  .card-row .card { min-width: 240px; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .desktop-only { display: none !important; }
}

/* iPad portrait / small tablets */
@media (max-width: 768px) {
  .display-container { padding: 14px 16px; }
  .top-nav { padding: 8px 16px; margin: 0 -16px 12px -16px; }
  .display-title { font-size: 18px; }
  .section-title { font-size: 15px; }
  .card-row { flex-direction: column; }
  .card-row .card { min-width: unset; }
  table { font-size: 12px; }
  thead th { padding: 6px 8px; font-size: 10px; }
  tbody td { padding: 6px 8px; }
  .stat-number { font-size: 24px; }
  .tablet-up { display: none !important; }
}

/* iPhone */
@media (max-width: 430px) {
  .display-container { padding: 12px 12px; }
  .top-nav { padding: 8px 12px; margin: 0 -12px 10px -12px; gap: 4px; }
  .top-nav .nav-link { font-size: 11px; padding: 4px 8px; }
  .display-header { flex-direction: column; gap: 4px; }
  .display-title { font-size: 16px; }
  .section-title { font-size: 14px; margin-top: 20px; }
  .card { padding: 12px 14px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-number { font-size: 22px; }
  .stat-label { font-size: 10px; }
  .badge { font-size: 10px; padding: 2px 6px; }
  .display-nav { gap: 6px; }
  .nav-link { font-size: 11px; padding: 4px 8px; }
  .phone-hide { display: none !important; }
  .phone-only { display: block !important; }
  .phone-compact { font-size: 12px; line-height: 1.4; }

  /* Stack table cells on very small screens */
  thead { display: none; }
  tbody tr {
    display: block;
    border-bottom: 1px solid var(--border-subtle);
    padding: 8px 0;
  }
  tbody td {
    display: block;
    padding: 2px 0;
    border: none;
  }
  tbody td::before {
    content: attr(data-label);
    font-size: 10px;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 2px;
  }
}
