/* style.css */
:root{
  /* Category colors */
  --gov:#7aa2ff;       /* Government & Policy */
  --ai:#9b86ff;        /* AI  */
  --health:#4cc9f0;    /* Health & Science */
  --env:#72e05e;       /* Environment & Space */
  --econ:   #FFD400; /* Yellow - clear and distinct from orange */
  --science:#ff9500; /* Orange - energetic, innovation */
  --space:  #A0A3A8; /* Gray - cosmic, neutral, metallic */
  --soc:#ff6b8a;       /* Society & Culture */
  --corp:#8A0194;              /* Corporations  */
  --crime: #C19A6B;           /* Crime  */
  --conflict: #8B0836;           /* Conflict  */

  /* Layout + motion knobs */
  --tile-gap:12px;
  --tile-min:175px;
  --tile-ratio:0.85;
  --tile-radius:18px;
  --tile-bg:#0f1220;
  --tile-text:#e9eefb;
  --tile-muted:#a9b3cf;
  --grid-max-width:1400px;

  --ticker-height:60px;      /* ribbon height */
  --ticker-speed:22s;        /* lower = faster */
  --ticker-gap:18px;         /* spacing between chips */

  --page-bg:#0a0d18;
  --page-text:#eaf1ff;
  --border:#24304a;
  --shadow:0 10px 24px rgba(0,0,0,.35);
  --accent:#89b4ff;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(137,180,255,.08), transparent 60%),
    radial-gradient(800px 500px at 10% -20%, rgba(114,224,94,.06), transparent 60%),
    var(--page-bg);
  color:var(--page-text);
  overflow:hidden; /* keep ticker fixed at bottom */
}
header {
max-width: var(--grid-max-width);
  margin: 0 auto; /* Center it */
  margin-bottom: -25px; 
  margin-left: 25px;
  padding: 0;
  display:flex;
  align-items:baseline;
  gap:16px;
  padding: 0px;
}
h1{font-size:20px;margin:0}
.sub{color:var(--tile-muted);font-size:13px}






.legend-item {
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.legend-item:hover {
  opacity: 1;
}

.legend-item.active {
  opacity: 1;
  font-weight: bold;
}






.logo-link {
  position: fixed;
  top: 15px;
  right: 20px;
  z-index: 200;
  transition: opacity .2s ease;
}

.logo-link:hover {
  opacity: 0.8;
}

.logo {
  height: 35px;
  right: 30px;
  width: auto;
  display: block;
}





#searchContainer {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px 20px;
  background: var(--bg, #0a0a0a);
  border-bottom: 2px solid #333;
  backdrop-filter: blur(10px);
}




.legend{
  max-width:var(--grid-max-width);
  margin:0 auto 8px; /* Reduced bottom margin */
  padding:0 16px;
  font-size:12px;
  color:var(--tile-muted);
  display:flex;flex-wrap:wrap;gap:14px;align-items:center;
}
.dot{width:8px;height:8px;border-radius:999px;display:inline-block}

/* Grid */
.grid-wrap{
  position:relative;
  max-width:var(--grid-max-width);
  margin:0 auto;
  padding:0 16px 30px; /* Just enough padding for radio player */
  height:calc(100vh - 195px); /* Tight calculation: header + ticker + legend + radio */
  overflow:auto;
  
  /* Hide scrollbar but keep scroll functionality */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.grid-wrap::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Edge */
  width: 0;
  height: 0;
}
.grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(var(--tile-min),1fr));
  gap:var(--tile-gap);
  align-content:start;
}

/* Tile */
.tile{
  position:relative;
  aspect-ratio:1/var(--tile-ratio);
  background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.0)), var(--tile-bg);
  border:1px solid var(--border);
  border-radius:var(--tile-radius);
  padding:14px 14px 12px;
  box-shadow:var(--shadow);
  cursor:pointer;
  overflow:hidden;
  transform:translateZ(0);
  transition:transform .2s ease, border-color .2s ease, opacity .2s ease, box-shadow .2s ease;
}

.tile .metric .value {
  font-size: 16px;           /* headline size */
  font-weight: 500;          /* headline thickness */
  line-height: 1.3;          /* headline line spacing */
}

/* Caption (bottom text with time) */
.tile .caption {
  font-size: 12px;           /* caption size */
  font-weight: 500;          /* caption thickness */
  line-height: 1.4;          /* caption line spacing */
  opacity: 0.7;              /* make it more subtle */
}

.tile:hover{
  transform:translateY(-2px);
  border-color:rgba(137,180,255,.5);
  box-shadow:0 12px 28px rgba(0,0,0,.45);
}
.tile .top{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  color:var(--tile-muted); font-size:10px; letter-spacing:.3px; text-transform:uppercase;
}
.tag{display:inline-flex; align-items:center; gap:8px}
.metric{margin-top:8px; display:flex; align-items:baseline; gap:10px}
.value{font-size:16px; font-weight:600; letter-spacing:.2px}
.caption{margin-top:8px; font-size:13px; color:var(--tile-muted); line-height:1.3}

/* Category accents */
.gov .chip, .gov .pill { box-shadow: 0 0 0 1px rgba(122,162,255,.18) inset }
.ai .chip, .ai .pill { box-shadow: 0 0 0 1px rgba(155,134,255,.18) inset }
.health .chip, .health .pill { box-shadow: 0 0 0 1px rgba(76,201,240,.18) inset }
.env .chip, .env .pill { box-shadow: 0 0 0 1px rgba(114,224,94,.20) inset }
.econ .chip, .econ .pill { box-shadow: 0 0 0 1px rgba(255,184,107,.22) inset }
.soc .chip, .soc .pill { box-shadow: 0 0 0 1px rgba(255,107,138,.22) inset }

/* Ticker stack — properly contained lane at top */
.ticker-stack{
  position:contain; 
  left:0; 
  right:0; 
  margin-top: 20;
  margin-bottom: 20;
  top: 15px; /* Position below header */
  height: var(--ticker-height); /* Fixed height */
  display:flex; 
  flex-direction: column;
  padding:0;
  background:linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.15) 60%, transparent);
  pointer-events:none;
  z-index: 40;
  overflow:hidden; /* Critical - keeps content contained */
}

/* Ribbon — single lane for live feed with fixed height */
.ribbon{
  pointer-events:auto;
  position:relative; 
  height:100%; /* Fill the stack height */
  border:1px solid var(--border); 
  border-radius:0; /* No radius for full-width ticker */
  overflow:hidden;
  box-shadow:var(--shadow);
  background:linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  
  /* Simple flex for single lane */
  display:flex;
  align-items:center;
}

/* Left category panel */
.ribbon .left{
  display:flex; 
  align-items:center; 
  gap:10px; 
  padding:0 12px; 
  height:100%;
  border-right:1px solid var(--border);
  font-size:12px; 
  text-transform:uppercase; 
  color:#d6def3; 
  letter-spacing:.4px; 
  min-width:168px;
}

.ribbon .left .catlabel{
  font-weight:600;
}

/* Live feed lane - single scrolling track with proper containment */
.live-feed-lane{
  flex:1;
  position:relative;
  overflow:hidden;
  display:flex;
  align-items:center;
  height:100%;
  min-height:var(--ticker-height);
  max-height:var(--ticker-height);
}

.live-feed-track{
  position:absolute;
  top: 0;
  left: 0;
  height: 100%;
  display:flex;
  align-items:center;
  gap:var(--ticker-gap);
  white-space:nowrap;
  padding:0 var(--ticker-gap);
  will-change: transform;
}

/* Chip styling */
.chip{
  display:inline-flex; 
  align-items:center; 
  gap:8px; 
  padding:7px 12px; 
  font-size:13px; 
  line-height:1.2; 
  border-radius:999px;
  background:rgba(255,255,255,.06); 
  border:1px solid var(--border);
  transition:background .2s ease;
}

.chip:hover{
  background:rgba(255,255,255,.10);
}

.chip strong{
  font-weight:600;
}

.chip a{ 
  color:#dce6ff; 
  text-decoration:none;
  font-weight:500;
}
.chip a:hover{ 
  text-decoration:underline 
}

/* Close button */
.ribbon .close{
  position:absolute; 
  top:6px; 
  right:8px; 
  width:24px; 
  height:24px; 
  border-radius:8px; 
  border:1px solid var(--border);
  background:rgba(255,255,255,.06); 
  color:#cfd8f8; 
  display:grid; 
  place-items:center; 
  cursor:pointer; 
  font-weight:700;
  font-size:16px;
  z-index:10;
  transition:transform .12s ease, background .12s ease;
}
.ribbon .close:hover{ 
  transform:scale(1.05); 
  background:rgba(255,255,255,.12) 
}

.pill{
  padding:5px 10px; 
  border-radius:999px; 
  background:rgba(255,255,255,.08); 
  border:1px solid var(--border); 
  font-weight:600
}

.sr-only{
  position:absolute;
  left:-9999px;
  top:auto;
  width:1px;
  height:1px;
  overflow:hidden
}

/* Radio Player - completely redesigned for sleek dark look */
.radio-row {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: linear-gradient(180deg, #0a0d18 0%, #050812 100%);
  border-top: 1px solid rgba(137,180,255,.2);
  box-shadow: 0 -8px 32px rgba(0,0,0,.5);
  z-index: 100;
}

/* Radio label/icon */
.radio-row::before {
  content: '📻 RADIO';
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #89b4ff;
  text-transform: uppercase;
  opacity: 0.9;
  min-width: 80px;
}

/* Station selector */
.radio-row select {
  padding: 6px 2px;
  border-radius: 2px;
  border: 1px solid rgba(137,180,255,.3);
  background: rgba(137,180,255,.08);
  color: #eaf1ff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  min-width: 400px;
   min-width: 40px;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.radio-row select option {
  background: #0f1220;
  color: #eaf1ff;
  padding: 8px;
}

.radio-row select:hover {
  background: rgba(137,180,255,.15);
  border-color: rgba(137,180,255,.5);
  box-shadow: 0 4px 12px rgba(137,180,255,.2);
}

.radio-row select:focus {
  outline: none;
  border-color: #89b4ff;
  background: rgba(137,180,255,.2);
  box-shadow: 0 0 0 3px rgba(137,180,255,.1);
}

/* Audio player */
#radioPlayer {
  flex: 1;
  max-width: 400px;
  height: 30px;
  border-radius: 8px;
  background: rgba(137,180,255,.05);
  border: 1px solid rgba(137,180,255,.2);
  box-shadow: inset 0 2px 8px rgba(0,0,0,.3);
}

/* Try to style native controls better */
#radioPlayer::-webkit-media-controls-enclosure {
  background: transparent;
  border-radius: 8px;
}

#radioPlayer::-webkit-media-controls-panel {
  background: rgba(15,18,32,.8);
  border-radius: 8px;
}

#radioPlayer::-webkit-media-controls-play-button {
  background-color: rgba(137,180,255,.2);
  border-radius: 50%;
  margin-left: 6px;
}

#radioPlayer::-webkit-media-controls-play-button:hover {
  background-color: rgba(137,180,255,.3);
}

#radioPlayer::-webkit-media-controls-current-time-display,
#radioPlayer::-webkit-media-controls-time-remaining-display {
  color: #89b4ff;
  font-size: 11px;
  font-weight: 600;
}

#radioPlayer::-webkit-media-controls-timeline {
  background: rgba(137,180,255,.1);
  border-radius: 4px;
  margin: 0 8px;
}

#radioPlayer::-webkit-media-controls-volume-slider {
  background: rgba(137,180,255,.1);
  border-radius: 4px;
}








.footer {
  position: fixed;
  bottom: 10px;
  right: 20px;
  display: flex;
  gap: 15px;
  z-index: 1000;
}

.footer a {
  font-size: 15px;
  font-weight: 400;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 4px;
  transition: opacity 0.2s;
}

.footer a:hover {
  opacity: 1;
  background: rgba(15, 18, 32, 0.95);
}

/* Fix grid to prevent cutoff */
.grid-wrap {
  position: relative;
  max-width: var(--grid-max-width);
  margin: 0 auto;
  padding: 0 16px 120px; /* Increased from 30px to 120px for bottom spacing */
  height: calc(100vh - 190px); /* Adjusted calculation */
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .footer {
    bottom: 70px;
    right: 10px;
    gap: 8px;
  }
  .footer a {
    font-size: 13px;
    padding: 6px 10px;
  }
}