/* =========================================================
   SITUATION ROOM — Glassmorphic ops-center
   Fonts: Bebas Neue (title) · Barlow Condensed (UI) · JetBrains Mono (data)
   ========================================================= */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Base */
  --bg:           #03050d;

  /* Glass surfaces */
  --glass:        rgba(8, 14, 30, 0.62);
  --glass-mid:    rgba(10, 18, 36, 0.72);
  --glass-heavy:  rgba(6, 10, 22, 0.82);
  --glass-hover:  rgba(14, 22, 44, 0.70);

  /* Borders */
  --border:       rgba(255, 255, 255, 0.055);
  --border-mid:   rgba(255, 255, 255, 0.085);
  --border-hi:    rgba(255, 255, 255, 0.13);

  /* Accent */
  --accent:       #22b8e8;
  --accent-glow:  rgba(34, 184, 232, 0.18);

  /* Positive / Negative */
  --pos:          #00d972;
  --pos-glow:     rgba(0, 217, 114, 0.15);
  --neg:          #ff3d5a;
  --neg-glow:     rgba(255, 61, 90, 0.15);

  /* Text — high contrast */
  --text-1:       #eef4ff;   /* primary: near-white with cool tint */
  --text-2:       #90aec4;   /* secondary: clearly readable */
  --text-3:       #4e6a80;   /* muted: timestamps, minor labels */
  --live:         #00f080;

  /* Fonts */
  --font-title:   'Bebas Neue', 'Barlow Condensed', sans-serif;
  --font-ui:      'Barlow Condensed', sans-serif;
  --font-data:    'JetBrains Mono', monospace;

  /* Layout */
  --ticker-h:     58px;
  --header-h:     46px;
  --banner-h:     22px;
  --footer-h:     28px;
  --gap:          6px;
}

/* =========================================================
   BASE & BACKGROUND
   ========================================================= */

html, body {
  height: 100%;
  background-color: var(--bg);
  color: var(--text-1);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}

/* Ambient light orbs — give the glass something to blur against */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 45% at 15% 0%,   rgba(22, 140, 220, 0.14) 0%, transparent 65%),
    radial-gradient(ellipse 40% 55% at 85% 90%,  rgba(14, 80, 200, 0.11) 0%, transparent 65%),
    radial-gradient(ellipse 35% 30% at 75% 15%,  rgba(0, 160, 100, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 50% 50%,  rgba(2, 8, 22, 0.55)   0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* Technical grid */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(34, 184, 232, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 184, 232, 0.028) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
  z-index: 1;
}

/* All page content above the effects */
.classification-banner,
#ticker-bar,
.site-header,
.feeds-grid,
.status-bar {
  position: relative;
  z-index: 10;
}

/* Scanline overlay — topmost */
.classification-banner::after,
#ticker-bar::after,
.site-header::after,
.feeds-grid::after,
.status-bar::after { display: none; }

html::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.014) 2px,
    rgba(0, 0, 0, 0.014) 3px
  );
  pointer-events: none;
  z-index: 9999;
}

/* =========================================================
   CLASSIFICATION BANNER
   ========================================================= */

.classification-banner {
  height: var(--banner-h);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-heavy);
  backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-data);
  font-size: 9px;
  letter-spacing: 0.28em;
  color: var(--text-3);
  text-transform: uppercase;
  user-select: none;
}

/* =========================================================
   TICKER BAR
   ========================================================= */

#ticker-bar {
  display: flex;
  align-items: stretch;
  height: var(--ticker-h);
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border-mid);
  overflow: hidden;
}

.ticker-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 16px;
  border-right: 1px solid var(--border);
  position: relative;
  cursor: default;
  transition: background 0.15s ease;
}

.ticker-card:last-child {
  border-right: none;
}

.ticker-card:hover {
  background: var(--glass-hover);
}

/* Colored bottom accent line */
.ticker-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.ticker-up {
  background: linear-gradient(180deg, var(--pos-glow) 0%, transparent 80%);
}
.ticker-up::after   { background: var(--pos); opacity: 0.7; }

.ticker-down {
  background: linear-gradient(180deg, var(--neg-glow) 0%, transparent 80%);
}
.ticker-down::after { background: var(--neg); opacity: 0.7; }

.ticker-label {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text-3);
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: 5px;
}

.ticker-price {
  font-family: var(--font-data);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-1);
  line-height: 1;
  letter-spacing: -0.01em;
}

.ticker-change {
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.ticker-up   .ticker-change { color: var(--pos); }
.ticker-down .ticker-change { color: var(--neg); }

.ticker-arrow { font-size: 9px; }

.ticker-error {
  font-family: var(--font-data);
  font-size: 10px;
  color: var(--text-3);
  padding: 0 16px;
  letter-spacing: 0.12em;
  align-self: center;
}

@keyframes tickerFlash {
  from { opacity: 0.15; }
  to   { opacity: 1; }
}
.ticker-card.htmx-added { animation: tickerFlash 0.7s ease both; }

/* =========================================================
   SITE HEADER
   ========================================================= */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 18px;
  background: var(--glass-mid);
  backdrop-filter: blur(28px) saturate(180%);
  border-bottom: 1px solid var(--border-mid);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-title {
  font-family: var(--font-title);
  font-size: 23px;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--accent);
  line-height: 1;
  text-shadow: 0 0 28px rgba(34, 184, 232, 0.45);
}

.header-divider {
  color: var(--border-hi);
  font-size: 16px;
}

.header-sub {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--text-3);
  text-transform: uppercase;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--live);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 12px var(--live);
  animation: livePulse 2.4s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1;   box-shadow: 0 0 12px var(--live), 0 0 24px rgba(0, 240, 128, 0.3); }
  50%       { opacity: 0.3; box-shadow: 0 0 4px var(--live); }
}

.fetch-spin {
  font-family: var(--font-data);
  font-size: 14px;
  color: var(--accent);
  display: none;
  animation: spin 0.7s linear infinite;
}
.htmx-request .fetch-spin { display: inline; }
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.utc-label {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--text-3);
}

.utc-clock {
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--text-2);
  letter-spacing: 0.04em;
  min-width: 168px;
  text-align: right;
}

/* =========================================================
   FEED GRID — glass cards with gap
   ========================================================= */

.feeds-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
  padding: var(--gap);
  height: calc(100vh - var(--banner-h) - var(--ticker-h) - var(--header-h) - var(--footer-h));
  overflow: hidden;
  background: transparent;
}

.feed-col {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 6px;

  /* Glass card */
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid var(--border-mid);
  box-shadow:
    0 4px 32px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

/* Subtle top-edge highlight for glass depth */
.feed-col::before {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.12) 30%,
    rgba(255, 255, 255, 0.07) 70%,
    transparent 100%
  );
  flex-shrink: 0;
}

.feed-col-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
  background: rgba(255, 255, 255, 0.025);
}

/* Accent left edge */
.feed-col-header::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent) 0%, transparent 100%);
  opacity: 0.5;
  border-radius: 0 0 2px 2px;
}

.feed-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-ok  { background: var(--pos); box-shadow: 0 0 7px rgba(0, 217, 114, 0.7); }
.dot-err { background: var(--neg); box-shadow: 0 0 6px rgba(255, 61, 90, 0.6); }

.feed-col-name {
  flex: 1;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--text-1);
  text-transform: uppercase;
}

.feed-col-count {
  font-family: var(--font-data);
  font-size: 10px;
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 3px;
}

/* =========================================================
   FEED ITEMS
   ========================================================= */

.feed-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.feed-list::-webkit-scrollbar       { width: 3px; }
.feed-list::-webkit-scrollbar-track { background: transparent; }
.feed-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.feed-list::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

.feed-item {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s ease;
}

.feed-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.feed-link {
  display: block;
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.42;
  color: var(--text-1);
  text-decoration: none;
  margin-bottom: 5px;
  transition: color 0.12s;
}

.feed-link:hover {
  color: var(--accent);
}

.feed-time {
  font-family: var(--font-data);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

.feed-no-data {
  padding: 20px 14px;
  font-family: var(--font-data);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--text-3);
}

@keyframes fadeInItem {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.feed-item.htmx-added { animation: fadeInItem 0.4s ease both; }

/* =========================================================
   STATUS BAR
   ========================================================= */

.status-bar {
  display: flex;
  align-items: center;
  height: var(--footer-h);
  padding: 0 16px;
  border-top: 1px solid var(--border-mid);
  background: var(--glass-heavy);
  backdrop-filter: blur(24px) saturate(160%);
  gap: 24px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-data);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--text-3);
  text-transform: uppercase;
}

.status-right { margin-left: auto; }

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}
.status-ok {
  background: var(--pos);
  box-shadow: 0 0 6px rgba(0, 217, 114, 0.6);
}

/* =========================================================
   UTILS
   ========================================================= */

::-webkit-scrollbar       { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

::selection {
  background: rgba(34, 184, 232, 0.28);
  color: var(--text-1);
}

a { color: inherit; }
