/* ============================================
   TheBigBoard v2 — Shell Styles
   Military COP / War Dashboard
   Dark theme, red accents, Inter font
   ============================================ */

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

:root {
  --bg-primary: #09090b;
  --bg-card: #18181b;
  --bg-header: #000000;
  --bg-strip: #18181b;
  --border: #27272a;
  --border-light: #3f3f46;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-dim: #52525b;
  --accent-red: #dc2626;
  --accent-red-dim: #991b1b;
  --accent-amber: #f59e0b;
  --accent-blue: #3b82f6;
  --accent-green: #22c55e;
  --card-radius: 8px;
  --header-height: 50px;
  --strip-height: 40px;
  --mobile-bar-height: 56px;
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  background: var(--bg-primary);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* === HEADER BAR === */
#tbb-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 16px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
}

.tbb-logo {
  display: flex;
  align-items: center;
  gap: 0;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  white-space: nowrap;
  text-transform: uppercase;
  flex-shrink: 0;
}

.tbb-logo .logo-the {
  color: var(--text-secondary);
  font-weight: 600;
  margin-right: 5px;
}

.tbb-logo .logo-big {
  color: var(--text-primary);
  margin-right: 5px;
}

.tbb-logo .logo-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent-red);
  border-radius: 50%;
  margin-right: 4px;
  flex-shrink: 0;
}

.tbb-logo .logo-board {
  color: var(--text-primary);
}

/* Desktop Tab Nav */
.tbb-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.tbb-nav a {
  display: flex;
  align-items: center;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-radius: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tbb-nav a:hover {
  color: var(--text-secondary);
  background: rgba(255,255,255,0.04);
}

.tbb-nav a.active {
  color: var(--text-primary);
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.25);
}

/* Live Indicator */
.tbb-live {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.tbb-live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-red);
  text-transform: uppercase;
}

.tbb-live-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-red);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(220,38,38,0.5); }
  50% { opacity: 0.6; box-shadow: 0 0 0 6px rgba(220,38,38,0); }
}

.tbb-utc-time {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* === STATUS STRIP === */
#tbb-status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--strip-height);
  padding: 0 16px;
  background: var(--bg-strip);
  border-bottom: 1px solid var(--border);
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

#tbb-status-strip::-webkit-scrollbar {
  display: none;
}

.kpi-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.kpi-chip-icon {
  font-size: 12px;
  line-height: 1;
}

.kpi-chip-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-chip-value {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.kpi-chip-value.skeleton {
  background: var(--border);
  color: transparent;
  border-radius: 3px;
  min-width: 32px;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.25; }
}

/* === MAIN CONTENT === */
#tbb-main {
  padding: 12px 16px 24px;
  max-width: 1920px;
  margin: 0 auto;
}

/* === CARD === */
.tbb-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  overflow: hidden;
}

.tbb-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.tbb-card-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.tbb-card-meta {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 500;
}

.tbb-card-body {
  padding: 12px 14px;
}

/* === BADGE === */
.tbb-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 3px;
  letter-spacing: 0.04em;
}

.tbb-badge-red {
  background: rgba(220,38,38,0.15);
  color: var(--accent-red);
  border: 1px solid rgba(220,38,38,0.25);
}

.tbb-badge-amber {
  background: rgba(245,158,11,0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245,158,11,0.25);
}

.tbb-badge-blue {
  background: rgba(59,130,246,0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(59,130,246,0.25);
}

.tbb-badge-green {
  background: rgba(34,197,94,0.15);
  color: var(--accent-green);
  border: 1px solid rgba(34,197,94,0.25);
}

/* === NEWS CARD === */
.news-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(39,39,42,0.5);
  position: relative;
  padding-left: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.news-item:hover {
  background: rgba(255,255,255,0.02);
}

.news-item:last-child {
  border-bottom: none;
}

.news-item-border {
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 2px;
}

.news-item-border.cat-strike { background: var(--accent-red); }
.news-item-border.cat-diplomatic { background: var(--accent-blue); }
.news-item-border.cat-military { background: var(--accent-amber); }
.news-item-border.cat-maritime { background: #06b6d4; }
.news-item-border.cat-intel { background: #8b5cf6; }

.news-item-content {
  flex: 1;
  min-width: 0;
}

.news-item-headline {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 2px;
}

.news-item-summary {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.news-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.news-source-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.news-time {
  font-size: 9px;
  color: var(--text-dim);
}

/* === THEATER SUMMARY === */
.theater-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.theater-col-header {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid;
}

.theater-col-header.allied {
  color: var(--accent-blue);
  border-color: rgba(59,130,246,0.3);
}

.theater-col-header.adversary {
  color: var(--accent-red);
  border-color: rgba(220,38,38,0.3);
}

.theater-item {
  font-size: 11px;
  color: var(--text-secondary);
  padding: 3px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.theater-item::before {
  content: '›';
  color: var(--text-dim);
  font-weight: 700;
}

.diplomatic-pulse {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.diplomatic-pulse-header {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-amber);
  margin-bottom: 6px;
}

.diplomatic-pulse-text {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* === MARKET TABS === */
.market-tabs {
  display: flex;
  gap: 2px;
}

.market-tab {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 3px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: none;
  background: none;
}

.market-tab:hover {
  color: var(--text-secondary);
}

.market-tab.active {
  background: rgba(220,38,38,0.12);
  color: var(--text-primary);
}

/* === SPARKLINES === */
.sparkline-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 8px 14px 12px;
  border-top: 1px solid var(--border);
}

.sparkline-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sparkline-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sparkline-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.sparkline-delta {
  font-size: 10px;
  font-weight: 600;
}

.sparkline-delta.up { color: var(--accent-green); }
.sparkline-delta.down { color: var(--accent-red); }

/* === KEY DATES === */
.key-dates-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.key-dates-strip::-webkit-scrollbar {
  display: none;
}

.date-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.date-chip-event {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
}

.date-chip-countdown {
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.date-chip.warn {
  border-color: rgba(245,158,11,0.4);
}

.date-chip.warn .date-chip-countdown {
  color: var(--accent-amber);
}

.date-chip.urgent {
  border-color: rgba(220,38,38,0.4);
}

.date-chip.urgent .date-chip-countdown {
  color: var(--accent-red);
}

/* === AD SLOTS === */
.ad-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.01);
  border: 1px dashed var(--border);
  border-radius: 4px;
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* === MAP PLACEHOLDER === */
.map-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111113;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* === CHART PLACEHOLDER === */
.chart-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.2);
  color: var(--text-dim);
  font-size: 11px;
  border-radius: 4px;
}

/* === PANEL GRID === */
.panel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.panel-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.02em;
}

/* === SKELETON TEXT === */
.skeleton-text {
  background: linear-gradient(90deg, var(--border) 25%, #3f3f46 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: skeleton-shine 1.5s ease-in-out infinite;
  border-radius: 3px;
  color: transparent !important;
}

@keyframes skeleton-shine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === BLUF === */
.bluf-text {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.7;
}

/* === STRAIT STATUS === */
.strait-status {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}

.strait-header {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #06b6d4;
  margin-bottom: 6px;
}

.strait-text {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* === FOOTER === */
#tbb-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 16px;
  font-size: 11px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}

#tbb-footer a {
  color: var(--text-muted);
  transition: color 0.15s;
}

#tbb-footer a:hover {
  color: var(--text-primary);
}

/* === MOBILE BOTTOM TAB BAR === */
#tbb-mobile-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--mobile-bar-height);
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-area-bottom);
}

.mobile-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 100%;
}

.mobile-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 8px;
  text-decoration: none;
  transition: color 0.15s;
  flex: 1;
}

.mobile-tab-icon {
  font-size: 18px;
  line-height: 1;
}

.mobile-tab-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mobile-tab.inactive {
  color: var(--text-muted);
}

.mobile-tab.active {
  color: var(--accent-red);
}

/* === SKELETON PAGE === */
.skeleton-page {
  padding: 40px 16px;
  text-align: center;
}

.skeleton-page h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.skeleton-page p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
}

/* === RESPONSIVE === */

/* Tablet */
@media (max-width: 1024px) {
  .panel-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile */
@media (max-width: 768px) {
  #tbb-mobile-bar {
    display: block;
  }

  body {
    padding-bottom: calc(var(--mobile-bar-height) + 16px + var(--safe-area-bottom));
  }

  .tbb-nav {
    display: none;
  }

  .tbb-logo {
    font-size: 13px;
  }

  #tbb-main {
    padding: 8px 10px 20px;
  }

  .panel-grid {
    grid-template-columns: 1fr;
  }

  .theater-columns {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .sparkline-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* === SCROLLBAR GLOBAL === */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}
