:root {
  --navy: #003a5e;
  --navy-deep: #001b2b;
  --teal: #00adc6;
  --teal-soft: #c6ffff;
  --grey: #54616c;
  --off-white: #f9f9f9;
  --orange: #ff6b00;
  --red: #fd5050;
  --font: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--navy-deep);
  color: var(--off-white);
  font-family: var(--font);
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(180deg, var(--navy) 0%, #002a45 100%);
  border-bottom: 1px solid rgba(0, 173, 198, 0.35);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  height: 42px;
  width: 42px;
  border-radius: 50%;
}

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

.brand-title {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--off-white);
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--teal-soft);
  opacity: 0.85;
}

.status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--teal-soft);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
  transition: background 0.3s, box-shadow 0.3s;
}

.status-dot.connected {
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal);
}

main {
  flex: 1;
  display: flex;
  min-height: 0;
}

#globeViz {
  flex: 1;
  min-width: 0;
  position: relative;
}

.panel {
  width: 300px;
  flex-shrink: 0;
  background: rgba(0, 27, 43, 0.92);
  border-left: 1px solid rgba(0, 173, 198, 0.25);
  padding: 1.25rem 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.panel h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal-soft);
  margin: 0 0 0.75rem;
  opacity: 0.8;
}

.auto-rotate {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--teal-soft);
  opacity: 0.85;
  margin-bottom: 0.75rem;
  cursor: pointer;
}

.auto-rotate input {
  accent-color: var(--teal);
}

.sources {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sources li.auto-active label {
  background: rgba(0, 173, 198, 0.12);
}

.sources label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.88rem;
}

.sources label:hover {
  background: rgba(0, 173, 198, 0.08);
}

.sources input[type='checkbox'] {
  accent-color: var(--teal);
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.swatch-freedmr {
  background: var(--teal);
  box-shadow: 0 0 6px var(--teal);
}

.swatch-pskreporter {
  background: var(--orange);
  box-shadow: 0 0 6px var(--orange);
}

.swatch-rbn {
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
}

.source-name {
  flex: 1;
}

.count {
  font-variant-numeric: tabular-nums;
  color: var(--teal-soft);
  opacity: 0.75;
  font-size: 0.78rem;
}

.feed-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.feed {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
}

.feed li {
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--teal);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.feed li.source-pskreporter {
  border-left-color: var(--orange);
}

.feed li.source-rbn {
  border-left-color: var(--red);
}

.feed .feed-call {
  font-weight: 600;
  color: var(--off-white);
}

.feed .feed-meta {
  color: var(--grey);
  font-size: 0.7rem;
}

.panel::-webkit-scrollbar,
.feed::-webkit-scrollbar {
  width: 6px;
}

.panel::-webkit-scrollbar-thumb,
.feed::-webkit-scrollbar-thumb {
  background: rgba(0, 173, 198, 0.35);
  border-radius: 3px;
}

.ticker {
  flex-shrink: 0;
  height: 2.5rem;
  overflow: hidden;
  background: linear-gradient(180deg, #002a45 0%, var(--navy) 100%);
  border-top: 1px solid rgba(0, 173, 198, 0.35);
  display: flex;
  align-items: center;
}

.ticker-track {
  display: flex;
  align-items: center;
  gap: 3rem;
  white-space: nowrap;
  width: max-content;
  animation: ticker-scroll 60s linear infinite;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--teal-soft);
}

.ticker-item .ticker-icon {
  font-size: 1rem;
}

/* .ticker-track renders each event twice back-to-back so a -50% translation
   loops seamlessly regardless of how many events there are. */
@keyframes ticker-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}
