/* ═══════════════════════════════════════════════════════════════
   WARFRONT — Dark Military Terminal Design System
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;700&family=Orbitron:wght@400;500;700;900&display=swap');

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
  --bg-primary: #080808;
  --bg-secondary: #0f0f0f;
  --bg-tertiary: #161616;
  --bg-card: #111111;
  --bg-card-hover: #1a1a1a;
  --red-primary: #ff2020;
  --red-glow: #ff202060;
  --red-dark: #8b0000;
  --red-dim: #ff202030;
  --green-accent: #00ff41;
  --amber-accent: #ffa500;
  --yellow-accent: #ffd700;
  --text-primary: #e0e0e0;
  --text-secondary: #888888;
  --text-muted: #555555;
  --border-color: #222222;
  --border-glow: #ff202040;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --font-display: 'Orbitron', sans-serif;
  --radius: 4px;
  --transition: all 0.3s ease;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scrollbar-width: thin;
  scrollbar-color: var(--red-primary) var(--bg-secondary);
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

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

::-webkit-scrollbar-thumb:hover {
  background: var(--red-primary);
}

body {
  font-family: var(--font-mono);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Scanline Overlay ───────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(0deg,
      transparent,
      transparent 2px,
      rgba(255, 32, 32, 0.015) 2px,
      rgba(255, 32, 32, 0.015) 4px);
  pointer-events: none;
  z-index: 9999;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.4) 100%);
  pointer-events: none;
  z-index: 9998;
}

a {
  color: var(--red-primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: #ff5050;
  text-shadow: 0 0 10px var(--red-glow);
}

/* ── Header ─────────────────────────────────────────────────── */
.header {
  background: linear-gradient(180deg, #0c0c0c 0%, var(--bg-primary) 100%);
  border-bottom: 1px solid var(--red-dark);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 20px rgba(255, 32, 32, 0.1);
}

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

.logo {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  color: var(--red-primary);
  letter-spacing: 6px;
  text-shadow: 0 0 20px var(--red-glow), 0 0 40px rgba(255, 32, 32, 0.3);
  text-transform: uppercase;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--red-dim);
  border: 1px solid var(--red-dark);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--red-primary);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red-primary);
  animation: pulse-dot 1.5s infinite;
  box-shadow: 0 0 8px var(--red-primary);
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.4;
    transform: scale(0.8);
  }
}

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

.utc-clock {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--green-accent);
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

.stats-badge {
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

/* ── Ad Banner ──────────────────────────────────────────────── */
.ad-leaderboard {
  width: 100%;
  max-width: 728px;
  height: 90px;
  margin: 8px auto;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 1px;
}

/* ── Breaking News Ticker ───────────────────────────────────── */
.ticker-bar {
  background: var(--red-dark);
  border-bottom: 1px solid var(--red-primary);
  overflow: hidden;
  white-space: nowrap;
  padding: 6px 0;
  position: relative;
}

.ticker-label {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: var(--red-primary);
  color: #000;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  z-index: 2;
}

.ticker-content {
  display: inline-block;
  padding-left: 160px;
  animation: ticker-scroll 60s linear infinite;
  font-size: 12px;
  color: #fff;
  letter-spacing: 0.5px;
}

.ticker-content span {
  margin-right: 60px;
}

.ticker-content span::before {
  content: '◆ ';
  color: var(--yellow-accent);
}

@keyframes ticker-scroll {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

/* ── Tab Navigation ─────────────────────────────────────────── */
.tabs-nav {
  display: flex;
  gap: 2px;
  padding: 12px 24px 0;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}

.tab-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 10px 20px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-bottom: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: var(--radius) var(--radius) 0 0;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.tab-btn.active {
  color: var(--red-primary);
  background: var(--bg-secondary);
  border-color: var(--border-color);
  border-bottom: 2px solid var(--red-primary);
  text-shadow: 0 0 10px var(--red-glow);
}

.tab-panel {
  display: none;
  padding: 20px 24px;
  animation: fadeIn 0.3s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Main Layout ────────────────────────────────────────────── */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  max-width: 1600px;
  margin: 0 auto;
}

.main-content {
  min-width: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Section Headers ────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--red-primary);
  letter-spacing: 3px;
  text-transform: uppercase;
}

.section-header .count {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── News Cards ─────────────────────────────────────────────── */
.news-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--red-primary);
  padding: 14px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.news-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--red-dim) 0%, transparent 40%);
  opacity: 0;
  transition: var(--transition);
}

.news-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--red-dark);
  transform: translateX(4px);
}

.news-card:hover::before {
  opacity: 1;
}

.news-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.category-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.category-dot.war {
  background: var(--red-primary);
  box-shadow: 0 0 6px var(--red-glow);
}

.category-dot.military {
  background: var(--amber-accent);
}

.category-dot.diplomatic {
  background: var(--yellow-accent);
}

.source-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.time-ago {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: auto;
}

.news-card h3 {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

.country-tags {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.country-tag {
  font-size: 9px;
  color: var(--red-primary);
  background: var(--red-dim);
  padding: 2px 6px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── Map ────────────────────────────────────────────────────── */
.map-container {
  width: 100%;
  height: 560px;
  border-radius: 8px;
  border: 1px solid rgba(255, 32, 32, 0.15);
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 40px rgba(255, 32, 32, 0.06), inset 0 0 60px rgba(0,0,0,0.3);
}

.map-container-full {
  height: calc(100vh - 200px);
}

#war-map,
#war-map-full {
  width: 100%;
  height: 100%;
  background: #0a0a0a;
}

/* Operational dashboard animations */
@keyframes scanline {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
@keyframes pulse-glow {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px #ff2020; }
    50% { opacity: 0.4; box-shadow: 0 0 12px #ff2020; }
}

/* Make labels semi-transparent so markers pop */
.leaflet-pane.leaflet-shadow-pane {
  opacity: 0.55;
}

/* Leaflet popup override */
.leaflet-popup-content-wrapper {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--red-dark) !important;
  border-radius: var(--radius) !important;
  font-family: var(--font-mono) !important;
  box-shadow: 0 4px 20px rgba(255, 32, 32, 0.2) !important;
}

.leaflet-popup-tip {
  background: var(--bg-card) !important;
  border: 1px solid var(--red-dark) !important;
}

.leaflet-popup-content {
  font-size: 12px !important;
  line-height: 1.5 !important;
  max-width: 280px !important;
}

.popup-title {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--red-primary);
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.popup-news-item {
  padding: 6px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 11px;
}

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

.popup-news-item a {
  color: var(--text-primary);
}

.popup-news-item a:hover {
  color: var(--red-primary);
}

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

/* Pulse Marker Animation */
.pulse-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--red-primary);
  box-shadow: 0 0 10px var(--red-primary);
  position: relative;
}

.pulse-marker::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--red-primary);
  transform: translate(-50%, -50%);
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% {
    width: 12px;
    height: 12px;
    opacity: 1;
  }

  100% {
    width: 50px;
    height: 50px;
    opacity: 0;
  }
}

/* ── Markets Panel ──────────────────────────────────────────── */
.markets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.market-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: var(--radius);
  transition: var(--transition);
}

.market-card:hover {
  border-color: var(--red-dark);
}

.market-name {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.market-price {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.market-change {
  font-size: 12px;
  margin-top: 4px;
}

.market-change.up {
  color: var(--green-accent);
}

.market-change.down {
  color: var(--red-primary);
}

.impact-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 12px;
}

.impact-table th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid var(--red-dark);
  color: var(--red-primary);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.impact-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.impact-table tr:hover td {
  background: var(--bg-secondary);
}

/* ── AI Chat ────────────────────────────────────────────────── */
.chat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.chat-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-header h3 {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--red-primary);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.chat-config {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-config select,
.chat-config input {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 6px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius);
  outline: none;
  width: 100%;
}

.chat-config select:focus,
.chat-config input:focus {
  border-color: var(--red-primary);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
}

.chat-msg {
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 12px;
  line-height: 1.5;
  max-width: 90%;
  word-wrap: break-word;
}

.chat-msg.user {
  background: var(--red-dim);
  border: 1px solid var(--red-dark);
  align-self: flex-end;
  color: var(--text-primary);
}

.chat-msg.ai {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  align-self: flex-start;
  color: var(--text-primary);
}

.chat-input-area {
  padding: 10px 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 8px;
}

.chat-input-area input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius);
  outline: none;
}

.chat-input-area input:focus {
  border-color: var(--red-primary);
}

.quick-questions {
  padding: 8px 16px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border-color);
}

.quick-q-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
}

.quick-q-btn:hover {
  border-color: var(--red-primary);
  color: var(--red-primary);
}

/* ── Tweet Generator ────────────────────────────────────────── */
.tweet-gen {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.tweet-config {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tweet-config label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tweet-config select,
.tweet-config textarea {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius);
  outline: none;
  resize: vertical;
}

.tweet-config select:focus,
.tweet-config textarea:focus {
  border-color: var(--red-primary);
}

.tweet-output {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tweet-preview {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
  min-height: 120px;
  white-space: pre-wrap;
}

.hashtag-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.hashtag-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  background: var(--red-dim);
  border: 1px solid var(--red-dark);
  color: var(--red-primary);
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
}

.hashtag-chip:hover {
  background: var(--red-primary);
  color: #000;
}

.tips-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 12px;
}

.tips-box h4 {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--amber-accent);
  letter-spacing: 2px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.tips-box ul {
  list-style: none;
  font-size: 11px;
  color: var(--text-secondary);
}

.tips-box ul li::before {
  content: '▸ ';
  color: var(--red-primary);
}

.tips-box ul li {
  margin-bottom: 4px;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-red {
  background: var(--red-primary);
  color: #000;
  border-color: var(--red-primary);
}

.btn-red:hover {
  background: #ff4040;
  box-shadow: 0 0 20px var(--red-glow);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-outline:hover {
  border-color: var(--red-primary);
  color: var(--red-primary);
}

.btn-x {
  background: #000;
  color: #fff;
  border-color: #333;
}

.btn-x:hover {
  background: #1a1a1a;
  border-color: #555;
}

/* ── Ad Sidebar ─────────────────────────────────────────────── */
.ad-rectangle {
  width: 300px;
  height: 250px;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 1px;
  border-radius: var(--radius);
}

/* ── Loading & States ───────────────────────────────────────── */
.loading-skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-top-color: var(--red-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 13px;
}

.empty-state .icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.4;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
    padding: 0 12px;
  }

  .sidebar {
    order: -1;
  }

  .tweet-gen {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .logo {
    font-size: 20px;
    letter-spacing: 4px;
  }

  .tabs-nav {
    padding: 8px 12px 0;
  }

  .tab-btn {
    padding: 8px 12px;
    font-size: 10px;
  }

  .tab-panel {
    padding: 12px;
  }

  .map-container {
    height: 300px;
  }

  .ad-leaderboard {
    height: 60px;
  }

  .ad-rectangle {
    width: 100%;
    height: 100px;
  }
}

/* ── Notification Toast ─────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bg-card);
  border: 1px solid var(--red-dark);
  border-left: 3px solid var(--red-primary);
  padding: 12px 20px;
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 12px;
  z-index: 10000;
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* ── Glitch Effect for Heading ──────────────────────────────── */
.glitch {
  position: relative;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch::before {
  animation: glitch-1 2s infinite linear;
  color: #0ff;
  clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
}

.glitch::after {
  animation: glitch-2 2s infinite linear;
  color: #f0f;
  clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
}

@keyframes glitch-1 {

  0%,
  95% {
    transform: none;
  }

  96% {
    transform: translate(-2px, -1px);
  }

  97% {
    transform: translate(2px, 1px);
  }

  98% {
    transform: translate(-1px, 2px);
  }

  99% {
    transform: none;
  }
}

@keyframes glitch-2 {

  0%,
  95% {
    transform: none;
  }

  96% {
    transform: translate(2px, 1px);
  }

  97% {
    transform: translate(-2px, -1px);
  }

  98% {
    transform: translate(1px, -2px);
  }

  99% {
    transform: none;
  }
}

/* ── Country Cards ─────────────────────────────────────────── */
.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.country-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.country-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--red-primary);
  transition: var(--transition);
}

.country-card:hover {
  border-color: var(--red-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(255, 32, 32, 0.15);
}

.country-card:hover::before {
  width: 6px;
}

.country-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.country-flag {
  font-size: 28px;
  line-height: 1;
}

.country-name {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--text-primary);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
}

.country-status {
  font-size: 9px;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  display: inline-block;
  margin-top: 4px;
}

.country-status.active-war {
  background: var(--red-dim);
  color: var(--red-primary);
  border: 1px solid var(--red-primary);
}

.country-status.high-tension {
  background: rgba(255, 165, 0, 0.1);
  color: var(--amber-accent);
  border: 1px solid var(--amber-accent);
}

.country-status.escalating {
  background: rgba(255, 255, 0, 0.1);
  color: var(--yellow-accent);
  border: 1px solid var(--yellow-accent);
}

.country-status.monitoring {
  background: rgba(100, 100, 100, 0.1);
  color: var(--text-muted);
  border: 1px solid var(--text-muted);
}

.country-article-count {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 8px;
}

.country-summary {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Country Detail Modal ──────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--bg-primary);
  border: 1px solid var(--red-dark);
  border-radius: 6px;
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px 28px;
  position: relative;
  box-shadow: 0 20px 60px rgba(255, 32, 32, 0.15);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  border-color: var(--red-primary);
  color: var(--red-primary);
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.detail-flag {
  font-size: 48px;
}

.detail-name {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--red-primary);
  letter-spacing: 3px;
  text-transform: uppercase;
}

.detail-section {
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
}

.detail-section h4 {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--red-primary);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.detail-section p,
.detail-section li {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.detail-section ul {
  list-style: none;
  padding: 0;
}

.detail-section ul li::before {
  content: '▸ ';
  color: var(--red-primary);
}

.conflict-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
}

.conflict-row:last-child {
  border-bottom: none;
}

.conflict-opponent {
  color: var(--text-primary);
  font-weight: 600;
}

.conflict-reason {
  color: var(--text-secondary);
  flex: 1;
  margin: 0 12px;
}

.conflict-status {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
}

.conflict-status.active {
  background: var(--red-dim);
  color: var(--red-primary);
}

.conflict-status.escalating {
  background: rgba(255, 165, 0, 0.1);
  color: var(--amber-accent);
}

.conflict-status.ceasefire {
  background: rgba(0, 255, 0, 0.1);
  color: var(--green-accent);
}

/* ── Map: Base Markers ─────────────────────────────────────── */
.base-marker {
  width: 18px;
  height: 18px;
  font-size: 14px;
  line-height: 18px;
  text-align: center;
  filter: drop-shadow(0 0 4px rgba(255, 200, 0, 0.6));
}

/* ── Map: City Attack Markers ──────────────────────────────── */
.city-attack-marker {
  position: relative;
  width: 14px;
  height: 14px;
}
.city-attack-marker .city-core {
  position: absolute;
  top: 3px; left: 3px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ff2020;
  box-shadow: 0 0 8px rgba(255, 32, 32, 0.8);
}
.city-attack-marker .city-pulse-ring {
  position: absolute;
  top: 0; left: 0;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid #ff2020;
  animation: city-ring-pulse 1.5s infinite;
}
@keyframes city-ring-pulse {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* ── Map: Target Markers ───────────────────────────────────── */
.target-marker {
  font-size: 14px;
  line-height: 16px;
  text-align: center;
  filter: drop-shadow(0 0 4px rgba(255, 0, 0, 0.5));
}

/* ── Map: Cluster Markers ──────────────────────────────────── */
.cluster-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 4px rgba(0,0,0,0.8);
}
.cluster-marker span {
  position: relative;
  z-index: 2;
}
.cluster-small {
  background: radial-gradient(circle, rgba(255, 32, 32, 0.85), rgba(139, 0, 0, 0.6));
  border: 2px solid #ff2020;
  box-shadow: 0 0 12px rgba(255, 32, 32, 0.5);
  font-size: 11px;
}
.cluster-medium {
  background: radial-gradient(circle, rgba(255, 100, 0, 0.85), rgba(180, 0, 0, 0.6));
  border: 2px solid #ff6600;
  box-shadow: 0 0 18px rgba(255, 100, 0, 0.6);
  font-size: 13px;
}
.cluster-large {
  background: radial-gradient(circle, rgba(255, 32, 32, 0.95), rgba(200, 0, 0, 0.7));
  border: 2px solid #ff2020;
  box-shadow: 0 0 24px rgba(255, 32, 32, 0.7);
  font-size: 15px;
}

/* Override Leaflet MarkerCluster default styles */
.leaflet-cluster-anim .leaflet-marker-icon,
.leaflet-cluster-anim .leaflet-marker-shadow {
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.marker-cluster {
  background: none !important;
}
.marker-cluster div {
  background: none !important;
}

/* ── Pulse Marker Variants ─────────────────────────────────── */
.pulse-marker-red .pulse-core {
  background: #ff2020;
  box-shadow: 0 0 10px #ff2020;
}
.pulse-marker-red .pulse-ring {
  border-color: #ff2020;
}
.pulse-marker-orange .pulse-core {
  background: #ffa500;
  box-shadow: 0 0 10px #ffa500;
}
.pulse-marker-orange .pulse-ring {
  border-color: #ffa500;
}
.pulse-marker-yellow .pulse-core {
  background: #ffd700;
  box-shadow: 0 0 10px #ffd700;
}
.pulse-marker-yellow .pulse-ring {
  border-color: #ffd700;
}
.pulse-marker .pulse-core {
  width: 10px; height: 10px;
  border-radius: 50%;
  position: absolute;
  top: 5px; left: 5px;
}
.pulse-marker .pulse-ring {
  position: absolute;
  top: 0; left: 0;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid #ff2020;
  animation: pulse-ring 2s infinite;
}
.pulse-marker {
  position: relative;
  width: 20px; height: 20px;
}

/* ── Attack Arrows (dashed animated lines) ─────────────────── */
.attack-line {
  animation: dash-flow 1.5s linear infinite;
}
@keyframes dash-flow {
  to { stroke-dashoffset: -28; }
}

/* ── Map Legend ─────────────────────────────────────────────── */
.map-legend {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 500;
  background: rgba(8, 8, 8, 0.9);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 10px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.map-legend .legend-title {
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 2px;
  text-transform: uppercase;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.legend-dot.red    { background: #ff2020; box-shadow: 0 0 6px #ff2020; }
.legend-dot.orange { background: #ffa500; box-shadow: 0 0 6px #ffa500; }
.legend-dot.yellow { background: #ffd700; box-shadow: 0 0 6px #ffd700; }
.legend-dot.gold   { background: #ffcc00; box-shadow: 0 0 6px #ffcc00; }
.legend-arrow {
  width: 20px;
  height: 2px;
  background: #ff2020;
  position: relative;
  flex-shrink: 0;
}
.legend-arrow::after {
  content: '▶';
  position: absolute;
  right: -8px;
  top: -6px;
  font-size: 8px;
  color: #ff2020;
}

/* ── Language Button (Header) ──────────────────────────────── */
.lang-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.lang-btn:hover {
  border-color: var(--red-primary);
  box-shadow: 0 0 8px var(--red-glow);
  color: #fff;
}

/* ── Language Modal ────────────────────────────────────────── */
.lang-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.lang-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 24px;
  max-width: 520px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}
.lang-modal-content h3 {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--red-primary);
  margin-bottom: 6px;
  letter-spacing: 1px;
}
.lang-modal-content p {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-primary);
  font-size: 12px;
  font-family: var(--font-mono);
}
.lang-option:hover {
  border-color: var(--red-primary);
  background: rgba(255, 32, 32, 0.1);
  box-shadow: 0 0 8px var(--red-glow);
}
.lang-flag {
  font-size: 18px;
}
.lang-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Google Translate Overrides ─────────────────────────────── */
#google_translate_element {
  position: absolute;
  top: -9999px;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}
.goog-te-banner-frame {
  display: none !important;
}
body { top: 0 !important; }
.goog-te-gadget { font-size: 0 !important; }

/* ── FAQ Styles ────────────────────────────────────────────── */
.faq-item {
  margin-bottom: 12px;
  padding: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  border-left: 3px solid var(--amber-accent);
}
.faq-q {
  font-size: 12px;
  color: var(--amber-accent);
  font-weight: 600;
  margin-bottom: 4px;
}
.faq-a {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════
   TIMELINE — War event timeline with severity + date grouping
   ═══════════════════════════════════════════════════════════════ */

/* Filter buttons bar */
.timeline-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.tl-filter-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.5px;
}
.tl-filter-btn:hover {
  border-color: var(--red-primary);
  color: var(--text-primary);
  box-shadow: 0 0 8px var(--red-glow);
}
.tl-filter-btn.active {
  background: var(--red-primary);
  border-color: var(--red-primary);
  color: #fff;
  box-shadow: 0 0 12px var(--red-glow);
}

/* Timeline container */
.timeline-container {
  position: relative;
  padding-left: 32px;
  min-height: 200px;
}
.timeline-line {
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--red-primary) 0%, rgba(255,32,32,0.15) 100%);
  border-radius: 2px;
}

/* Date group header */
.tl-date-group {
  position: relative;
  margin-bottom: 8px;
  margin-top: 20px;
}
.tl-date-group:first-child {
  margin-top: 0;
}
.tl-date-label {
  display: inline-block;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 4px 12px;
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--red-primary);
  text-transform: uppercase;
  position: relative;
  z-index: 2;
}

/* Individual timeline event */
.tl-event {
  position: relative;
  margin-bottom: 16px;
  opacity: 0;
  animation: tl-slide-in 0.4s ease forwards;
}
@keyframes tl-slide-in {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Severity dot on the timeline line */
.tl-dot {
  position: absolute;
  left: -28px;
  top: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  z-index: 3;
  border: 2px solid var(--bg-primary);
}

/* Event card */
.tl-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 14px 16px;
  transition: var(--transition);
  position: relative;
}
.tl-card::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 14px;
  width: 8px;
  height: 8px;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  transform: rotate(45deg);
}
.tl-card:hover {
  border-color: var(--red-primary);
  box-shadow: 0 0 16px rgba(255, 32, 32, 0.1);
  transform: translateY(-1px);
}

/* Card header */
.tl-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.tl-severity {
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 1.5px;
  font-weight: 700;
}
.tl-time {
  font-size: 10px;
  color: var(--text-muted);
}

/* Title (no longer a link — just text) */
.tl-title {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 4px;
}

/* Expandable description (hidden by default, shown on click) */
.tl-desc {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border-left: 2px solid var(--red-primary);
  border-radius: 0 4px 4px 0;
  animation: tl-desc-in 0.25s ease;
}
.tl-desc p {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}
@keyframes tl-desc-in {
  from { opacity: 0; max-height: 0; }
  to   { opacity: 1; max-height: 200px; }
}

/* Card is clickable — cursor pointer */
.tl-card {
  cursor: pointer;
}

/* Tags (shown inline under title) */
.tl-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.tl-tag {
  font-size: 9px;
  color: var(--amber-accent);
  background: rgba(255, 165, 0, 0.1);
  border: 1px solid rgba(255, 165, 0, 0.25);
  padding: 1px 7px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

/* Empty state */
.tl-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Load more */
.timeline-load-more {
  text-align: center;
  padding: 20px 0;
}

/* ── Timeline Sidebar Stats ────────────────────────────────── */
.timeline-stats-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 16px;
}
.timeline-stats-box h4 {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--red-primary);
  letter-spacing: 2px;
  margin-bottom: 16px;
}

/* Severity chart */
.tl-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.tl-chart-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tl-chart-label {
  font-size: 9px;
  font-family: var(--font-display);
  letter-spacing: 1px;
  color: var(--text-secondary);
  width: 72px;
  flex-shrink: 0;
}
.tl-chart-bar-bg {
  flex: 1;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}
.tl-chart-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
  min-width: 2px;
}
.tl-chart-pct {
  font-size: 11px;
  color: var(--text-primary);
  font-weight: 600;
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* Top countries */
.tl-top-title {
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--amber-accent);
  letter-spacing: 1.5px;
  margin-bottom: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}
.tl-top-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tl-top-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: var(--radius);
  transition: var(--transition);
}
.tl-top-item:hover {
  background: var(--bg-tertiary);
}
.tl-top-rank {
  font-size: 9px;
  color: var(--text-muted);
  font-family: var(--font-display);
  letter-spacing: 1px;
  width: 20px;
}
.tl-top-flag {
  font-size: 14px;
}
.tl-top-name {
  font-size: 11px;
  color: var(--text-primary);
  flex: 1;
  text-transform: capitalize;
}
.tl-top-cnt {
  font-size: 11px;
  font-weight: 700;
  color: var(--red-primary);
  background: rgba(255, 32, 32, 0.1);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
}

/* ── Responsive: Country Cards ─────────────────────────────── */
@media (max-width: 768px) {
  .country-grid {
    grid-template-columns: 1fr 1fr;
  }

  .modal-content {
    width: 95%;
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .country-grid {
    grid-template-columns: 1fr;
  }
}