:root {
  /* Paleta Oficial AtlasNews / AtlasHub.SI */
  --bg: #030c1c;
  --bg-mid: #061836;
  --panel: rgba(6, 20, 44, 0.92);
  --border: rgba(0, 168, 255, 0.22);
  --border-strong: rgba(0, 212, 255, 0.55);
  --text: #f3f7ff;
  --muted: #8fb0da;
  --atlas-blue: #0099ff;
  --cyan: #00d4ff;
  --news-red: #e5192c;
  --gold: #ffb84d;
  --purple: #a855f7;
  --green: #00e676;
  --pink: #ff4d79;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", Consolas, monospace;
}

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

html, body {
  height: 100%;
  background: radial-gradient(circle at 52% 42%, #0a2550 0%, var(--bg-mid) 45%, var(--bg) 100%);
  color: var(--text);
  font-family: var(--font-sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* TOPBAR */
.topbar {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  background: linear-gradient(90deg, #030b1a 0%, #071b3b 50%, #030b1a 100%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.atlas-logo {
  filter: drop-shadow(0 0 8px rgba(0, 180, 255, 0.45));
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 7px;
}

.brand-title {
  font-size: 16px;
  letter-spacing: 0.12em;
  font-weight: 800;
  color: #ffffff;
}

.brand-title strong {
  color: var(--cyan);
  font-weight: 900;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--news-red);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  box-shadow: 0 0 10px rgba(229, 25, 44, 0.55);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
  animation: pulse 1.4s infinite;
}

.live-dot.small {
  width: 7px;
  height: 7px;
  background: #fff;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.75); }
}

.brand-sub {
  font-size: 9.5px;
  font-family: var(--font-mono);
  color: var(--muted);
  letter-spacing: 0.14em;
  margin-top: 2px;
}

.clocks {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.clock-item em { font-style: normal; color: var(--muted); margin-right: 3px; }
.clock-item strong { color: #fff; font-weight: 600; }

.top-metrics {
  display: flex;
  align-items: center;
  gap: 7px;
}

.metric-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(0, 153, 255, 0.09);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.metric-pill .label { color: var(--muted); }
.metric-pill strong { color: var(--gold); }

.mcp-pill {
  color: var(--green);
  border-color: rgba(0, 230, 118, 0.35);
  background: rgba(0, 230, 118, 0.08);
}

.mcp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.lang-select {
  background: rgba(3, 12, 28, 0.9);
  border: 1px solid var(--border);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
}

.lang-select:focus { border-color: var(--cyan); }

.mode-switch {
  display: flex;
  background: rgba(3, 12, 28, 0.75);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 2px;
}

.mode-btn, .action-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.mode-btn.active {
  background: linear-gradient(135deg, rgba(0, 153, 255, 0.32), rgba(0, 212, 255, 0.22));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 212, 255, 0.4);
}

.action-btn {
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(0, 153, 255, 0.08);
}

.action-btn:hover { border-color: var(--cyan); color: var(--cyan); }

.action-btn.primary {
  background: linear-gradient(135deg, #0077e6, #00b8ff);
  border-color: var(--cyan);
  color: #fff;
  font-weight: 700;
}

.action-btn.studio-on {
  background: var(--news-red);
  border-color: #ff5c6c;
  color: #fff;
}

/* MAIN GRID */
.grid-layout {
  height: calc(100vh - 58px - 36px);
  display: grid;
  grid-template-columns: 262px 1fr 368px;
  transition: grid-template-columns 0.25s ease;
}

.grid-layout.studio-mode {
  grid-template-columns: 0px 1fr 340px;
}

.grid-layout.studio-mode .left-panel {
  overflow: hidden;
  padding: 0;
  border: none;
  opacity: 0;
}

.panel {
  background: var(--panel);
  display: flex;
  flex-direction: column;
  min-height: 0;
  backdrop-filter: blur(10px);
}

.left-panel {
  border-right: 1px solid var(--border);
  padding: 12px;
  gap: 9px;
  overflow-y: auto;
}

.right-panel {
  border-left: 1px solid var(--border);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  font-size: 10.5px;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  color: var(--cyan);
  border-bottom: 1px solid var(--border);
}

.mono-dim {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
}

.search-box input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: rgba(3, 12, 28, 0.85);
  color: var(--text);
  font-size: 12px;
  outline: none;
}

.search-box input:focus { border-color: var(--cyan); }

.category-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cat-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.cat-btn:hover { background: rgba(0, 153, 255, 0.08); }

.cat-btn.active {
  background: rgba(0, 153, 255, 0.18);
  border-color: rgba(0, 212, 255, 0.45);
  border-left: 3px solid var(--cyan);
}

.cat-name { flex: 1; font-weight: 500; }
.cat-count { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-all { background: #ffffff; }
.dot-ai { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.dot-tech { background: var(--purple); box-shadow: 0 0 8px var(--purple); }
.dot-business { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.dot-gaming { background: var(--pink); box-shadow: 0 0 8px var(--pink); }

.section-label {
  margin-top: 4px;
  font-size: 9.5px;
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  color: var(--muted);
}

.lang-filter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.window-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.win-btn, .lf-btn {
  padding: 5px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(3, 12, 28, 0.65);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
}

.win-btn.active, .lf-btn.active {
  border-color: var(--cyan);
  color: #fff;
  background: rgba(0, 153, 255, 0.25);
}

.sensors-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 145px;
  overflow-y: auto;
  padding-right: 4px;
}

.sensor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--muted);
  padding: 2px 3px;
}

.sensor-status { display: flex; align-items: center; gap: 6px; }
.s-dot { width: 6px; height: 6px; border-radius: 50%; }
.s-dot.ok { background: var(--green); }
.s-dot.err { background: var(--news-red); }

.atlas-footer-card {
  margin-top: auto;
  padding: 10px;
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(0, 153, 255, 0.14), rgba(3, 12, 28, 0.9));
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-left: 3px solid var(--atlas-blue);
  font-size: 10.5px;
  line-height: 1.45;
  color: #c7dcff;
}

.atlas-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 4px;
  font-weight: 700;
}

.atlas-footer-card code { font-family: var(--font-mono); color: var(--green); }

/* CENTER STAGE */
.stage-panel {
  position: relative;
  overflow: hidden;
  min-width: 0;
  background: radial-gradient(circle at 50% 48%, #092149 0%, #030b1a 78%);
}

.stage-view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.stage-view.hidden { display: none !important; }

.stage-hud-top {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 6;
}

.hud-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(3, 12, 28, 0.82);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--news-red);
  color: #ffffff;
}

.hud-hint {
  font-size: 10.5px;
  color: var(--muted);
  background: rgba(3, 12, 28, 0.72);
  padding: 5px 10px;
  border-radius: 6px;
}

/* LIVE TV STAGE */
.tv-stage {
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 10px;
  background: #030a18;
  z-index: 7;
}

.tv-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.tv-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tv-ch-btn {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(6, 20, 44, 0.9);
  color: #c7dcff;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tv-ch-btn:hover { border-color: var(--cyan); color: #fff; }
.tv-ch-btn.active {
  background: linear-gradient(135deg, rgba(229, 25, 44, 0.85), rgba(180, 15, 35, 0.9));
  border-color: #ff6b7b;
  color: #fff;
}

.tv-layout-btns { display: flex; gap: 5px; }

.tv-players {
  flex: 1;
  display: grid;
  gap: 10px;
  min-height: 0;
}

.tv-players.single { grid-template-columns: 1fr; }
.tv-players.grid { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

.tv-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  display: flex;
  flex-direction: column;
}

.tv-card-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(6, 20, 44, 0.95);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
}

.tv-card-bar a {
  color: var(--cyan);
  text-decoration: none;
  font-size: 10.5px;
}

.tv-card iframe {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none;
}

/* INSPECTOR */
.inspector {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  background: rgba(5, 16, 36, 0.96);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--atlas-blue);
  border-radius: 10px;
  padding: 13px 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
  z-index: 12;
}

.inspector.hidden { display: none; }
.inspector-top { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.close-btn { margin-left: auto; background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 14px; }
.close-btn:hover { color: #fff; }
.inspector h3 { font-size: 14.5px; line-height: 1.35; margin-bottom: 6px; color: #fff; }
.inspector p { font-size: 12px; line-height: 1.5; color: #c7dcff; margin-bottom: 11px; }
.inspector-actions { display: flex; flex-wrap: wrap; gap: 7px; }

.ins-btn {
  padding: 7px 11px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.ins-btn.cortex { border-color: rgba(0, 212, 255, 0.5); background: rgba(0, 153, 255, 0.18); color: #fff; }
.ins-btn.news { border-color: rgba(229, 25, 44, 0.6); background: rgba(229, 25, 44, 0.18); color: #ffd4d8; }
.ins-btn.hermes { border-color: rgba(255, 184, 77, 0.55); background: rgba(255, 184, 77, 0.14); color: var(--gold); }
.ins-btn:hover { transform: translateY(-1px); filter: brightness(1.15); }

/* RIGHT PANEL TABS */
.right-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--border);
  background: rgba(3, 12, 28, 0.7);
}

.rtab {
  padding: 10px 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.rtab em {
  font-style: normal;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.rtab.active {
  color: #fff;
  border-bottom-color: var(--cyan);
  background: rgba(0, 153, 255, 0.12);
}

.feed-list, .models-list, .terms-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.models-list.hidden, .feed-list.hidden, .terms-list.hidden { display: none; }

.feed-card, .model-card {
  padding: 10px 11px;
  border-radius: 8px;
  background: rgba(3, 12, 28, 0.58);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.feed-card:hover, .feed-card.selected, .model-card:hover {
  background: rgba(0, 153, 255, 0.14);
  border-color: var(--cyan);
}

.feed-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-ai { background: rgba(0, 212, 255, 0.18); color: var(--cyan); }
.badge-tech { background: rgba(168, 85, 247, 0.22); color: #e2c2ff; }
.badge-business { background: rgba(255, 184, 77, 0.2); color: var(--gold); }
.badge-gaming { background: rgba(255, 77, 121, 0.2); color: #ff85a2; }

.lang-pill {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid var(--border);
  color: var(--muted);
  margin-left: 4px;
}

.feed-title {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.38;
  margin-bottom: 7px;
  color: #fff;
}

.feed-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
}

.heat-wrap { display: flex; align-items: center; gap: 6px; }
.heat-bar { width: 42px; height: 4px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.heat-fill { height: 100%; background: linear-gradient(90deg, var(--atlas-blue), var(--gold)); }

/* AI MODEL CARD */
.model-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}
.model-org {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--cyan);
  font-weight: 700;
}
.model-rank {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gold);
  font-weight: 700;
}
.model-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  word-break: break-word;
}
.model-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
}

/* TICKER BAR (ESTILO ATLASNEWS BROADCAST) */
.ticker-bar {
  height: 36px;
  display: flex;
  align-items: center;
  background: #030a18;
  border-top: 1px solid var(--border);
  font-size: 12px;
}

.ticker-label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  height: 100%;
  background: var(--news-red);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #ffffff;
  white-space: nowrap;
}

.ticker-track { flex: 1; overflow: hidden; white-space: nowrap; }

.ticker-content {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 62s linear infinite;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #e6f0ff;
}

.ticker-content:hover { animation-play-state: paused; }

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

.ticker-brand {
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
  border-left: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cyan);
  font-weight: 700;
  white-space: nowrap;
}

.toast {
  position: fixed;
  top: 68px;
  right: 20px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(5, 18, 40, 0.96);
  border: 1px solid var(--cyan);
  color: #fff;
  font-size: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 100;
}

.toast.show { opacity: 1; transform: translateY(0); }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 153, 255, 0.28); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 212, 255, 0.55); }

@media (max-width: 1160px) {
  .clocks { display: none; }
  .grid-layout { grid-template-columns: 225px 1fr 310px; }
}
