/* ── 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;
}

/* ═══════════════ 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,
.cat-tbar:focus-visible { opacity: 0.85; outline: none; }
.cat-tbar:focus-visible { box-shadow: 0 0 0 2px var(--accent, #3498db); }

.cat-tbar-tooltip {
  position: absolute;
  z-index: 9999;
  pointer-events: none;
  min-width: 120px;
  padding: 8px 12px;
  background: rgba(20, 24, 32, 0.96);
  color: #f5f7fa;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  font-family: inherit;
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: center;
  direction: rtl;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.cat-tbar-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.cat-tbar-tooltip-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  color: #9fb3c8;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
  direction: ltr;
}
.cat-tbar-tooltip-count {
  font-weight: 600;
  font-size: 0.82rem;
}
.cat-tbar-tooltip-num {
  display: inline-block;
  margin-left: 4px;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
}

body.light .cat-tbar-tooltip {
  background: rgba(255, 255, 255, 0.98);
  color: #1a2230;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
body.light .cat-tbar-tooltip-time { color: #5d6b7c; }
body.light .cat-tbar-tooltip-num { color: #0b1320; }

.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;
}

.map-sat-btn {
  position: absolute;
  top: 50px;
  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: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1;
  transition: all 0.2s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

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

.map-sat-btn.sat-active {
  background: rgba(201,168,76,0.25);
  color: #c9a84c;
  border-color: #c9a84c;
}

/* ═══════════════ Map info drawer (Option B — slide-in) ═══════════════ */
.map-panel-btn,
.map-mode-btn {
  position: absolute;
  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: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1;
  transition: all 0.2s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.map-panel-btn { top: 90px; font-size: 1rem; font-weight: 900; }
.map-mode-btn  { top: 130px; }
.map-panel-btn:hover,
.map-mode-btn:hover {
  background: rgba(201,168,76,0.2);
  color: #c9a84c;
  border-color: #c9a84c;
}
.map-panel-btn.active,
.map-mode-btn.dot-mode {
  background: rgba(201,168,76,0.25);
  color: #c9a84c;
  border-color: #c9a84c;
}

.map-drawer {
  position: absolute;
  top: 10px;
  left: 10px;
  bottom: 10px;
  width: 240px;
  max-width: calc(100% - 60px);
  background: rgba(15,21,32,0.95);
  border: 1px solid rgba(30,45,61,0.9);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.75rem;
  color: #dfe6ee;
  direction: ltr;
  text-align: left;
  transform: translateX(-120%);
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
  z-index: 1000;
  overflow-y: auto;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.map-drawer.open { transform: translateX(0); }
.map-drawer h3 {
  margin: 0 0 8px;
  font-size: 0.78rem;
  color: #c9a84c;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(30,45,61,0.9);
  font-weight: 800;
}
.map-drawer .legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 3px 0;
  font-size: 0.72rem;
}
.map-drawer .legend-row .sw {
  width: 18px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.15);
}
.map-drawer-list {
  margin-top: 6px;
  font-size: 0.7rem;
}
.map-drawer-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 4px;
  border-radius: 3px;
  cursor: pointer;
  gap: 8px;
}
.map-drawer-row:hover {
  background: rgba(201,168,76,0.08);
}
.map-drawer-row .n {
  color: #6b7d92;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.68rem;
}

/* Permanent center tooltip for polygons/markers */
.poly-label {
  background: rgba(15,21,32,0.85);
  color: #fff;
  border: 1px solid rgba(201,168,76,0.45);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.6rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.poly-label .c {
  color: #c9a84c;
  margin-inline-start: 4px;
}
.leaflet-tooltip.poly-wrap {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}
.leaflet-tooltip.poly-wrap::before { display: none; }

.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 (merged into .header .date-row — see report.css) ═══════════════ */

/* ═══════════════ 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, .nav-theme-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;
  }
  .download-btn { display: none !important; }
}

/* ═══════════════ Download Button ═══════════════ */
/* Shared button used by pdf-button.js and excel-button.js across report,
   timeline, monthly, and analytics pages. */
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #000;
  font-family: 'Noto Kufi Arabic', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 9px 16px;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(201, 168, 76, 0.22);
  transition: transform 0.15s, box-shadow 0.15s;
}
.download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(201, 168, 76, 0.32);
}
.download-btn:active { transform: translateY(0); }
.download-btn:disabled { opacity: 0.6; cursor: wait; }
.download-btn svg { flex-shrink: 0; }

body.light .download-btn {
  box-shadow: 0 3px 10px rgba(201, 168, 76, 0.18);
}
