/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Color Palette */
  --primary-color: #002a59;
  --primary-dark: #002a59;
  --secondary-color: #64748b;
  --accent-color: #f59e0b;
  --background-color: #f8fafc;
  --surface-color: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --shadow-light: 0 1px 3px 0 rgba(0, 0, 0, 0.1),
    0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-medium: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-large: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Grade Colors */
  --excellent-color: #248d04ff;
  --very-good-color: #94b910ff;
  --good-color: #f5de0bff;
  --satisfactory-color: #f97316;
  --needs-improvement-color: #ef4444ff;

  /* Responsive Breakpoints */
  --mobile-breakpoint: 768px;
  --tablet-breakpoint: 1024px;
  --desktop-breakpoint: 1280px;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background-color: var(--background-color);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Header Styles */
.header {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 50%,
    #002a59 100%
  );
  color: white;
  padding: var(--spacing-lg) var(--spacing-xl);
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.25), 0 8px 32px rgba(0, 0, 0, 0.12);
  position: fixed;
  top: 0;
  left: 380px;
  right: 0;
  z-index: 1000;
  height: 85px;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 50%,
    rgba(255, 255, 255, 0.02) 100%
  );
  pointer-events: none;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 100%;
  position: relative;
  z-index: 2;
  height: 100%;
}

.header-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}

.title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  letter-spacing: -0.02em;
  transition: transform 0.3s ease;
  line-height: 1.2;
}

.title:hover {
  transform: translateY(-1px);
}

.title i {
  font-size: 1.6rem;
  background: linear-gradient(45deg, #fbbf24, #f59e0b);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(251, 191, 36, 0.3));
  animation: pulse-icon 3s ease-in-out infinite;
}

.header-logo {
  height: 2.5rem;
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  transition: transform 0.3s ease;
  animation: pulse-logo 3s ease-in-out infinite;
}

.header-logo:hover {
  transform: scale(1.05);
}

@keyframes pulse-logo {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

@keyframes pulse-icon {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.subtitle {
  font-size: 0.85rem;
  opacity: 0.9;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.01em;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(255, 255, 255, 0.7) 100%
  );
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.3;
  margin-top: 0;
}

.theme-toggle {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: var(--spacing-sm);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.2rem;
  width: 44px;
  height: 44px;
  margin-right: var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px) scale(1.05);
}

.theme-toggle:active {
  transform: translateY(0) scale(0.95);
}

.theme-toggle i {
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
}

.menu-toggle {
  display: none !important;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: var(--spacing-sm);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.2rem;
  width: 44px;
  height: 44px;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* Sidebar Styles */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 380px;
  height: 100vh;
  background: var(--surface-color);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  z-index: 999;
  box-shadow: var(--shadow-medium);
  transition: transform 0.3s ease;
}

.sidebar-content {
  padding: var(--spacing-lg);
  margin-top: 0;
}

.sidebar-content > *:first-child {
  margin-top: 0;
}

/* Ensure map controls are below sidebar on mobile */
.leaflet-control-container {
  z-index: 900;
}

.leaflet-control-zoom {
  z-index: 900 !important;
}

/* Mobile Sidebar Close Button */
.sidebar-mobile-header {
  display: none;
  padding: var(--spacing-lg);
  background: var(--primary-color);
  color: white;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  align-items: center;
  justify-content: space-between;
}

.sidebar-mobile-header h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.sidebar-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: var(--spacing-sm);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.1rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.sidebar h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--spacing-md);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.sidebar h3 i {
  color: var(--primary-color);
}

/* Search Section */
.search-section {
  margin-bottom: var(--spacing-xl);
}

.search-input-container {
  position: relative;
}

.search-input {
  width: 100%;
  padding: var(--spacing-md) var(--spacing-md) var(--spacing-md) 2.5rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: var(--surface-color);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-icon {
  position: absolute;
  left: var(--spacing-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}

/* Filters Section */
.filters-section {
  margin-bottom: var(--spacing-xl);
}

.filter-group {
  margin-bottom: var(--spacing-lg);
}

.filter-group label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.dual-range-slider {
  position: relative;
  margin: var(--spacing-lg) 0 var(--spacing-md) 0;
}

.range-track {
  height: 8px;
  background: linear-gradient(
    to right,
    var(--needs-improvement-color) 0%,
    var(--needs-improvement-color) 55.56%,
    var(--satisfactory-color) 55.56%,
    var(--satisfactory-color) 66.67%,
    var(--good-color) 66.67%,
    var(--good-color) 77.78%,
    var(--very-good-color) 77.78%,
    var(--very-good-color) 88.89%,
    var(--excellent-color) 88.89%,
    var(--excellent-color) 100%
  );
  border-radius: 4px;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.range-progress {
  height: 100%;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  position: absolute;
  transition: all 0.2s ease;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.range-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background: transparent !important;
  pointer-events: none;
  appearance: none;
  margin: 0;
  outline: none;
}

.range-input::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  background: white;
  border: 3px solid var(--primary-color);
  border-radius: 50%;
  cursor: pointer;
  pointer-events: all;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  position: relative;
  margin-top: -7px;
}

.range-input::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.range-input::-webkit-slider-thumb:active {
  transform: scale(1.1);
}

.range-input::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: white;
  border: 3px solid var(--primary-color);
  border-radius: 50%;
  cursor: pointer;
  pointer-events: all;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  margin-top: -7px;
}

.range-input::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.range-input::-moz-range-track {
  background: transparent !important;
  border: none;
  height: 0;
}

.range-input::-webkit-slider-runnable-track {
  background: transparent !important;
  border: none;
  height: 0;
}

.range-input::-ms-track {
  background: transparent !important;
  border-color: transparent;
  color: transparent;
}

.range-input::-ms-fill-lower,
.range-input::-ms-fill-upper {
  background: transparent !important;
}

.range-min {
  z-index: 1;
}

.range-max {
  z-index: 2;
}

.range-values {
  text-align: center;
  margin-top: var(--spacing-md);
}

.range-value-display {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-dark)
  );
  color: white;
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: var(--radius-lg);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-block;
  box-shadow: var(--shadow-light);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.filter-select {
  width: 100%;
  padding: var(--spacing-md);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  background: var(--surface-color);
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.reset-filters {
  width: 100%;
  padding: var(--spacing-md);
  background: transparent;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
}

.reset-filters:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: rgba(37, 99, 235, 0.05);
}

/* Legend Section */
.legend-section {
  margin-bottom: var(--spacing-xl);
}

.legend-items {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-light);
}

.legend-color.excellent {
  background-color: var(--excellent-color);
}
.legend-color.very-good {
  background-color: var(--very-good-color);
}
.legend-color.good {
  background-color: var(--good-color);
}
.legend-color.satisfactory {
  background-color: var(--satisfactory-color);
}
.legend-color.needs-improvement {
  background-color: var(--needs-improvement-color);
}

.legend-item span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Stats Section */
.stats-section {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
  margin-top: var(--spacing-lg);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: var(--spacing-md);
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: var(--spacing-xs);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Main Content */
.main-content {
  margin-left: 380px;
  padding-top: 85px;
  height: 100vh;
  position: relative;
}

.map-container {
  width: 100%;
  height: 100%;
  position: relative;
}

/* Loading Spinner */
.loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  padding: var(--spacing-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-large);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto var(--spacing-md);
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-spinner p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Mobile Bottom Panel */
.mobile-bottom-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface-color);
  border-top: 1px solid var(--border-color);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 1001;
  max-height: 70vh;
  overflow-y: auto;
  display: none;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.mobile-bottom-panel.active {
  transform: translateY(0);
}

.panel-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--background-color);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.panel-header h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.close-panel {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease;
}

.close-panel:hover {
  background: var(--background-color);
}

.panel-content {
  padding: var(--spacing-lg);
}

/* Mobile School Info Styles */
.mobile-school-info {
  font-family: "Inter", sans-serif;
}

.mobile-school-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: var(--spacing-lg);
  color: var(--text-primary);
  line-height: 1.4;
  padding-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--border-color);
}

.mobile-school-details {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.mobile-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md);
  background: var(--background-color);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.mobile-info-row.highlight {
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.05) 0%,
    rgba(37, 99, 235, 0.1) 100%
  );
  border-color: var(--primary-color);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
}

.mobile-info-label {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.9rem;
  flex: 1;
  margin-right: var(--spacing-md);
}

.mobile-info-value {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
  text-align: right;
  flex-shrink: 0;
}

/* Grade colors for mobile */
.mobile-info-value.grade-excellent {
  color: var(--excellent-color);
  font-weight: 700;
}
.mobile-info-value.grade-very-good {
  color: var(--very-good-color);
  font-weight: 700;
}
.mobile-info-value.grade-good {
  color: var(--good-color);
  font-weight: 700;
}
.mobile-info-value.grade-satisfactory {
  color: var(--satisfactory-color);
  font-weight: 700;
}
.mobile-info-value.grade-needs-improvement {
  color: var(--needs-improvement-color);
  font-weight: 700;
}

/* Floating Action Button */
.fab {
  position: fixed;
  bottom: var(--spacing-xl);
  right: var(--spacing-xl);
  width: 56px;
  height: 56px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-large);
  transition: all 0.3s ease;
  z-index: 1000;
  display: none !important;
}

.fab:hover {
  transform: scale(1.1);
  background: var(--primary-dark);
}

.fab:active {
  transform: scale(0.95);
}

/* Custom Leaflet Styles */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-large);
}

.leaflet-popup-content {
  margin: var(--spacing-md);
  font-family: inherit;
}

.leaflet-control-zoom {
  border: none !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-medium) !important;
}

.leaflet-control-zoom a {
  border: none !important;
  color: var(--text-primary) !important;
  font-weight: 600 !important;
}

.leaflet-control-zoom a:hover {
  background: var(--primary-color) !important;
  color: white !important;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .header {
    left: 320px;
  }

  .sidebar {
    width: 320px;
  }

  .main-content {
    margin-left: 320px;
  }
}

@media (max-width: 768px) {
  .header {
    padding: var(--spacing-md) var(--spacing-lg);
    height: 75px;
    left: 0;
  }

  .title {
    font-size: 1.25rem;
  }

  .subtitle {
    font-size: 0.8rem;
  }

  .theme-toggle {
    margin-right: var(--spacing-sm);
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }

  .menu-toggle {
    display: none !important;
  }

  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    box-shadow: none;
    top: 0;
    height: 100vh;
    padding-top: 0;
  }

  .sidebar-mobile-header {
    display: flex;
  }

  .sidebar.active {
    transform: translateX(0);
    box-shadow: var(--shadow-large);
    z-index: 1001;
  }

  .main-content {
    margin-left: 0;
    padding-top: 75px;
  }

  .fab {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .mobile-bottom-panel {
    display: block;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .sidebar-content {
    padding: var(--spacing-md);
  }

  .search-input,
  .filter-select,
  .reset-filters {
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .search-input {
    padding-left: 2.25rem;
  }

  .dual-range-slider {
    margin: var(--spacing-md) 0 var(--spacing-sm) 0;
  }

  .range-value-display {
    font-size: 0.8rem;
    padding: var(--spacing-xs) var(--spacing-sm);
  }

  .range-input::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    margin-top: -6px;
  }

  .range-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    margin-top: -6px;
  }

  /* Hide desktop popups on mobile */
  .leaflet-popup {
    display: none !important;
  }

  .leaflet-popup-pane {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .header {
    padding: var(--spacing-sm) var(--spacing-md);
    height: 70px;
    left: 0;
  }

  .title {
    font-size: 1.1rem;
    gap: var(--spacing-sm);
  }

  .title i {
    font-size: 1.4rem;
  }

  .header-logo {
    height: 1.8rem;
  }

  .theme-toggle {
    margin-right: var(--spacing-xs);
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .subtitle {
    font-size: 0.75rem;
  }

  .sidebar {
    width: 100%;
    top: 0;
    height: 100vh;
    padding-top: 0;
  }

  .sidebar-mobile-header {
    display: flex;
  }

  .main-content {
    padding-top: 70px;
  }

  .fab {
    display: flex !important;
    align-items: center;
    justify-content: center;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 48px;
    height: 48px;
    font-size: 1rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
  }

  .stat-number {
    font-size: 1.25rem;
  }

  .stat-label {
    font-size: 0.7rem;
  }

  .dual-range-slider {
    margin: var(--spacing-sm) 0 var(--spacing-xs) 0;
  }

  .range-value-display {
    font-size: 0.75rem;
    padding: 2px var(--spacing-sm);
  }

  .range-input::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    margin-top: -5px;
  }

  .range-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    margin-top: -5px;
  }
}

/* Dark mode support */
[data-theme="dark"] {
  --background-color: #0f172a;
  --surface-color: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border-color: #334155;
  --primary-color: #3b82f6;
  --primary-dark: #2563eb;
  --shadow-light: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-medium: 0 4px 6px -1px rgba(0, 0, 0, 0.4),
    0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-large: 0 20px 25px -5px rgba(0, 0, 0, 0.6),
    0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .loading-spinner {
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid var(--border-color);
}

[data-theme="dark"] .stats-section {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

[data-theme="dark"] .header {
  background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .sidebar {
  background: var(--surface-color);
  border-right: 1px solid var(--border-color);
}

[data-theme="dark"] .mobile-info-row {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-color);
}

[data-theme="dark"] .mobile-info-row.highlight {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.1) 0%,
    rgba(59, 130, 246, 0.2) 100%
  );
  border-color: var(--primary-color);
}

[data-theme="dark"] .search-input,
[data-theme="dark"] .filter-select {
  background: rgba(30, 41, 59, 0.8);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .search-input:focus,
[data-theme="dark"] .filter-select:focus {
  border-color: var(--primary-color);
  background: rgba(30, 41, 59, 0.9);
}

[data-theme="dark"] .range-input {
  background: var(--border-color);
}

[data-theme="dark"] .mobile-bottom-panel {
  background: var(--surface-color);
  border-top: 1px solid var(--border-color);
}

[data-theme="dark"] .panel-header {
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid var(--border-color);
}

/* Automatic dark mode support for users who prefer it */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background-color: #0f172a;
    --surface-color: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --shadow-light: 0 1px 3px 0 rgba(0, 0, 0, 0.3),
      0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-medium: 0 4px 6px -1px rgba(0, 0, 0, 0.4),
      0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-large: 0 20px 25px -5px rgba(0, 0, 0, 0.6),
      0 10px 10px -5px rgba(0, 0, 0, 0.3);
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Focus styles for accessibility */
*:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

button:focus,
input:focus,
select:focus {
  outline-offset: 0;
}

/* Animation utilities */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Custom marker styles for better visibility */
.school-marker {
  cursor: pointer;
  transition: filter 0.2s ease;
}

.school-marker:hover {
  filter: brightness(1.1) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* Custom school icon styles */
.custom-school-marker {
  background: transparent !important;
  border: none !important;
}

.school-icon-container {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid white;
  box-shadow: var(--shadow-medium);
  position: relative;
  transition: all 0.2s ease;
}

.school-icon-container i {
  color: white;
  font-size: 16px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.school-icon-container:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-large);
}

/* Add a small indicator triangle at the bottom */
.school-icon-container::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid white;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.2));
}

/* Print styles */
@media print {
  .sidebar,
  .header,
  .fab,
  .mobile-bottom-panel {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
    padding-top: 0 !important;
  }
}

/* Custom Scrollbar Styles */
/* For Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(248, 250, 252, 0.8);
  border-radius: 10px;
  border: 1px solid rgba(226, 232, 240, 0.5);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  );
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2),
    inset 0 1px 2px rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #1e40af 100%);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3),
    inset 0 1px 2px rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
}

::-webkit-scrollbar-thumb:active {
  background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.4),
    inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

::-webkit-scrollbar-corner {
  background: rgba(248, 250, 252, 0.8);
}

/* Scrollbar for sidebar specifically */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.3);
  border-radius: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(37, 99, 235, 0.6) 0%,
    rgba(29, 78, 216, 0.8) 100%
  );
  border-radius: 6px;
  border: none;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    rgba(37, 99, 235, 0.8) 0%,
    rgba(29, 78, 216, 1) 100%
  );
}

/* For Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) rgba(248, 250, 252, 0.8);
}

.sidebar {
  scrollbar-width: thin;
  scrollbar-color: rgba(37, 99, 235, 0.6) rgba(226, 232, 240, 0.3);
}
