/*
 * Uruguay Homicide Visualization - Main Styles
 * Modern, accessible, data-journalism aesthetic
 * 
 * BACKUP CREATED: 2026-01-07_22-19-41
 * This is a backup of the improved UI state with refined minimalistic design
 */

/* ========== CSS Variables / Design Tokens ========== */
:root {
  /* Colors - Light Mode (refined, softer palette) */
  --color-bg-primary: #fafbfc;
  --color-bg-secondary: #ffffff;
  --color-bg-tertiary: #f1f3f5;
  --color-text-primary: #1a1d29;
  --color-text-secondary: #495057;
  --color-text-muted: #868e96;
  --color-border: #e9ecef;
  --color-border-light: #f1f3f5;

  /* Accent colors - Refined, modern journalistic */
  --color-accent-primary: #2563eb;
  --color-accent-primary-hover: #1d4ed8;
  --color-accent-secondary: #6366f1;
  --color-accent-success: #059669;
  --color-accent-warning: #d97706;
  --color-accent-danger: #dc2626;

  /* Map marker colors by weapon type */
  --marker-firearm: #ef4444;
  --marker-blade: #f97316;
  --marker-blunt: #eab308;
  --marker-other: #6366f1;
  --marker-default: #64748b;

  /* Shadows - Softer, more refined */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 3px 8px -2px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 16px -4px rgba(0, 0, 0, 0.08), 0 4px 8px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 16px 32px -8px rgba(0, 0, 0, 0.12), 0 8px 16px -4px rgba(0, 0, 0, 0.06);

  /* Typography - Improved hierarchy */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.75rem;     /* 12px */
  --font-size-sm: 0.875rem;    /* 14px */
  --font-size-base: 0.9375rem; /* 15px */
  --font-size-lg: 1rem;        /* 16px */
  --font-size-xl: 1.125rem;    /* 18px */
  --font-size-2xl: 1.25rem;    /* 20px */
  --font-size-3xl: 1.5rem;     /* 24px */
  
  /* Font weights */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Layout */
  --header-height: 72px;
  --sidebar-width: 360px;
  --border-radius-sm: 6px;
  --border-radius-md: 10px;
  --border-radius-lg: 14px;
  --border-radius-xl: 18px;

  /* Transitions - Smoother */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-index layers */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 2000;
  --z-tooltip: 500;
}

/* Dark Mode */
[data-theme="dark"] {
  --color-bg-primary: #0f172a;
  --color-bg-secondary: #1e293b;
  --color-bg-tertiary: #1e293b;
  --color-text-primary: #f1f5f9;
  --color-text-secondary: #cbd5e1;
  --color-text-muted: #94a3b8;
  --color-border: #334155;
  --color-border-light: #1e293b;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 3px 8px -2px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 16px -4px rgba(0, 0, 0, 0.5), 0 4px 8px -2px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 16px 32px -8px rgba(0, 0, 0, 0.6), 0 8px 16px -4px rgba(0, 0, 0, 0.4);
}

/* ========== Base Styles ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

/* Focus styles for accessibility */
:focus-visible {
  outline: 2px solid var(--color-accent-primary);
  outline-offset: 2px;
}

/* ========== Stats Bar ========== */
.stats-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  z-index: var(--z-sticky);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .stats-bar {
  background: rgba(30, 41, 59, 0.95);
}

.stats-bar__brand {
  display: flex;
  align-items: center;
  height: 100%;
}

.stats-bar__logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  transition: transform var(--transition-fast);
}

.stats-bar__logo:hover {
  transform: scale(1.05);
}

.stats-bar__icon {
  display: none;
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.stats-bar__stats {
  display: flex;
  gap: var(--space-8);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--border-radius-md);
  background: var(--color-bg-tertiary);
  min-width: 80px;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.stat-item:hover {
  background: var(--color-bg-secondary);
  border-color: var(--color-border);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.stat-item__value {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-accent-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  margin-bottom: 2px;
}

.stat-item__label {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: var(--font-weight-medium);
}

.stat-item--highlight {
  background: #dc2626;
  border-color: #dc2626;
}

.stat-item--highlight .stat-item__value {
  color: white;
}

.stat-item--highlight .stat-item__label {
  color: white;
  font-weight: 600;
  font-size: 0.625rem; /* 10px - reduced by 2px from 12px */
}

.stat-item--highlight:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.stat-item--mobile {
  display: none;
}

.stats-bar__actions {
  display: flex;
  gap: var(--space-3);
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-family: inherit;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  line-height: 1.4;
  color: var(--color-text-primary);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-bg-secondary);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn:hover::before {
  opacity: 1;
}

.btn:hover {
  border-color: var(--color-accent-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  color: white;
  background: var(--color-accent-primary);
  border-color: var(--color-accent-primary);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn--primary::before {
  background: var(--color-accent-primary-hover);
}

.btn--primary:hover {
  background: var(--color-accent-primary-hover);
  border-color: var(--color-accent-primary-hover);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.btn--secondary {
  color: var(--color-accent-primary);
  background: transparent;
  border-color: var(--color-accent-primary);
}

.btn--secondary:hover {
  background: rgba(26, 115, 232, 0.1);
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
}

.btn--ghost:hover {
  background: var(--color-bg-tertiary);
}

.btn--icon {
  padding: var(--space-2);
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-md);
}

.btn--icon:hover {
  background: var(--color-bg-secondary);
  border-color: var(--color-border);
}

.btn--icon svg {
  width: 20px;
  height: 20px;
}

.btn--sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--font-size-xs);
}

.btn--xs {
  padding: var(--space-1) var(--space-2);
  font-size: 0.7rem;
  height: auto;
  width: auto;
}

.btn--icon.btn--xs {
  padding: var(--space-1);
  width: 28px;
  height: 28px;
}

.btn--outline {
  background: transparent;
  border: 1px solid var(--color-accent-primary);
  color: var(--color-accent-primary);
}

.btn--outline:hover {
  background: rgba(26, 115, 232, 0.1);
}

.btn--block {
  width: 100%;
}

.btn--fab {
  position: fixed;
  bottom: calc(var(--space-6) + 60px);
  right: var(--space-6);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-accent-primary);
  color: white;
  border: none;
  box-shadow: var(--shadow-lg);
  z-index: 1100;
  display: none;
}

.btn--fab:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-xl);
}

.btn--fab svg {
  width: 24px;
  height: 24px;
}

.fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 600;
  color: white;
  background: var(--color-accent-danger);
  border-radius: 10px;
  display: none;
}

.fab-badge:not(:empty) {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Theme toggle icons */
.icon--dark {
  display: none;
}

[data-theme="dark"] .icon--light {
  display: none;
}

[data-theme="dark"] .icon--dark {
  display: block;
}

/* ========== Main Layout ========== */
.main-container {
  display: flex;
  margin-top: var(--header-height);
  height: calc(100vh - var(--header-height));
}

/* ========== Filter Panel ========== */
.filter-panel {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100%;
  background: var(--color-bg-secondary);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 20;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.02);
}

.filter-panel__header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-primary);
}

.filter-panel__header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filter-panel__title {
  margin: 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

.btn--close-mobile {
  display: none;
}

.filter-panel__content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Custom scrollbar for filter panel */
.filter-panel__content::-webkit-scrollbar {
  width: 6px;
}

.filter-panel__content::-webkit-scrollbar-track {
  background: transparent;
}

.filter-panel__content::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

.filter-panel__content::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

.filter-panel__footer {
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: var(--color-bg-primary);
}

/* Filter Groups */
.filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.filter-group__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filter-group__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.filter-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
  display: block;
  letter-spacing: -0.01em;
}

/* Date Range Slider */
.date-range-slider {
  margin: var(--space-4) 0;
}

.date-range-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

/* Year Buttons */
.year-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
  margin-bottom: var(--space-2);
}

.year-btn {
  min-width: auto;
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-sm);
}

.year-btn.active {
  background: var(--color-accent-primary);
  color: white;
  border-color: var(--color-accent-primary);
}

.year-btn.active:hover {
  background: var(--color-accent-primary-hover);
  border-color: var(--color-accent-primary-hover);
}

/* noUiSlider custom styles */
.noUi-target {
  background: var(--color-bg-tertiary);
  border: none;
  box-shadow: none;
  height: 6px;
  border-radius: 3px;
}

.noUi-connect {
  background: var(--color-accent-primary);
}

.noUi-handle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--color-accent-primary);
  box-shadow: var(--shadow-md);
  cursor: grab;
  top: -7px;
  right: -9px;
}

.noUi-handle::before,
.noUi-handle::after {
  display: none;
}

.noUi-handle:active {
  cursor: grabbing;
}

/* Multi-select Dropdown */
.multi-select {
  position: relative;
}

.multi-select__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all var(--transition-base);
}

.multi-select__trigger:hover {
  border-color: var(--color-accent-primary);
  background: var(--color-bg-secondary);
  box-shadow: var(--shadow-sm);
}

.multi-select__trigger[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.multi-select__text {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.multi-select__arrow {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.multi-select__trigger[aria-expanded="true"] .multi-select__arrow {
  transform: rotate(180deg);
}

.multi-select__dropdown {
  position: absolute;
  top: calc(100% + var(--space-1));
  left: 0;
  right: 0;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-fast);
}

.multi-select__trigger[aria-expanded="true"]+.multi-select__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.multi-select__search {
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-border-light);
}

.input--search {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
}

.input--search::placeholder {
  color: var(--color-text-muted);
}

.multi-select__options {
  max-height: 200px;
  overflow-y: auto;
  padding: var(--space-2);
}

.multi-select__option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.multi-select__option:hover {
  background: var(--color-bg-tertiary);
}

.multi-select__option[aria-selected="true"] {
  background: rgba(26, 115, 232, 0.1);
}

.multi-select__checkbox {
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-border);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.multi-select__option[aria-selected="true"] .multi-select__checkbox {
  background: var(--color-accent-primary);
  border-color: var(--color-accent-primary);
}

.multi-select__checkbox svg {
  width: 10px;
  height: 10px;
  stroke: white;
  stroke-width: 3;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.multi-select__option[aria-selected="true"] .multi-select__checkbox svg {
  opacity: 1;
}

.multi-select__option-label {
  flex: 1;
  font-size: var(--font-size-sm);
}

.multi-select__option-count {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.multi-select__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-3);
  border-top: 1px solid var(--color-border-light);
}

/* Radio Group */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.radio-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  flex: 1;
  justify-content: center;
}

.radio-option:hover {
  border-color: var(--color-accent-primary);
  background: var(--color-bg-secondary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.radio-option:has(input:checked) {
  background: rgba(37, 99, 235, 0.1);
  border-color: var(--color-accent-primary);
  color: var(--color-accent-primary);
  font-weight: var(--font-weight-semibold);
}

.radio-option input {
  display: none;
}

.radio-option__label {
  font-size: var(--font-size-sm);
}

/* ========== Content Area (Map/Table/Stats) ========== */
.content-area {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.view-tabs {
  display: flex;
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-3) var(--space-5);
  gap: var(--space-2);
  z-index: var(--z-sticky);
  justify-content: center;
}

.view-tab {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--border-radius-md);
  background: transparent;
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
}

.view-tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: var(--space-4);
  right: var(--space-4);
  height: 2px;
  background: var(--color-accent-primary);
  transform: scaleX(0);
  transition: transform var(--transition-base);
}

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

.view-tab.active {
  background: rgba(37, 99, 235, 0.08);
  color: var(--color-accent-primary);
  font-weight: var(--font-weight-semibold);
}

.view-tab.active::after {
  transform: scaleX(1);
}

.view-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.view-content {
  display: none;
  flex: 1;
  overflow: hidden;
  position: relative;
}

.view-content.active {
  display: flex;
  flex-direction: column;
}

.map {
  width: 100%;
  flex: 1;
  height: auto;
}

/* ========== Table View Styles ========== */
.table-card {
  padding: var(--space-4);
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.table-wrapper {
  flex: 1;
  overflow: auto;
  background: var(--color-bg-secondary);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
  text-align: left;
}

.data-table th {
  position: sticky;
  top: 0;
  background: var(--color-bg-tertiary);
  padding: var(--space-3) var(--space-4);
  font-weight: 600;
  color: var(--color-text-secondary);
  border-bottom: 2px solid var(--color-border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.data-table th:hover {
  background: var(--color-border);
}

.data-table th::after {
  content: '↕';
  margin-left: var(--space-1);
  opacity: 0.3;
  font-size: 0.8em;
}

.data-table th.sort-asc::after {
  content: '↑';
  opacity: 1;
  color: var(--color-accent-primary);
}

.data-table th.sort-desc::after {
  content: '↓';
  opacity: 1;
  color: var(--color-accent-primary);
}

.data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text-primary);
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table .table-row-clickable {
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.data-table .table-row-clickable:hover td {
  background: var(--color-bg-tertiary);
}

.data-table tr:hover td {
  background: var(--color-bg-primary);
}

/* Column-specific styles */
.row-location,
.row-address {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-department {
  max-width: 150px;
}

.row-victim-gender,
.row-victim-age {
  text-align: center;
  min-width: 80px;
}

.row-victim-age {
  font-variant-numeric: tabular-nums;
}

.row-id {
  font-weight: 600;
  color: var(--color-text-muted);
  width: 60px;
}

.row-date {
  font-variant-numeric: tabular-nums;
  width: 100px;
}

.row-department {
  width: 120px;
}

.row-location {
  max-width: 180px;
}

.row-victim-gender,
.row-victim-age {
  text-align: center;
  min-width: 80px;
  width: 90px;
}

.row-victim-age {
  font-variant-numeric: tabular-nums;
}

.row-address {
  max-width: 200px;
}

.row-weapon {
  width: 120px;
}

.row-motive {
  width: 120px;
}

.table-empty {
  text-align: center;
  padding: var(--space-12);
  color: var(--color-text-muted);
}

/* ... Leaflet styles unchanged ... */

/* ========== Stats Dashboard ========== */
.stats-dashboard {
  height: 100%;
  width: 100%;
  padding: var(--space-4);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  overflow: hidden;
}

.chart-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  min-height: 0;
  height: 100%;
}

.chart-card__title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border-light);
  flex-shrink: 0;
}

.chart-card__body {
  flex: 1;
  position: relative;
  min-height: 0;
  width: 100%;
}

@media (max-width: 768px) {
  .stats-dashboard {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100%;
    padding: var(--space-2);
    gap: var(--space-3);
  }

  .chart-card {
    min-height: 300px;
    flex-shrink: 0;
  }
}

/* ========== Ad Placeholders ========== */
.ad-banner {
  background: var(--color-bg-tertiary);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hide all ad spaces */
.ad-banner,
.ad-placeholder,
.ad-slot,
#ad-sidebar,
#ad-footer {
  display: none !important;
}

/* Hide donate button */
#btn-open-donate {
  display: none !important;
}

.ad-banner--bottom {
  height: 90px;
  width: 100%;
  flex-shrink: 0;
  z-index: var(--z-sticky);
}

.ad-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 2px dashed var(--color-border);
  margin: var(--space-2);
  border-radius: var(--border-radius-md);
}

.ad-slot--sidebar {
  margin-top: auto;
  padding-top: var(--space-4);
}

.ad-placeholder--vertical {
  height: 250px;
  width: 100%;
}

/* Rate Cluster */
.marker-cluster-rate {
  background-color: rgba(255, 255, 255, 0.95);
  border: 2px solid var(--color-accent-primary);
  color: var(--color-text-primary);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  box-shadow: var(--shadow-md);
  line-height: normal;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  text-align: center;
}

[data-theme="dark"] .marker-cluster-rate {
  background-color: rgba(30, 41, 59, 0.95);
  border-color: var(--color-accent-primary);
  color: var(--color-text-primary);
}

.marker-cluster-rate .rate-value {
  font-weight: 700;
  font-size: 0.9em;
  display: block;
  line-height: 1.2;
  color: var(--color-text-primary);
}

[data-theme="dark"] .marker-cluster-rate .rate-value {
  color: #ffffff;
}

.marker-cluster-rate .rate-label {
  font-size: 0.6em;
  color: var(--color-text-secondary);
  font-weight: 500;
  display: block;
  line-height: 1;
}

[data-theme="dark"] .marker-cluster-rate .rate-label {
  color: rgba(255, 255, 255, 0.8);
}

.leaflet-popup-content {
  margin: 0;
  min-width: 280px;
}

.leaflet-popup-tip {
  background: var(--color-bg-secondary);
}

.popup-card {
  padding: var(--space-4);
}

.popup-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border-light);
}

.popup-card__date {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-accent-primary);
}

.popup-card__location {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.popup-card__details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.popup-card__item {
  display: flex;
  flex-direction: column;
}

.popup-card__label {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.popup-card__value {
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.popup-card__links {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border-light);
}

.popup-card__links a {
  display: inline-block;
  margin-right: var(--space-2);
  font-size: var(--font-size-xs);
  color: var(--color-accent-primary);
  text-decoration: none;
}

.popup-card__links a:hover {
  text-decoration: underline;
}

/* Map Controls */
.map-controls {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 1000;
}

.btn--map-control {
  background: var(--color-bg-secondary);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .btn--map-control {
  background: rgba(30, 41, 59, 0.95);
}

.btn--map-control:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn--map-control.active {
  background: var(--color-accent-primary);
  color: white;
  border-color: var(--color-accent-primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Loading Overlay */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  z-index: var(--z-overlay);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

[data-theme="dark"] .loading-overlay {
  background: rgba(15, 23, 42, 0.9);
}

.loading-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ========== Ad Placeholders ========== */
.ad-banner--bottom {
  height: 90px;
  width: 100%;
  flex-shrink: 0;
  z-index: var(--z-sticky);
}

.ad-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.ad-placeholder--vertical {
  height: 250px;
  border: 1px dashed var(--color-border);
  border-radius: var(--border-radius-md);
}

.ad-slot--sidebar {
  margin-top: auto;
}

.ad-banner--bottom-mobile {
  display: none;
}

/* ========== Custom Markers ========== */
.marker-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family);
  font-weight: 600;
  color: white;
  border-radius: 50%;
  box-shadow: var(--shadow-md);
}

.marker-cluster-small {
  background: rgba(100, 116, 139, 0.9);
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.marker-cluster-medium {
  background: rgba(234, 179, 8, 0.9);
  width: 40px;
  height: 40px;
  font-size: 13px;
}

.marker-cluster-large {
  background: rgba(239, 68, 68, 0.9);
  width: 48px;
  height: 48px;
  font-size: 14px;
}

/* ========== Responsive Design ========== */
@media (max-width: 1024px) {
  .stats-bar__stats {
    gap: var(--space-4);
  }

  .stat-item {
    padding: var(--space-1) var(--space-3);
  }

  .stat-item__value {
    font-size: var(--font-size-lg);
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 100%;
  }

  .stats-bar {
    padding: 0 var(--space-4);
    justify-content: space-between;
  }

  .stats-bar__logo {
    display: none;
  }

  .stats-bar__icon {
    display: block;
  }

  .stats-bar__stats {
    display: none;
  }

  .stats-bar__brand {
    flex-shrink: 0;
    position: absolute;
    left: var(--space-4);
  }

  .stat-item--mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-2) var(--space-3);
    min-width: 100px;
    margin: 0 auto;
    flex: 0 1 auto;
    flex-grow: 0;
    max-width: 140px;
  }

  .stats-bar__actions {
    position: absolute;
    right: var(--space-4);
  }

  .stat-item--mobile .stat-item__value {
    font-size: var(--font-size-lg);
  }

  .stat-item--mobile .stat-item__label {
    font-size: var(--font-size-xs);
    white-space: nowrap;
    text-align: center;
  }

  .stat-item--mobile.stat-item--highlight .stat-item__label {
    font-size: 0.625rem; /* 10px - reduced by 2px from 12px */
  }

  .stats-bar__actions {
    gap: var(--space-2);
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }

  .main-container {
    flex-direction: column;
  }

  .filter-panel {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-modal);
    transform: translateY(100%);
    transition: transform var(--transition-slow);
    border-right: none;
    border-top-left-radius: var(--border-radius-xl);
    border-top-right-radius: var(--border-radius-xl);
  }

  .filter-panel.open {
    transform: translateY(0);
  }

  .btn--close-mobile {
    display: flex;
  }

  .btn--fab {
    display: flex;
    z-index: 1100;
    position: fixed;
  }

  .ad-banner--top {
    display: none;
  }

  .ad-banner--bottom-mobile {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    z-index: var(--z-sticky);
  }

  .ad-close {
    position: absolute;
    right: var(--space-2);
    top: 50%;
    transform: translateY(-50%);
  }

  .content-area {
    height: calc(100vh - var(--header-height) - 50px);
  }

  .table-card {
    padding: var(--space-2);
  }

  .data-table th,
  .data-table td {
    padding: var(--space-2) var(--space-2);
  }
}

@media (max-width: 480px) {
  .stats-bar__title {
    font-size: var(--font-size-base);
  }

  .stats-bar__subtitle {
    display: none;
  }
}

/* ========== Accessibility ========== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --color-border: #000;
    --color-text-muted: #333;
  }

  [data-theme="dark"] {
    --color-border: #fff;
    --color-text-muted: #ccc;
  }
}

/* Print styles */
@media print {
  .stats-bar,
  .filter-panel,
  .map-controls,
  .ad-banner,
  .btn--fab {
    display: none !important;
  }

  .main-container {
    margin-top: 0;
  }

  .map-container {
    height: 100vh;
  }
}

/* ========== Share Modal ========== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  backdrop-filter: blur(8px);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--color-bg-secondary);
  border-radius: var(--border-radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  transform: translateY(20px) scale(0.95);
  transition: transform var(--transition-base), opacity var(--transition-base);
  opacity: 0;
  overflow: hidden;
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal__header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-bg-primary);
}

.modal__title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
  margin: 0;
}

.modal__body {
  padding: var(--space-6);
  overflow-y: auto;
}

.modal__body::-webkit-scrollbar {
  width: 6px;
}

.modal__body::-webkit-scrollbar-track {
  background: transparent;
}

.modal__body::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

.modal__body::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* ========== Homicide Detail Modal ========== */
.homicide-detail-body {
  padding: var(--space-6);
}

.homicide-detail-section {
  margin-bottom: var(--space-6);
}

.homicide-detail-section:last-child {
  margin-bottom: 0;
}

.homicide-detail-section__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--color-border);
}

.homicide-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.homicide-detail-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.homicide-detail-item--full {
  grid-column: 1 / -1;
}

.homicide-detail-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.homicide-detail-value {
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  word-break: break-word;
}

.share-preview {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--color-bg-tertiary);
  border-radius: var(--border-radius-md);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.share-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.share-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.share-socials {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.btn--social {
  justify-content: center;
  font-size: var(--font-size-sm);
}

/* ========== Donation Modal ========== */
.modal--donate {
  max-width: 520px;
  overflow: visible;
  position: relative;
}

.modal--donate .donate-body {
  overflow: visible;
  max-height: none;
}

.modal--donate .donate-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  z-index: 10;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
}

[data-theme="dark"] .modal--donate .donate-close {
  background: rgba(30, 41, 59, 0.95);
}

.modal--donate .donate-close:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.1);
}

[data-theme="dark"] .modal--donate .donate-close:hover {
  background: rgba(51, 65, 85, 1);
}

.donate-hero {
  background: linear-gradient(135deg, #c44569 0%, #b4385e 50%, #9d2f4f 100%);
  padding: var(--space-5) var(--space-4) var(--space-4);
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.donate-hero::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -15%;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.donate-hero::after {
  content: '';
  position: absolute;
  bottom: -25%;
  left: -8%;
  width: 150px;
  height: 150px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  pointer-events: none;
}

.donate-hero__icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-2);
  animation: pulse 2s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  position: relative;
  z-index: 1;
}

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

.donate-hero__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 var(--space-2) 0;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 1;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.donate-hero__credit {
  font-size: var(--font-size-xs);
  opacity: 0.85;
  margin: 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 400;
}

.donate-body {
  padding: var(--space-4);
}

.donate-quick {
  margin-bottom: var(--space-4);
}

.donate-quick__label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
  text-align: center;
}

.donate-quick__buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.donate-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--border-radius-md);
  text-decoration: none;
  transition: all var(--transition-base);
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
  text-align: center;
  min-height: 80px;
}

.donate-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.donate-btn:hover::before {
  left: 100%;
}

.donate-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.donate-btn__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.donate-btn__label {
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: white;
}

.donate-btn__sublabel {
  font-size: var(--font-size-xs);
  opacity: 0.9;
  color: white;
}

.donate-btn--patreon {
  background: linear-gradient(135deg, #ff424d 0%, #ff7854 100%);
  box-shadow: 0 2px 8px rgba(255, 66, 77, 0.25);
}

.donate-btn--patreon:hover {
  background: linear-gradient(135deg, #e63946 0%, #ff6b47 100%);
  box-shadow: 0 4px 12px rgba(255, 66, 77, 0.35);
  border-color: rgba(255, 255, 255, 0.2);
}

.donate-btn--paypal {
  background: linear-gradient(135deg, #0070ba 0%, #009cde 100%);
  box-shadow: 0 2px 8px rgba(0, 112, 186, 0.25);
}

.donate-btn--paypal:hover {
  background: linear-gradient(135deg, #005ea6 0%, #0085c8 100%);
  box-shadow: 0 4px 12px rgba(0, 112, 186, 0.35);
  border-color: rgba(255, 255, 255, 0.2);
}

.donate-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: var(--space-4) 0 var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-weight: 500;
}

.donate-divider::before,
.donate-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--color-border);
}

.donate-divider span {
  padding: 0 var(--space-3);
  background: var(--color-bg-secondary);
}

.crypto-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.crypto-card {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  padding: var(--space-3);
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.crypto-card:hover {
  border-color: var(--color-accent-primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.crypto-icon {
  font-size: 1.25rem;
  font-weight: 700;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-sm);
  flex-shrink: 0;
}

.crypto-icon--btc {
  background: linear-gradient(135deg, #f7931a 0%, #ffb347 100%);
  color: white;
}

.crypto-icon--eth {
  background: linear-gradient(135deg, #627eea 0%, #8fa4f3 100%);
  color: white;
}

.crypto-icon--sol {
  background: linear-gradient(135deg, #14f195 0%, #9945ff 100%);
  color: white;
}

.crypto-card__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.crypto-card__info {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.crypto-card__name {
  font-weight: 600;
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
}

.crypto-card__symbol {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.crypto-card__address {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.crypto-input {
  flex: 1;
  padding: var(--space-1) var(--space-2);
  font-size: var(--font-size-xs);
  font-family: 'Courier New', monospace;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  color: var(--color-text-primary);
  outline: none;
  cursor: text;
  min-width: 0;
}

.crypto-input:focus {
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

.crypto-copy {
  padding: var(--space-1) var(--space-2);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  width: 28px;
  height: 28px;
}

.crypto-copy:hover {
  background: var(--color-accent-primary);
  border-color: var(--color-accent-primary);
  color: white;
  transform: scale(1.05);
}

.crypto-copy:active {
  transform: scale(0.95);
}

.crypto-copy.copied {
  background: #10b981;
  border-color: #10b981;
  color: white;
}

