/* =====================================================
   SCHOOL EXPLORER PORTAL — CSS
   Woonprijs.nl Interactive School Map
   ===================================================== */

/* === DESIGN TOKENS === */
:root {
  --se-navy: #0a1628;
  --se-navy-light: #0f1d32;
  --se-brand: #6366f1;
  --se-brand-hover: #4f46e5;
  --se-brand-light: #818cf8;
  --se-cyan: #06b6d4;
  --se-emerald: #10b981;
  --se-amber: #f59e0b;
  --se-rose: #f43f5e;
  --se-orange: #f97316;
  --se-purple: #8b5cf6;
  --se-teal: #14b8a6;
  --se-white: #ffffff;
  --se-gray-50: #f8fafc;
  --se-gray-100: #f1f5f9;
  --se-gray-200: #e2e8f0;
  --se-gray-300: #cbd5e1;
  --se-gray-400: #94a3b8;
  --se-gray-500: #64748b;
  --se-gray-600: #475569;
  --se-gray-700: #334155;
  --se-gray-800: #1e293b;
  --se-gray-900: #0f172a;
  --se-radius: 12px;
  --se-radius-lg: 16px;
  --se-radius-xl: 24px;
  --se-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --se-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --se-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --se-shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.04);
  --se-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --se-transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --se-sidebar-width: 420px;
}

/* === RESET & BASE === */
*, *::before, *::after {
  box-sizing: border-box;
}

body.se-body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--se-gray-900);
  background: var(--se-gray-50);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* === LAYOUT: HEADER + SPLIT PANEL === */
.se-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* --- Top Header Bar --- */
.se-header {
  background: var(--se-white);
  border-bottom: 1px solid var(--se-gray-200);
  padding: 0.625rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  z-index: 100;
  flex-shrink: 0;
  min-height: 56px;
}

.se-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.se-header-logo {
  height: 28px;
  width: auto;
}

.se-header-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--se-gray-900);
  letter-spacing: -0.01em;
}

.se-header-title span {
  background: linear-gradient(135deg, var(--se-brand) 0%, var(--se-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.se-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  background: linear-gradient(135deg, rgba(99,102,241,0.1) 0%, rgba(139,92,246,0.1) 100%);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--se-brand);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.se-header-center {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  max-width: 480px;
}

.se-search-wrapper {
  position: relative;
  flex: 1;
}

.se-search-input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  border: 1.5px solid var(--se-gray-200);
  border-radius: 10px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--se-gray-900);
  background: var(--se-gray-50);
  transition: var(--se-transition-fast);
  outline: none;
}

.se-search-input:focus {
  border-color: var(--se-brand);
  background: var(--se-white);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.se-search-input::placeholder {
  color: var(--se-gray-400);
}

.se-search-icon {
  position: absolute;
  left: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--se-gray-400);
  pointer-events: none;
}

.se-search-btn {
  padding: 0.5rem 1rem;
  background: var(--se-brand);
  color: var(--se-white);
  border: none;
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--se-transition-fast);
  white-space: nowrap;
}

.se-search-btn:hover {
  background: var(--se-brand-hover);
  transform: translateY(-1px);
}

.se-search-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.se-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.se-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--se-gray-200);
  border-radius: 10px;
  background: var(--se-white);
  color: var(--se-gray-600);
  cursor: pointer;
  transition: var(--se-transition-fast);
}

.se-btn-icon:hover {
  border-color: var(--se-brand);
  color: var(--se-brand);
  background: rgba(99,102,241,0.04);
}

.se-btn-back {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4375rem 0.75rem;
  border: 1.5px solid var(--se-gray-200);
  border-radius: 10px;
  background: var(--se-white);
  color: var(--se-gray-600);
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--se-transition-fast);
  text-decoration: none;
}

.se-btn-back:hover {
  border-color: var(--se-gray-300);
  color: var(--se-gray-900);
  background: var(--se-gray-50);
}

/* --- Main Content: Sidebar + Map --- */
.se-main {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* --- Sidebar --- */
.se-sidebar {
  width: var(--se-sidebar-width);
  background: var(--se-white);
  border-right: 1px solid var(--se-gray-200);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 50;
}

.se-sidebar.collapsed {
  width: 0;
  margin-left: calc(-1 * var(--se-sidebar-width));
}

/* Sidebar toggle button */
.se-sidebar-toggle {
  position: absolute;
  left: var(--se-sidebar-width);
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 48px;
  background: var(--se-white);
  border: 1px solid var(--se-gray-200);
  border-left: none;
  border-radius: 0 8px 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 60;
  color: var(--se-gray-500);
  transition: var(--se-transition);
  box-shadow: 2px 0 6px rgba(0,0,0,0.06);
}

.se-sidebar-toggle:hover {
  color: var(--se-brand);
  background: var(--se-gray-50);
}

.se-sidebar.collapsed + .se-map-container .se-sidebar-toggle,
.se-sidebar.collapsed ~ .se-sidebar-toggle {
  left: 0;
}

/* --- Sidebar Tabs --- */
.se-tabs {
  display: flex;
  border-bottom: 1px solid var(--se-gray-200);
  background: var(--se-gray-50);
  flex-shrink: 0;
}

.se-tab {
  flex: 1;
  padding: 0.625rem 0.5rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--se-gray-500);
  cursor: pointer;
  transition: var(--se-transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
}

.se-tab:hover {
  color: var(--se-gray-700);
  background: rgba(99,102,241,0.04);
}

.se-tab.active {
  color: var(--se-brand);
  border-bottom-color: var(--se-brand);
  background: var(--se-white);
}

.se-tab-count {
  display: inline-block;
  text-align: center;
  line-height: 20px;
  min-width: 22px;
  height: 20px;
  padding: 0 0.375rem;
  background: var(--se-gray-200);
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--se-gray-600);
}

.se-tab.active .se-tab-count {
  background: rgba(99,102,241,0.1);
  color: var(--se-brand);
}

/* --- Sidebar Sections --- */
.se-sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--se-gray-300) transparent;
}

.se-sidebar-scroll::-webkit-scrollbar {
  width: 5px;
}

.se-sidebar-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.se-sidebar-scroll::-webkit-scrollbar-thumb {
  background: var(--se-gray-300);
  border-radius: 999px;
}

/* --- Filter Section --- */
.se-filter-section {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--se-gray-100);
}

.se-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  padding: 0.25rem 0;
}

.se-filter-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--se-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.se-filter-chevron {
  color: var(--se-gray-400);
  transition: transform 0.2s ease;
}

.se-filter-section.collapsed .se-filter-chevron {
  transform: rotate(-90deg);
}

.se-filter-body {
  padding-top: 0.625rem;
}

.se-filter-section.collapsed .se-filter-body {
  display: none;
}

/* --- Checkbox Filters --- */
.se-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.se-checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3125rem 0.625rem;
  background: var(--se-gray-50);
  border: 1.5px solid var(--se-gray-200);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--se-gray-700);
  cursor: pointer;
  transition: var(--se-transition-fast);
  user-select: none;
}

.se-checkbox-pill:hover {
  border-color: var(--se-gray-300);
  background: var(--se-white);
}

.se-checkbox-pill.active {
  background: rgba(99,102,241,0.08);
  border-color: var(--se-brand);
  color: var(--se-brand);
}

.se-checkbox-pill input[type="checkbox"] {
  display: none;
}

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

/* --- Range Slider --- */
.se-range-group {
  padding: 0.25rem 0;
}

.se-range-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.se-range-label-text {
  font-size: 0.75rem;
  color: var(--se-gray-600);
}

.se-range-value {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--se-brand);
  background: rgba(99,102,241,0.08);
  padding: 0.125rem 0.5rem;
  border-radius: 6px;
}

.se-range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--se-gray-200);
  outline: none;
  transition: var(--se-transition-fast);
}

.se-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--se-brand);
  cursor: pointer;
  border: 3px solid var(--se-white);
  box-shadow: 0 1px 4px rgba(99,102,241,0.3);
  transition: var(--se-transition-fast);
}

.se-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(99,102,241,0.4);
}

.se-range-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--se-brand);
  cursor: pointer;
  border: 3px solid var(--se-white);
  box-shadow: 0 1px 4px rgba(99,102,241,0.3);
}

/* --- Filter Actions Bar --- */
.se-filter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--se-gray-100);
  background: var(--se-gray-50);
  flex-shrink: 0;
}

.se-results-count {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--se-gray-700);
}

.se-results-count strong {
  color: var(--se-brand);
}

.se-btn-clear {
  padding: 0.3125rem 0.625rem;
  background: none;
  border: 1.5px solid var(--se-gray-200);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--se-gray-500);
  cursor: pointer;
  transition: var(--se-transition-fast);
}

.se-btn-clear:hover {
  border-color: var(--se-rose);
  color: var(--se-rose);
  background: rgba(244,63,94,0.04);
}

/* --- Sort Bar --- */
.se-sort-bar {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--se-gray-100);
  flex-shrink: 0;
}

.se-sort-label {
  font-size: 0.6875rem;
  color: var(--se-gray-500);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.se-sort-btn {
  padding: 0.25rem 0.5rem;
  background: none;
  border: 1px solid var(--se-gray-200);
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--se-gray-500);
  cursor: pointer;
  transition: var(--se-transition-fast);
  white-space: nowrap;
}

.se-sort-btn:hover {
  border-color: var(--se-gray-300);
  color: var(--se-gray-700);
}

.se-sort-btn.active {
  background: var(--se-brand);
  border-color: var(--se-brand);
  color: var(--se-white);
}

/* --- School List --- */
.se-school-list {
  padding: 0;
}

.se-school-card {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--se-gray-100);
  cursor: pointer;
  transition: var(--se-transition-fast);
  position: relative;
}

.se-school-card:hover {
  background: var(--se-gray-50);
}

.se-school-card.active {
  background: rgba(99,102,241,0.04);
  border-left: 3px solid var(--se-brand);
}

.se-school-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
}

.se-school-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--se-gray-900);
  line-height: 1.3;
}

.se-school-denom {
  font-size: 0.6875rem;
  color: var(--se-gray-500);
  margin-top: 0.125rem;
  margin-bottom: 0.375rem;
  font-weight: 400;
}

.se-school-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  color: var(--se-brand);
  text-decoration: none;
  font-weight: 500;
  margin-left: auto; /* Push to the right if in a row */
  transition: opacity 0.2s ease;
}

.se-school-card-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.se-school-card-link svg {
  flex-shrink: 0;
}

.se-school-score-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.se-school-score-badge.high {
  background: rgba(16,185,129,0.1);
  color: #059669;
}

.se-school-score-badge.medium {
  background: rgba(245,158,11,0.1);
  color: #d97706;
}

.se-school-score-badge.low {
  background: rgba(244,63,94,0.1);
  color: #e11d48;
}

.se-school-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.375rem;
}

.se-school-meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  color: var(--se-gray-500);
}

.se-school-meta-item svg {
  flex-shrink: 0;
}

.se-school-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.se-school-tag {
  display: inline-block;
  padding: 0.125rem 0.4375rem;
  background: var(--se-gray-100);
  border-radius: 4px;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--se-gray-600);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.se-school-tag.vwo { background: rgba(139,92,246,0.1); color: #7c3aed; }
.se-school-tag.havo { background: rgba(59,130,246,0.1); color: #2563eb; }
.se-school-tag.vmbo { background: rgba(249,115,22,0.1); color: #ea580c; }
.se-school-tag.pro { background: rgba(244,63,94,0.1); color: #e11d48; }

/* --- Empty State --- */
.se-empty-state {
  padding: 3rem 2rem;
  text-align: center;
}

.se-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.se-empty-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--se-gray-700);
  margin-bottom: 0.5rem;
}

.se-empty-desc {
  font-size: 0.8125rem;
  color: var(--se-gray-500);
  line-height: 1.5;
}

/* --- Map Container --- */
.se-map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#se-map {
  width: 100%;
  height: 100%;
}

/* --- Map Controls Overlay --- */
.se-map-overlay-stats {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 800;
}

.se-map-stat {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--se-gray-700);
}

.se-map-stat svg {
  flex-shrink: 0;
}

/* --- Map Type Switch --- */
.se-type-switch {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  overflow: hidden;
  z-index: 800;
}

.se-type-btn {
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--se-gray-500);
  cursor: pointer;
  transition: var(--se-transition-fast);
  white-space: nowrap;
}

.se-type-btn:first-child {
  border-right: 1px solid var(--se-gray-200);
}

.se-type-btn:hover {
  color: var(--se-gray-700);
}

.se-type-btn.active {
  background: var(--se-brand);
  color: var(--se-white);
}

/* --- Radius Selector --- */
.se-radius-control {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 800;
}

.se-radius-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--se-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.se-radius-select {
  padding: 0.25rem 0.375rem;
  border: 1.5px solid var(--se-gray-200);
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--se-brand);
  background: var(--se-white);
  cursor: pointer;
  outline: none;
}

.se-radius-select:focus {
  border-color: var(--se-brand);
}

/* --- Custom Leaflet Marker Styles --- */
.se-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2.5px solid var(--se-white);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--se-white);
  text-align: center;
  line-height: 1;
  transition: transform 0.2s ease;
}

.se-marker:hover {
  transform: scale(1.2);
  z-index: 10000 !important;
}

.se-marker-home {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--se-brand) 0%, var(--se-purple) 100%);
  border: 3px solid var(--se-white);
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
  font-size: 1.25rem;
  z-index: 9000 !important;
}

.se-marker-school {
  width: 32px;
  height: 32px;
}

/* Score-based colors */
.se-marker-score-high { background: linear-gradient(135deg, #059669 0%, #10b981 100%); }
.se-marker-score-medium-high { background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%); }
.se-marker-score-medium { background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%); }
.se-marker-score-low { background: linear-gradient(135deg, #dc2626 0%, #f43f5e 100%); }

/* Type-based colors (middelbare) */
.se-marker-vwo { background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%); }
.se-marker-havo { background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%); }
.se-marker-vmbo { background: linear-gradient(135deg, #ea580c 0%, #f97316 100%); }
.se-marker-mixed { background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%); }
.se-marker-pro { background: linear-gradient(135deg, #dc2626 0%, #f43f5e 100%); }

/* Cluster styling */
.se-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(99,102,241,0.85);
  border: 3px solid rgba(255,255,255,0.8);
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
  color: var(--se-white);
  font-weight: 700;
  backdrop-filter: blur(4px);
}

.se-cluster-small {
  width: 36px;
  height: 36px;
  font-size: 0.75rem;
}

.se-cluster-medium {
  width: 44px;
  height: 44px;
  font-size: 0.8125rem;
}

.se-cluster-large {
  width: 52px;
  height: 52px;
  font-size: 0.875rem;
}

/* --- Leaflet Popup Overrides --- */
.se-popup .leaflet-popup-content-wrapper {
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.12);
  border: 1px solid var(--se-gray-200);
  overflow: hidden;
}

.se-popup .leaflet-popup-content {
  margin: 0;
  min-width: 260px;
  max-width: 320px;
}

.se-popup .leaflet-popup-tip {
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.se-popup-card {
  padding: 1rem;
}

.se-popup-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--se-gray-900);
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.se-popup-address {
  font-size: 0.75rem;
  color: var(--se-gray-500);
  margin-bottom: 0.75rem;
}

.se-popup-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.se-popup-stat {
  padding: 0.5rem;
  background: var(--se-gray-50);
  border-radius: 8px;
  text-align: center;
}

.se-popup-stat-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--se-gray-900);
}

.se-popup-stat-label {
  font-size: 0.625rem;
  color: var(--se-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.125rem;
}

.se-popup-bar {
  height: 6px;
  background: var(--se-gray-200);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.se-popup-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}

.se-popup-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.se-popup-tag {
  padding: 0.1875rem 0.4375rem;
  background: var(--se-gray-100);
  border-radius: 4px;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--se-gray-600);
  text-transform: uppercase;
}

.se-popup-link {
  display: block;
  text-align: center;
  padding: 0.4375rem 0.75rem;
  background: var(--se-gray-50);
  border: 1px solid var(--se-gray-200);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--se-brand);
  text-decoration: none;
  transition: var(--se-transition-fast);
}

.se-popup-link:hover {
  background: rgba(99,102,241,0.06);
  border-color: var(--se-brand);
}

/* --- Loading State --- */
.se-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 900;
}

.se-loading-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--se-gray-200);
  border-top-color: var(--se-brand);
  border-radius: 50%;
  animation: se-spin 0.8s linear infinite;
}

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

.se-loading-text {
  margin-top: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--se-gray-600);
}

.se-loading-subtext {
  font-size: 0.75rem;
  color: var(--se-gray-400);
  margin-top: 0.25rem;
}

/* --- Export Button --- */
.se-export-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.625rem;
  background: none;
  border: 1.5px solid var(--se-gray-200);
  border-radius: 8px;
  font-size: 0.6875rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--se-gray-500);
  cursor: pointer;
  transition: var(--se-transition-fast);
}

.se-export-btn:hover {
  border-color: var(--se-emerald);
  color: var(--se-emerald);
  background: rgba(16,185,129,0.04);
}

/* === RESPONSIVE: MOBILE === */
@media (max-width: 768px) {
  .se-header {
    padding: 0.5rem 0.75rem;
  }

  .se-header-center {
    display: none;
  }

  .se-header-title {
    font-size: 0.875rem;
  }

  .se-header-badge {
    display: none;
  }
  /* Mobile: Sidebar as bottom sheet */
  .se-sidebar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100% !important;
    height: 55vh; /* Force height so absolute flex container doesn't collapse */
    max-height: 55vh;
    border-right: none;
    border-top: 1px solid var(--se-gray-200);
    border-radius: var(--se-radius-xl) var(--se-radius-xl) 0 0;
    box-shadow: 0 -10px 25px rgba(0,0,0,0.08);
    z-index: 60;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .se-sidebar.collapsed {
    height: 48px; /* Force collapsed height */
    margin-left: 0;
    width: 100% !important;
    transform: none;
  }

  .se-sidebar-toggle {
    display: none;
  }

  /* Mobile drag handle */
  .se-mobile-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    cursor: pointer;
  }

  .se-mobile-handle-bar {
    width: 36px;
    height: 4px;
    background: var(--se-gray-300);
    border-radius: 999px;
  }

  .se-map-overlay-stats {
    bottom: auto;
    top: 0.75rem;
    flex-wrap: wrap;
    max-width: calc(100% - 1.5rem);
  }

  .se-type-switch {
    top: 3.5rem;
    bottom: auto;
    right: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  }

  .se-type-btn {
    padding: 0.375rem 0.625rem;
    font-size: 0.7rem;
  }

  .se-radius-control {
    top: 3.5rem;
    bottom: auto;
    left: 0.75rem;
    padding: 0.3125rem 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  }

  .se-radius-label {
    display: none;
  }

  .se-radius-select {
    padding: 0.125rem 0.25rem;
    font-size: 0.75rem;
  }

  .se-popup .leaflet-popup-content {
    min-width: 220px;
    max-width: 280px;
  }

  /* Mobile search bar in sidebar */
  .se-mobile-search {
    display: block;
    padding: 0.5rem 1rem 0;
  }

  .se-mobile-search .se-search-wrapper {
    width: 100%;
  }
}

@media (min-width: 769px) {
  .se-mobile-handle {
    display: none;
  }

  .se-mobile-search {
    display: none;
  }
}

/* === ANIMATIONS === */
@keyframes se-fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.se-school-card {
  animation: se-fadeIn 0.2s ease forwards;
}

@keyframes se-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.se-loading-pulse {
  animation: se-pulse 1.5s ease-in-out infinite;
}

/* === LEAFLET Z-INDEX FIXES === */
.leaflet-top, .leaflet-bottom {
  z-index: 790 !important;
}

.leaflet-pane {
  z-index: 600;
}

/* === NEW INTERACTIVE FEATURES === */

/* --- Exclusive Toggle (Checkbox style) --- */
.se-exclusive-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--se-gray-600);
  cursor: pointer;
  user-select: none;
  font-weight: 500;
}

.se-exclusive-toggle input {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1.5px solid var(--se-gray-300);
  accent-color: var(--se-brand);
  cursor: pointer;
}

/* --- Card Compare Checkbox --- */
.se-school-compare-check {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--se-gray-500);
  cursor: pointer;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--se-gray-100);
  user-select: none;
}

.se-school-compare-check input {
  accent-color: var(--se-brand);
  cursor: pointer;
}

/* --- Travel Times --- */
.se-travel-times {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-top: 0.375rem;
}

.se-travel-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--se-gray-500);
  background: var(--se-gray-50);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

/* --- Comparison Drawer --- */
.se-compare-drawer {
  position: absolute;
  bottom: 0;
  left: var(--se-sidebar-width);
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--se-gray-200);
  box-shadow: 0 -8px 24px rgba(0,0,0,0.08);
  z-index: 850;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.se-sidebar.collapsed ~ .se-compare-drawer {
  left: 0;
}

.se-compare-drawer.open {
  transform: translateY(0);
}

.se-compare-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--se-gray-200);
  background: var(--se-white);
}

.se-compare-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--se-gray-900);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.se-compare-close {
  background: none;
  border: none;
  color: var(--se-gray-400);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--se-transition-fast);
}

.se-compare-close:hover {
  background: var(--se-gray-100);
  color: var(--se-gray-700);
}

.se-compare-body {
  padding: 1.25rem;
  overflow-x: auto;
  max-height: 320px;
}

.se-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  text-align: left;
}

.se-compare-table th, .se-compare-table td {
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--se-gray-200);
  vertical-align: middle;
}

.se-compare-table th {
  font-weight: 600;
  color: var(--se-gray-500);
  background: var(--se-gray-50);
}

.se-compare-table td.school-col {
  font-weight: 600;
  color: var(--se-gray-900);
  min-width: 160px;
}

.se-compare-table tr:hover td {
  background: rgba(99,102,241,0.02);
}

@media (max-width: 768px) {
  .se-compare-drawer {
    left: 0;
    z-index: 1000;
    max-height: 80vh;
  }
  .se-compare-body {
    max-height: 60vh;
  }
}

/* === CUSTOM HOME PIN MARKER === */
.se-marker-home-pin {
  width: 32px;
  height: 32px;
  background: var(--se-brand);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(99,102,241,0.4);
  border: 2px solid white;
}
.se-marker-home-pin::after {
  content: '🏠';
  font-size: 1.1rem;
  transform: rotate(45deg);
}

/* === CUSTOM MODAL OVERLAY === */
.se-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 22, 40, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: se-fadeIn 0.25s ease-out;
}
.se-modal-card {
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 420px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
}
.se-modal-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}
.se-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--se-navy);
  margin: 0 0 0.75rem 0;
}
.se-modal-message {
  font-size: 0.9rem;
  color: var(--se-gray-600);
  line-height: 1.6;
  margin: 0 0 1.5rem 0;
}
.se-modal-btn {
  padding: 0.75rem 2rem;
  background: linear-gradient(135deg, var(--se-brand) 0%, var(--se-purple) 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(99,102,241,0.2);
  transition: var(--se-transition-fast);
}
.se-modal-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99,102,241,0.3);
}

/* === ACCESS LOCK OVERLAY === */
.se-lock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  animation: se-fadeIn 0.3s ease;
}
.se-lock-card {
  max-width: 400px;
  background: white;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  box-shadow: var(--se-shadow-xl);
  border: 1px solid var(--se-gray-100);
}
.se-lock-icon {
  font-size: 3.5rem;
  margin-bottom: 1.25rem;
}
.se-lock-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--se-navy);
  margin: 0 0 1rem 0;
}
.se-lock-desc {
  font-size: 0.925rem;
  color: var(--se-gray-600);
  line-height: 1.6;
  margin: 0 0 2rem 0;
}
.se-lock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  background: linear-gradient(135deg, var(--se-brand) 0%, var(--se-brand-hover) 100%);
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(99,102,241,0.25);
  transition: var(--se-transition-fast);
}
.se-lock-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99,102,241,0.35);
}

/* === EXPORT TOAST === */
.se-export-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 0.625rem 1.25rem;
  background: var(--se-gray-900);
  color: var(--se-white);
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.se-export-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* === KEYBOARD FOCUS FOR SCHOOL CARDS (a11y) === */
.se-school-card:focus-visible {
  outline: 2px solid var(--se-brand);
  outline-offset: -2px;
  background: rgba(99,102,241,0.04);
}

/* === POPUP STYLES === */
.se-popup-denomination {
  font-size: 0.75rem;
  color: var(--se-gray-500);
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}
.se-popup-travel-line {
  font-size: 0.75rem;
  color: var(--se-gray-500);
  margin-bottom: 0.5rem;
}
.se-popup-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.625rem;
  padding-top: 0.625rem;
  border-top: 1px solid var(--se-gray-100);
}
.se-popup-phone {
  font-size: 0.7rem;
  color: var(--se-gray-500);
  display: flex;
  align-items: center;
  gap: 4px;
}
.se-popup-exam-stats {
  margin-bottom: 0.5rem;
}
.se-popup-exam-scroll {
  max-height: 230px;
  overflow-y: auto;
  padding-right: 6px;
}
.se-popup-track-title {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--se-gray-800);
  margin: 0.85rem 0 0.45rem 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-left: 6px;
  border-left: 3px solid;
  display: flex;
  align-items: center;
}
.se-popup-track-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.se-popup-exam-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.se-popup-exam-badge {
  font-size: 0.95rem;
  font-weight: 850;
  padding: 3px 8px;
  border-radius: 6px;
  min-width: 36px;
  text-align: center;
  display: inline-block;
  font-feature-settings: 'tnum';
}
.se-popup-exam-badge.high {
  background: #dcfce7;
  color: #166534;
}
.se-popup-exam-badge.medium {
  background: #e0e7ff;
  color: #3730a3;
}
.se-popup-exam-badge.low {
  background: #fee2e2;
  color: #991b1b;
}
.se-popup-exam-badge.neutral {
  background: #f1f5f9;
  color: #475569;
}
.se-popup-exam-detail {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}
.se-popup-exam-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #334155;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.se-popup-exam-subtext {
  font-size: 0.65rem;
  color: var(--se-gray-500);
  margin-top: 1px;
}
.se-popup-exam-note {
  font-size: 0.625rem;
  color: var(--se-gray-500);
  margin-top: 0.5rem;
  line-height: 1.3;
  font-style: italic;
  border-top: 1px dashed var(--se-gray-200);
  padding-top: 0.375rem;
}

/* === DEMO BANNER === */
.se-demo-banner-inner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(234, 88, 12, 0.1) 100%);
  border: 1.5px dashed #f97316;
  padding: 16px;
  margin: 12px;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  text-align: center;
}
.se-demo-banner-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #ea580c;
  margin-bottom: 6px;
}
.se-demo-banner-desc {
  font-size: 0.8rem;
  color: #4b5563;
  line-height: 1.4;
  margin-bottom: 12px;
}
.se-demo-banner-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 14px;
  background: #f97316;
  color: white;
  font-weight: 700;
  font-size: 0.8rem;
  text-decoration: none;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(249, 115, 22, 0.25);
  transition: all 0.2s ease;
}
.se-demo-banner-cta:hover {
  background: #ea580c;
  transform: translateY(-1px);
}

/* === MAP EMPTY OVERLAY === */
.se-map-empty-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--se-gray-200);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 1.25rem 2rem;
  z-index: 1000;
  text-align: center;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.se-map-empty-icon {
  font-size: 1.5rem;
}
.se-map-empty-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--se-gray-800);
  font-family: 'Inter', sans-serif;
}

