/* ── Light Theme ── */
body.light {
  --bg: #f5f5f0;
  --surface: #ffffff;
  --surface2: #f0ede6;
  --surface3: #e8e4db;
  --border: #d4cfc4;
  --text: #1a1a1a;
  --text-dim: #6b6b6b;
  --text-muted: #b0b0b0;
  --accent: #9a7b2d;
  --accent-dim: rgba(154,123,45,0.10);
  --green: #1a8a46;
  --green-bright: #22a855;
  --green-dim: rgba(34,168,85,0.08);
  --red: #cc3333;
  --red-dim: rgba(204,51,51,0.08);
  --orange: #c06010;
  --orange-dim: rgba(192,96,16,0.08);
  --blue: #2272b0;
  --blue-dim: rgba(34,114,176,0.08);
  --purple: #7a3d96;
  --purple-dim: rgba(122,61,150,0.08);
  --cyan: #148a72;
  --cyan-dim: rgba(20,138,114,0.06);
  --pink: #c43070;
  --pink-dim: rgba(196,48,112,0.06);
}

body.light .header {
  background: linear-gradient(135deg, #f5f5f0 0%, #e8e4db 50%, #f0ede6 100%);
}

body.light .header::before {
  background: radial-gradient(ellipse at center, rgba(154,123,45,0.06) 0%, transparent 70%);
}

body.light .search-bar {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
}

body.light .txt-full {
  background: rgba(0,0,0,0.04);
  border-color: var(--border);
  color: #333;
}

body.light .leaflet-popup-content-wrapper {
  background: #ffffff !important;
  border-color: #d4cfc4 !important;
  color: #1a1a1a !important;
}

body.light .leaflet-popup-tip {
  background: #ffffff !important;
}

/* ── Theme Toggle Button ── */
.theme-toggle {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 10;
  background: rgba(201,168,76,0.12);
  border: 1px solid rgba(201,168,76,0.3);
  color: var(--accent);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 1.1rem;
  line-height: 1;
  transition: all 0.2s;
}

.theme-toggle:hover {
  background: rgba(201,168,76,0.25);
  border-color: var(--accent);
}

body.light .theme-toggle {
  background: rgba(154,123,45,0.10);
  border-color: rgba(154,123,45,0.3);
}

/* ═══════════════ Deep Search Target (light mode) ═══════════════ */
body.light .search-target .tl-body {
  border-color: var(--accent) !important;
  box-shadow: 0 0 24px rgba(154,123,45,0.18), 0 0 0 2px var(--accent);
  background: rgba(154,123,45,0.06);
}
body.light .search-target .tl-body::before {
  color: var(--accent);
  background: rgba(154,123,45,0.12);
}

/* ═══════════════ Categorization Dashboard (shared) ═══════════════ */

.siren-cats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 500px) {
  .siren-cats { grid-template-columns: 1fr; }
}

.siren-cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}

.siren-cat-card .cat-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.siren-cat-card .cat-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}

.cat-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.72rem;
}

.cat-bar-label {
  min-width: 80px;
  color: var(--text-dim);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-bar-track {
  flex: 1;
  height: 18px;
  background: var(--surface2);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.cat-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 6px;
  font-size: 0.6rem;
  font-weight: 700;
  color: #fff;
  min-width: 20px;
}

.cat-type-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cat-pill {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

.cat-pill .pill-num {
  font-size: 1.2rem;
  display: block;
  line-height: 1;
  margin-bottom: 2px;
}

.cat-timeline {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 50px;
  direction: ltr;
}

.cat-tbar {
  flex: 1;
  background: var(--red);
  border-radius: 2px 2px 0 0;
  min-width: 4px;
  position: relative;
  transition: opacity 0.2s;
}

.cat-tbar:hover { opacity: 0.7; }

.cat-tlabels {
  display: flex;
  justify-content: space-between;
  font-size: 0.58rem;
  color: var(--text-dim);
  margin-top: 4px;
  direction: ltr;
}

.siren-list-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-dim);
  margin: 16px 0 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.cat-filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.cat-filter-btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-dim);
  transition: all 0.2s;
}

.cat-filter-btn:hover {
  border-color: var(--text-dim);
  color: var(--text);
}

.cat-filter-btn.active {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-dim);
}

/* ═══════════════ Siren Map (shared) ═══════════════ */

.auto-siren-map {
  width: 100%;
  height: 420px;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.siren-map-title {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.leaflet-popup-content-wrapper {
  background: var(--surface, #0f1520) !important;
  color: var(--text, #dfe6ee) !important;
  border: 1px solid var(--border, #1e2d3d) !important;
  border-radius: 8px !important;
  font-family: 'Noto Kufi Arabic', sans-serif !important;
}

.leaflet-popup-tip {
  background: var(--surface, #0f1520) !important;
}

.leaflet-popup-content {
  font-size: 0.78rem !important;
  direction: rtl !important;
}

.siren-pulse {
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(231,76,60,0.5); }
  70% { box-shadow: 0 0 0 12px rgba(231,76,60,0); }
  100% { box-shadow: 0 0 0 0 rgba(231,76,60,0); }
}

/* ═══════════════ Map Fullscreen ═══════════════ */
.map-fs-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1001;
  background: rgba(15,21,32,0.9);
  border: 1px solid rgba(30,45,61,0.8);
  color: #dfe6ee;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 1rem;
  line-height: 1;
  transition: all 0.2s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.map-fs-btn:hover {
  background: rgba(201,168,76,0.2);
  color: #c9a84c;
  border-color: #c9a84c;
}

.map-fs-btn.fs-active {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 10001;
  background: rgba(15,21,32,0.95);
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
}

.siren-row.highlighted {
  border-color: var(--red) !important;
  background: var(--red-dim) !important;
}

/* ═══════════════ Day Summary Hero ═══════════════ */
.day-hero {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  padding: 14px 20px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.hero-chip {
  padding: 6px 14px; border-radius: 8px;
  font-size: 0.78rem; font-weight: 700; white-space: nowrap;
}

/* ═══════════════ Prev/Next Navigation ═══════════════ */
.day-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 16px; background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.day-nav-btn {
  text-decoration: none; padding: 6px 14px; border-radius: 8px;
  font-size: 0.75rem; font-weight: 600; font-family: inherit;
  border: 1px solid var(--border); background: var(--surface3);
  color: var(--text-dim); transition: all 0.2s; cursor: pointer;
}
.day-nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.day-nav-btn.disabled { opacity: 0.3; pointer-events: none; }
.day-nav-current {
  font-size: 0.72rem; color: var(--text-dim);
}

/* ═══════════════ Combined Heatmap ═══════════════ */
.heatmap-strip {
  display: flex; gap: 1px; height: 24px; border-radius: 6px;
  overflow: hidden; margin: 12px 0;
  direction: ltr;
}
.heatmap-strip div {
  flex: 1; position: relative; transition: opacity 0.2s;
}
.heatmap-strip div:hover { opacity: 0.7; }
.heatmap-labels {
  display: flex; justify-content: space-between;
  font-size: 0.55rem; color: var(--text-dim);
  direction: ltr;
}
.heatmap-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 16px; margin-bottom: 16px;
}
.heatmap-card .hm-title {
  font-size: 0.75rem; font-weight: 700; color: var(--text-dim);
  margin-bottom: 6px;
}

/* ═══════════════ Action Buttons ═══════════════ */
.action-bar {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
  padding: 10px 16px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.action-btn {
  padding: 6px 14px; border-radius: 8px; font-size: 0.72rem;
  font-weight: 600; font-family: inherit; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface2);
  color: var(--text-dim); transition: all 0.2s; text-decoration: none;
}
.action-btn:hover { border-color: var(--accent); color: var(--accent); }
.action-btn.copied { border-color: var(--green); color: var(--green); }

/* ═══════════════ Bayanat Map ═══════════════ */
.auto-bayan-map {
  width: 100%; height: 380px; border-radius: 12px;
  border: 1px solid var(--border); margin-bottom: 16px;
}

/* ═══════════════ Print Styles ═══════════════ */
@media print {
  .header, .stats, .day-hero, .day-nav, .action-bar, .tabs, .search-bar,
  .cat-filter-bar, .theme-toggle, .home-btn, .footer { break-inside: avoid; }
  .tab-content { display: block !important; page-break-before: always; }
  .auto-siren-map, .auto-bayan-map, #sirenMap { display: none; }
  body { background: #fff; color: #000; }
  .bayan, .siren-row, .enemy-row, .iran-card, .vid-card, .ally-card {
    background: #f9f9f9; border-color: #ddd;
  }
}
