/* K12 Platform - LoveForm-Inspired Design System */
/* Matches blueprint specifications exactly */
/* PIXEL-PERFECT POLISH UPDATE - v3.0 - July 25, 2025 - Final Polish */

:root {
  /* Buggy Brand Color Palette (replacing LoveForm pink) */
  --loveform-rausch: #2AC8C8;        /* Primary brand color - Buggy turquoise */
  --loveform-rausch-hover: #289A96;  /* Hover state - Buggy dark turquoise */
  --loveform-rausch-light: #E5F8FF;  /* Light turquoise backgrounds */

  /* Functional Colors - LoveForm Exact */
  --loveform-babu: #00A699;          /* Teal accent color */
  --loveform-arches: #FC642D;        /* Orange for warnings */
  --loveform-hof: #007A87;           /* Blue for information */

  /* LoveForm-Exact Neutral System */
  --loveform-dark: #222222;          /* Primary text (charcoal) */
  --loveform-medium: #717171;        /* Secondary text (gray) */
  --loveform-light: #B0B0B0;         /* Tertiary text */
  --loveform-border: #DDDDDD;        /* Standard borders */
  --loveform-background: #F7F7F7;    /* Light gray backgrounds */
  --loveform-white: #FFFFFF;         /* Pure white */

  /* Legacy aliases for compatibility */
  --primary-coral: var(--loveform-rausch);
  --primary-coral-hover: var(--loveform-rausch-hover);
  --primary-coral-light: var(--loveform-rausch-light);
  --neutral-dark: var(--loveform-dark);
  --neutral-medium: var(--loveform-medium);
  --neutral-light: var(--loveform-light);
  --neutral-border: var(--loveform-border);
  --neutral-background: var(--loveform-background);
  --white: var(--loveform-white);

  /* Shadow System */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.15);

  /* Border Radius System */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Typography System - LoveForm-Exact */
  --font-primary: 'Circular', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  /* Letter Spacing for Premium Typography */
  --letter-spacing-tight: -0.025em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.025em;
  --letter-spacing-wider: 0.05em;

  /* Spacing System (8px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* Breakpoints */
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 992px;
  --breakpoint-xl: 1200px;
  --breakpoint-xxl: 1400px;
}

/* Global Typography */
body {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-normal);
  color: var(--neutral-dark);
  line-height: 1.5;
}

/* Headings */
h1, .h1 {
  font-size: 2.5rem;
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  color: var(--neutral-dark);
}

h2, .h2 {
  font-size: 2rem;
  font-weight: var(--font-weight-semibold);
  line-height: 1.3;
  color: var(--neutral-dark);
}

h3, .h3 {
  font-size: 1.5rem;
  font-weight: var(--font-weight-semibold);
  line-height: 1.4;
  color: var(--neutral-dark);
}

h4, .h4 {
  font-size: 1.25rem;
  font-weight: var(--font-weight-medium);
  line-height: 1.4;
  color: var(--neutral-dark);
}

/* Buggy Button System */
.btn-loveform-primary {
  background: linear-gradient(135deg, var(--primary-coral), var(--primary-coral-hover));
  border: none;
  color: white;
  font-weight: var(--font-weight-semibold);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.btn-loveform-primary:hover {
  background: linear-gradient(135deg, var(--primary-coral-hover), #238989);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  color: white;
}

.btn-loveform-secondary {
  background: var(--white);
  border: 1px solid var(--neutral-border);
  color: var(--neutral-dark);
  font-weight: var(--font-weight-medium);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.btn-loveform-secondary:hover {
  border-color: var(--neutral-dark);
  color: var(--neutral-dark);
  box-shadow: var(--shadow-sm);
}

/* LoveForm Card System */
.loveform-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: none;
  transition: all 0.2s ease;
  cursor: pointer;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.loveform-card:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
  transform: scale(1.04);
}

.loveform-card-image {
  position: relative;
  aspect-ratio: 20 / 19; /* LoveForm's near-square ratio - NOT 4:3 */
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.loveform-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.loveform-card:hover .loveform-card-image img {
  transform: scale(1.05);
}

.loveform-card-content {
  padding: var(--space-3) 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

/* Ensure title line doesn't break */
.loveform-card-content .d-flex {
  gap: var(--space-2);
}

.loveform-card-content .loveform-card-title {
  flex: 1;
  min-width: 0; /* Allow text-overflow to work */
}

.loveform-card-title {
  font-size: 1rem;
  font-weight: var(--font-weight-semibold);
  color: var(--neutral-dark);
  line-height: 1.3;
  margin: 0;
  margin-bottom: var(--space-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loveform-card-subtitle {
  font-size: 0.875rem;
  color: var(--neutral-medium);
  margin: 0;
  line-height: 1.3;
}

.loveform-card-rating {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.875rem;
  color: var(--neutral-dark);
  white-space: nowrap;
  flex-shrink: 0;
}

.loveform-card-price {
  font-size: 0.875rem;
  font-weight: var(--font-weight-medium);
  color: var(--neutral-dark);
  white-space: nowrap;
}

/* Heart Button */
.heart-button {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(34,34,34,0.6);
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.heart-button:hover {
  background: rgba(255,255,255,1);
  transform: scale(1.05);
  color: rgba(34,34,34,0.8);
}

.heart-button.active {
  color: var(--primary-coral);
  background: rgba(255,255,255,1);
}

/* ========================================
   AIRBNB-STYLE SEARCH BAR (EXACT MATCH)
   ======================================== */

/* Search Bar Container */
.loveform-search-container {
  max-width: 850px;
  margin: 0 auto;
  position: relative;
}

.loveform-search-bar {
  display: flex;
  align-items: center;
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 40px;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12), 0 8px 25px rgba(0,0,0,0.08);
  transition: all 0.2s ease;
  position: relative;
}

.loveform-search-bar:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15), 0 12px 30px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}

/* Individual Search Sections */
.search-section {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  border-radius: 32px;
  transition: all 0.2s ease;
  min-height: 66px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.search-section:hover {
  background: rgba(0,0,0,0.04);
}

.search-section.active {
  background: var(--white);
  box-shadow: 0 0 0 2px var(--neutral-dark);
  border-radius: 32px;
  z-index: 1001;
}

/* Visual bridge effect when dropdown is open */
.search-section.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  right: 0;
  height: 8px;
  background: var(--white);
  z-index: 1002;
}

/* Search Separators - LoveForm-Exact Specifications */
.search-separator {
  width: 1px;
  height: 32px;
  background: rgba(221, 221, 221, 0.5);
  margin: 0;
  flex-shrink: 0;
  align-self: center;
  opacity: 1;
  transition: opacity 0.2s ease;
}

/* Search Labels - LoveForm-Exact Typography */
.search-label {
  font-size: 0.625rem;
  font-weight: var(--font-weight-semibold);
  color: var(--neutral-dark);
  margin-bottom: 4px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Search Input Display - Premium Typography */
.search-input {
  font-size: 0.875rem;
  font-weight: var(--font-weight-normal);
  color: var(--neutral-medium);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: var(--letter-spacing-normal);
}

/* Search sections with selection */
.search-section.has-selection .search-label {
  font-size: 0.75rem;
  margin-bottom: var(--space-1);
}

.search-section.has-selection .search-input {
  font-size: 0.875rem;
  font-weight: var(--font-weight-medium);
  color: var(--neutral-dark);
}

/* LoveForm-Style Red Search Button - Pixel Perfect Enhancement */
.loveform-search-button {
  background: var(--loveform-rausch);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--loveform-white);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  margin-left: 8px;
  margin-right: 8px;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  position: relative;
}

.loveform-search-button:hover {
  background: var(--loveform-rausch-hover);
  transform: scale(1.04);
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.loveform-search-button:active {
  transform: scale(0.96);
  transition: all 0.05s ease;
}

.loveform-search-button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 56, 92, 0.2), 0 2px 4px rgba(0,0,0,0.18);
}

/* Legacy search button (keep for compatibility) */
.search-button {
  background: var(--primary-coral);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: var(--space-2);
  flex-shrink: 0;
}

.search-button:hover {
  background: #289A96;
  transform: scale(1.04);
}

.search-section:last-child {
  border-right: none;
}

.search-section:hover {
  background: var(--neutral-background);
}

.search-label {
  font-size: 0.75rem;
  font-weight: var(--font-weight-semibold);
  color: var(--neutral-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-1);
}

.search-input {
  font-size: 0.875rem;
  color: var(--neutral-medium);
  margin: 0;
}

.search-button {
  background: var(--primary-coral);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  margin: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.2s ease;
}

.search-button:hover {
  background: var(--primary-coral-hover);
  transform: scale(1.05);
}

/* Service Tabs */
.service-tabs {
  display: flex;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
  border-bottom: 1px solid var(--neutral-border);
}

.service-tab {
  background: none;
  border: none;
  padding: var(--space-4) 0;
  font-size: 1rem;
  font-weight: var(--font-weight-medium);
  color: var(--neutral-medium);
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
}

.service-tab:hover {
  color: var(--neutral-dark);
}

.service-tab.active {
  color: var(--neutral-dark);
}

.service-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--neutral-dark);
}

.service-count {
  font-size: 0.875rem;
  color: var(--neutral-medium);
  margin-left: var(--space-1);
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: auto; /* Let content determine height */
  height: auto;
  max-height: none;
  padding: 24px 0 28px; /* Tight top (24px), balanced bottom (28px) */
  display: flex;
  align-items: flex-start;
  position: relative;
  /* BUG-091 FIX: Allow autocomplete to extend beyond hero section (LoveForm overlay pattern) */
  overflow: visible; /* Changed from hidden to allow autocomplete dropdown to overlay content below */
  /* BUG-091 FIX: Establish hero section as higher stacking context than school cards below */
  /* This ensures modal (z-index: 9999) and autocomplete (z-index: 10000) appear above heart icons */
  z-index: 100;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: white;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: var(--font-weight-extrabold);
  margin-bottom: var(--space-2);
  text-shadow: 0 3px 6px rgba(0,0,0,0.4);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 1.125rem;
  font-weight: var(--font-weight-normal);
  margin-bottom: 16px; /* LoveForm-style tight spacing - reduced from var(--space-6) */
  opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-section {
    height: auto;
    min-height: auto;
    padding: 20px 0 20px; /* Tight top, balanced bottom on mobile */
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .hero-subtitle {
    font-size: 0.875rem;
    margin-bottom: 12px; /* LoveForm-style tight spacing on mobile */
  }

  .loveform-search-bar {
    flex-direction: column;
    border-radius: var(--radius-lg);
  }

  .search-section {
    border-right: none;
    border-bottom: 1px solid var(--neutral-border);
  }

  .search-section:last-child {
    border-bottom: none;
  }

  .service-tabs {
    gap: var(--space-4);
    overflow-x: auto;
    padding-bottom: var(--space-2);
  }

  .service-tab {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* ========================================
   AIRBNB-STYLE SEARCH FILTER DROPDOWNS
   ======================================== */

/* Search Dropdown Container - Compact "Pill" Style
   Starts as a compact pill with just the input field.
   Autocomplete suggestions overlay below (LoveForm pattern). */
.search-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  /* BUG-088 FIX: Left-align to WHERE button instead of centering */
  left: 0; /* Align to left edge of WHERE button */
  transform: none; /* Remove horizontal centering */
  /* Compact pill styling */
  background: #ffffff;
  border: 1px solid #e5e7eb; /* LoveForm border color */
  border-radius: 32px; /* Pill-shaped rounded corners */
  box-shadow: 0 4px 20px rgba(0,0,0,0.12); /* Slightly stronger shadow for floating pill effect */
  z-index: 9999;
  min-width: 320px; /* Slightly narrower for compact look */
  max-width: 380px;
  /* BUG-091 FIX: No height constraints - modal only contains input, autocomplete overlays below */
  overflow: visible; /* Allow autocomplete to extend over content below (LoveForm pattern) */
  animation: dropdownSlideIn 0.2s ease-out;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); /* Smooth transition for size changes */
}

/* Expanded state when autocomplete has suggestions */
.search-dropdown.has-suggestions {
  border-radius: 24px; /* Rounded corners on expanded modal */
  min-width: 360px;
  max-width: 420px;
}

/* Ensure autocomplete items have proper styling inside expanded modal */
.search-dropdown.has-suggestions .autocomplete-results {
  margin-left: -20px; /* Extend to modal edges (compensate for .dropdown-content padding) */
  margin-right: -20px;
  padding-left: 20px;
  padding-right: 20px;
  width: calc(100% + 40px);
}

/* Show dropdown when visible */
.search-dropdown[style*="display: block"] {
  opacity: 1;
  visibility: visible;
}

@keyframes dropdownSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dropdown Content - Compact "Pill" Style by Default
   Modal starts small with just the input field.
   Autocomplete extends below as an overlay (LoveForm pattern). */
.dropdown-content {
  padding: 16px 20px; /* Reduced padding for compact look */
}

/* Header hidden by default for compact pill shape */
.dropdown-header {
  display: none; /* Hidden - input placeholder provides context */
  margin-bottom: 16px;
}

/* Show header when autocomplete is active (optional enhancement) */
.search-dropdown.has-suggestions .dropdown-header {
  display: block;
}

.dropdown-title {
  font-size: 1.125rem;
  font-weight: var(--font-weight-semibold);
  color: var(--neutral-dark);
  margin: 0;
  letter-spacing: var(--letter-spacing-tight);
  line-height: 1.3;
}

.dropdown-body {
  margin-top: 0; /* No top margin in compact mode */
  /* No min-height needed - autocomplete overlays below, doesn't need reserved space */
}

/* ============================================
   GRADE COUNTER COMPONENT (LoveForm Style)
   BUG-094 FIX: Added missing CSS for WHO dropdown
   ============================================ */

/* Container for all grade items */
.grade-counter-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Individual grade row - LoveForm guest selector pattern */
.grade-counter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--neutral-border, #ebebeb);
}

.grade-counter-item:last-child {
  border-bottom: none;
}

/* Left side: Grade info */
.grade-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.grade-name {
  font-size: 16px;
  font-weight: 500;
  color: var(--neutral-dark, #222222);
  line-height: 1.3;
}

.grade-description {
  font-size: 14px;
  color: var(--neutral-medium, #717171);
  line-height: 1.3;
}

/* Right side: Counter controls */
.grade-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Counter buttons - LoveForm circular style */
.grade-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--neutral-border, #b0b0b0);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--neutral-medium, #717171);
  font-size: 18px;
  line-height: 1;
  padding: 0;
}

.grade-btn:hover {
  border-color: var(--neutral-dark, #222222);
  color: var(--neutral-dark, #222222);
}

.grade-btn:active {
  transform: scale(0.95);
}

.grade-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.grade-btn span {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Counter value display */
.grade-value {
  min-width: 24px;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  color: var(--neutral-dark, #222222);
}

/* Mobile responsiveness for grade counter */
@media (max-width: 480px) {
  .grade-counter-item {
    padding: 14px 0;
  }

  .grade-name {
    font-size: 15px;
  }

  .grade-description {
    font-size: 13px;
  }

  .grade-btn {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }

  .grade-controls {
    gap: 10px;
  }
}

/* ============================================
   END GRADE COUNTER COMPONENT
   ============================================ */

/* Search Input Group - Grid Aligned */
.search-input-group {
  position: relative;
  margin-bottom: 12px;
}

.search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--neutral-medium);
  font-size: 0.875rem;
}

.search-input-field {
  padding-left: var(--space-10);
  border: 1px solid var(--neutral-border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  transition: border-color 0.2s ease;
}

.search-input-field:focus {
  border-color: var(--neutral-dark);
  box-shadow: 0 0 0 2px rgba(34,34,34,0.1);
  outline: none;
}

/* Section Titles - Premium Typography */
.section-title {
  font-size: 0.875rem;
  font-weight: var(--font-weight-semibold);
  color: var(--neutral-dark);
  margin-bottom: 12px;
  letter-spacing: var(--letter-spacing-wide);
  line-height: 1.2;
}

/* Filter Section Styling */
.filter-section {
  margin-bottom: 24px;
}

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

.section-label {
  font-size: 0.875rem;
  font-weight: var(--font-weight-semibold);
  color: var(--neutral-dark);
  margin-bottom: 12px;
  line-height: 1.2;
}

/* Checkbox Group Styling */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.checkbox-item {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: var(--space-2) 0;
  font-size: 0.875rem;
  color: var(--neutral-dark);
  transition: color 0.2s ease;
}

.checkbox-item:hover {
  color: var(--neutral-medium);
}

.checkbox-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: var(--space-3);
  border: 1px solid var(--neutral-border);
  border-radius: 4px;
  cursor: pointer;
}

.checkbox-item input[type="checkbox"]:checked {
  accent-color: var(--loveform-rausch);
}

/* Location Grid - LoveForm Compliant */
.location-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px; /* LoveForm spacing */
}

.location-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px; /* More padding for premium feel */
  border-radius: 12px; /* LoveForm standard radius */
  border: 1px solid #e5e7eb; /* LoveForm border */
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  font-weight: var(--font-weight-normal);
  letter-spacing: var(--letter-spacing-normal);
  background: #ffffff;
}

.location-item:hover {
  background: #f8f9fa; /* LoveForm light-gray */
  border-color: #289a96; /* LoveForm primary on hover */
  box-shadow: 0 2px 4px rgba(0,0,0,0.05); /* Subtle elevation */
}

.location-icon {
  color: var(--neutral-medium);
  font-size: 0.75rem;
}

/* Filter Groups - Grid System */
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-section {
  border-bottom: 1px solid rgba(240, 240, 240, 1);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.filter-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

/* Form Controls - Precise Spacing */
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}

.form-check-input {
  width: 18px;
  height: 18px;
  border: 2px solid var(--neutral-border);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
}

.form-check-input:checked {
  background: var(--neutral-dark);
  border-color: var(--neutral-dark);
}

.form-check-label {
  font-size: 0.875rem;
  color: var(--neutral-dark);
  cursor: pointer;
  margin: 0;
}

/* Age Range Slider */
.age-slider-container {
  margin-top: var(--space-2);
}

.age-values {
  margin-bottom: var(--space-2);
  font-weight: var(--font-weight-medium);
  color: var(--neutral-dark);
}

.dual-range-slider {
  position: relative;
  height: 6px;
  background: #EBEBEB;
  border-radius: 3px;
  margin: var(--space-3) 0;
  margin-top: var(--space-4);
}

/* Track fill - will be updated via CSS variables */
.dual-range-slider::before {
  content: '';
  position: absolute;
  height: 6px;
  background: var(--loveform-dark);
  border-radius: 3px;
  left: var(--range-start, 0%);
  width: var(--range-width, 100%);
}

.range-slider {
  position: absolute;
  width: 100%;
  height: 6px;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  margin: 0;
  top: 0;
  cursor: pointer;
}

/* Z-index for proper layering */
.range-slider:first-of-type {
  z-index: 1;
}

.range-slider:last-of-type {
  z-index: 2;
}

.range-slider::-webkit-slider-thumb {
  appearance: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--neutral-border);
  cursor: grab;
  pointer-events: auto;
  box-shadow: 0 1px 2px 0 rgba(0,0,0,0.15), 0 3px 6px 0 rgba(0,0,0,0.1);
  margin-top: -13px;
  transition: all 0.15s ease;
}

.range-slider::-webkit-slider-thumb:hover {
  box-shadow: 0 2px 4px 0 rgba(0,0,0,0.15), 0 6px 12px 0 rgba(0,0,0,0.1);
  border-color: var(--neutral-medium);
  transform: scale(1.05);
}

.range-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.1);
  box-shadow: 0 2px 4px 0 rgba(0,0,0,0.15), 0 8px 16px 0 rgba(0,0,0,0.15);
  border-color: var(--loveform-rausch);
}

.range-slider::-moz-range-thumb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--neutral-border);
  cursor: grab;
  pointer-events: auto;
  box-shadow: 0 1px 2px 0 rgba(0,0,0,0.15), 0 3px 6px 0 rgba(0,0,0,0.1);
  margin-top: -13px;
  transition: all 0.15s ease;
}

.range-slider::-moz-range-thumb:hover {
  box-shadow: 0 2px 4px 0 rgba(0,0,0,0.15), 0 6px 12px 0 rgba(0,0,0,0.1);
  border-color: var(--neutral-medium);
  transform: scale(1.05);
}

.range-slider::-moz-range-thumb:active {
  cursor: grabbing;
  transform: scale(1.1);
  box-shadow: 0 2px 4px 0 rgba(0,0,0,0.15), 0 8px 16px 0 rgba(0,0,0,0.15);
  border-color: var(--loveform-rausch);
}

.age-labels {
  font-size: 0.75rem;
  color: var(--neutral-medium);
  margin-top: var(--space-2);
}

/* Budget Slider */
.budget-slider-container {
  margin-top: var(--space-2);
}

.budget-values {
  margin-bottom: var(--space-2);
  font-weight: var(--font-weight-medium);
  color: var(--neutral-dark);
}

/* Payment Options */
.payment-options {
  padding-top: var(--space-3);
  border-top: 1px solid #f0f0f0;
}

/* Time Grid */
.time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.time-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-4);
  border: 2px solid var(--neutral-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

.time-option:hover {
  border-color: var(--neutral-dark);
  background: var(--neutral-background);
}

.time-option.selected {
  border-color: var(--neutral-dark);
  background: var(--neutral-dark);
  color: var(--white);
}

.time-option i {
  font-size: 1.25rem;
  margin-bottom: var(--space-2);
  color: var(--primary-coral);
}

.time-option.selected i {
  color: var(--white);
}

/* Search Section Position Updates */
.search-section {
  position: relative;
  border-radius: 32px;
  transition: all 0.2s ease;
}

.search-section:hover {
  background: rgba(0,0,0,0.05);
}

.search-section.active {
  background: var(--white);
  box-shadow: 0 0 0 2px var(--neutral-dark);
  border-radius: 32px;
  z-index: 1001;
}

/* Visual bridge effect when dropdown is open */
.search-section.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  right: 0;
  height: 8px;
  background: var(--white);
  z-index: 1002;
}

/* Search Bar State Updates */
.search-section.has-selection .search-label {
  font-size: 0.75rem;
  margin-bottom: var(--space-1);
}

.search-section.has-selection .search-input {
  font-size: 0.875rem;
  font-weight: var(--font-weight-medium);
  color: var(--neutral-dark);
}

/* Premium Mobile Experience for Luxury Parents */
@media (max-width: 768px) {
  .loveform-search-bar {
    flex-direction: column;
    border-radius: 24px;
    padding: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12), 0 8px 32px rgba(0,0,0,0.08);
  }

  .search-section {
    min-height: 60px;
    padding: 16px 20px;
    border-radius: 16px;
    margin-bottom: 4px;
  }

  .search-section:last-of-type {
    margin-bottom: 8px;
  }

  .search-separator {
    display: none;
  }

  .search-label {
    font-size: 0.6875rem;
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.04em;
    margin-bottom: 4px;
  }

  .search-input {
    font-size: 0.9375rem;
    font-weight: var(--font-weight-medium);
    line-height: 1.3;
  }

  .loveform-search-button {
    width: 100%;
    border-radius: 16px;
    margin: 8px 0 0 0;
    height: 52px;
    font-size: 1.0625rem;
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-wide);
    box-shadow: 0 4px 12px rgba(255, 56, 92, 0.3), 0 2px 4px rgba(0,0,0,0.12);
  }

  .loveform-search-button:hover {
    box-shadow: 0 6px 16px rgba(255, 56, 92, 0.4), 0 4px 8px rgba(0,0,0,0.15);
  }

  .search-dropdown {
    left: -20px;
    right: -20px;
    max-width: calc(100vw - 40px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15), 0 8px 16px rgba(0,0,0,0.1);
    z-index: 9999;
  }

  .location-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .location-item {
    padding: 16px;
    border-radius: 12px;
    font-size: 0.9375rem;
    min-height: 48px;
  }

  .time-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .time-option {
    padding: 20px;
    border-radius: 12px;
    min-height: 80px;
  }

  .dropdown-content {
    padding: 24px 20px;
  }

  .search-section.active::after {
    border-radius: 0 0 20px 20px;
  }

  .form-check {
    padding: 12px 0;
    gap: 12px;
  }

  .form-check-input {
    width: 20px;
    height: 20px;
  }

  .form-check-label {
    font-size: 0.9375rem;
    line-height: 1.4;
  }
}

/* Ultra-Refined Mobile for Premium Experience */
@media (max-width: 576px) {
  .loveform-search-container {
    margin: 0 16px;
  }

  .loveform-search-bar {
    border-radius: 20px;
    padding: 6px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15), 0 12px 40px rgba(0,0,0,0.1);
  }

  .search-section {
    min-height: 56px;
    padding: 14px 18px;
    border-radius: 14px;
    margin-bottom: 3px;
  }

  .search-section:last-of-type {
    margin-bottom: 6px;
  }

  .search-label {
    font-size: 0.65625rem;
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.06em;
    margin-bottom: 3px;
  }

  .search-input {
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    line-height: 1.25;
  }

  .loveform-search-button {
    border-radius: 14px;
    height: 50px;
    margin: 6px 0 0 0;
    font-size: 1rem;
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.02em;
    box-shadow: 0 6px 16px rgba(255, 56, 92, 0.35), 0 3px 6px rgba(0,0,0,0.15);
  }

  .loveform-search-button:hover {
    box-shadow: 0 8px 20px rgba(255, 56, 92, 0.45), 0 4px 8px rgba(0,0,0,0.18);
  }

  .search-dropdown {
    left: -24px;
    right: -24px;
    max-width: calc(100vw - 48px);
    border-radius: 18px;
    box-shadow: 0 24px 48px rgba(0,0,0,0.18), 0 12px 24px rgba(0,0,0,0.12);
    z-index: 9999;
  }

  .dropdown-content {
    padding: 20px 16px;
  }

  .dropdown-title {
    font-size: 1.0625rem;
    font-weight: var(--font-weight-bold);
    margin-bottom: 16px;
  }

  .location-item {
    padding: 18px 16px;
    border-radius: 14px;
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    min-height: 52px;
  }

  .time-option {
    padding: 22px 18px;
    border-radius: 14px;
    min-height: 84px;
    font-size: 0.875rem;
  }

  .form-check {
    padding: 14px 0;
    gap: 14px;
  }

  .form-check-input {
    width: 22px;
    height: 22px;
    border-radius: 6px;
  }

  .form-check-label {
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
  }

  .search-section.active::after {
    border-radius: 0 0 18px 18px;
  }
}

/* Loading and Animation States */
.loading-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: .5;
  }
}

/* LoveForm-Exact Utility Classes */
.text-loveform-rausch { color: var(--loveform-rausch); }
.bg-loveform-rausch { background-color: var(--loveform-rausch); }
.border-loveform-rausch { border-color: var(--loveform-rausch); }

.text-loveform-dark { color: var(--loveform-dark); }
.text-loveform-medium { color: var(--loveform-medium); }
.text-loveform-light { color: var(--loveform-light); }

/* Legacy compatibility */
.text-loveform-coral { color: var(--loveform-rausch); }
.bg-loveform-coral { background-color: var(--loveform-rausch); }
.border-loveform-coral { border-color: var(--loveform-rausch); }

.text-neutral-medium { color: var(--neutral-medium); }
.text-neutral-light { color: var(--neutral-light); }

.shadow-loveform-sm { box-shadow: var(--shadow-sm); }
.shadow-loveform-md { box-shadow: var(--shadow-md); }
.shadow-loveform-lg { box-shadow: var(--shadow-lg); }

.rounded-loveform-sm { border-radius: var(--radius-sm); }
.rounded-loveform-md { border-radius: var(--radius-md); }
.rounded-loveform-lg { border-radius: var(--radius-lg); }

/* ========================================
   AIRBNB FULL-WIDTH LAYOUT SYSTEM
   ======================================== */

/* Main Results Layout Container */
.loveform-results-layout {
  width: 100%;
  max-width: none;
  padding: 0 var(--space-6);
}

/* Results Header with Controls */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-6);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--neutral-border);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.results-header .results-info h2 {
  font-size: 1.75rem;
  font-weight: var(--font-weight-semibold);
  color: var(--neutral-dark);
  margin-bottom: var(--space-1);
}

.results-count {
  color: var(--neutral-medium);
  font-size: 0.95rem;
}

.location-context {
  font-style: italic;
  font-size: 0.875rem;
}

/* LoveForm-Style Controls */
.loveform-controls {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* Filters Button (LoveForm Style) */
.btn-loveform-filters {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--white);
  border: 1px solid var(--neutral-border);
  border-radius: var(--radius-lg);
  font-weight: var(--font-weight-medium);
  color: var(--neutral-dark);
  transition: all 0.2s ease;
  position: relative;
  cursor: pointer;
}

.btn-loveform-filters:hover {
  border-color: var(--neutral-dark);
  background: var(--white);
  color: var(--neutral-dark);
  box-shadow: var(--shadow-md);
}

.btn-loveform-filters .filter-count {
  background: var(--primary-coral);
  color: var(--white);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: var(--font-weight-semibold);
  margin-left: var(--space-1);
}

/* Empty state filter pills */
.empty-state-filters {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.empty-state-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.empty-state-filter-pill {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--neutral-border);
  background: var(--white);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  color: var(--neutral-dark);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.empty-state-filter-pill:hover {
  border-color: var(--neutral-dark);
  box-shadow: var(--shadow-sm);
}

/* View Controls */
.view-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.view-toggle {
  display: flex;
  background: var(--white);
  border: 1px solid var(--neutral-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.view-toggle-btn {
  padding: var(--space-2) var(--space-3);
  border: none;
  background: transparent;
  color: var(--neutral-medium);
  transition: all 0.2s ease;
  border-radius: 0;
}

.view-toggle-btn:hover {
  background: var(--neutral-background);
  color: var(--neutral-dark);
}

.view-toggle-btn.active {
  background: var(--neutral-dark);
  color: var(--white);
}

/* Sort Select */
.sort-select {
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--neutral-border);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--neutral-dark);
  font-weight: var(--font-weight-medium);
  min-width: 140px;
}

.sort-select:focus {
  border-color: var(--primary-coral);
  box-shadow: 0 0 0 2px rgba(255, 90, 95, 0.1);
  outline: none;
}

/* Full-Width Results Grid */
.loveform-results-grid {
  width: 100%;
}

.loveform-results-grid .row {
  margin: 0;
  row-gap: var(--space-8);
}

.loveform-results-grid .col {
  padding: 0 var(--space-3);
  margin-bottom: var(--space-6);
}

/* Full-Width Map View */
.loveform-map-view {
  display: flex;
  height: 80vh;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-top: var(--space-4);
}

.loveform-map-view .map-results-list {
  width: 60%;
  overflow-y: auto;
  background: var(--white);
  border-right: 1px solid var(--neutral-border);
  padding: var(--space-4);
}

.loveform-map-view .map-container {
  width: 40%;
  position: relative;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
  .loveform-results-layout {
    padding: 0 var(--space-4);
  }

  .results-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .loveform-controls {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 768px) {
  .loveform-results-layout {
    padding: 0 var(--space-3);
  }

  .results-header .results-info h2 {
    font-size: 1.5rem;
  }

  .loveform-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .view-controls {
    justify-content: center;
  }

  .sort-select {
    width: 100%;
  }

  .loveform-map-view {
    height: 70vh;
    flex-direction: column;
  }

  .loveform-map-view .map-results-list {
    width: 100%;
    height: 60%;
    border-right: none;
    border-bottom: 1px solid var(--neutral-border);
    padding: var(--space-3);
  }

  .loveform-map-view .map-container {
    width: 100%;
    height: 40%;
  }
}

@media (max-width: 576px) {
  .results-header {
    padding: var(--space-3) 0;
  }

  .btn-loveform-filters {
    width: 100%;
    justify-content: center;
  }

  .view-toggle {
    width: 100%;
  }

  .view-toggle-btn {
    flex: 1;
    text-align: center;
  }
}

/* Demo Card Styles (Ensure Consistency) */
.demo-card-container .loveform-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.demo-card-container .card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.demo-card-container .card-footer {
  margin-top: auto;
  padding-top: var(--space-3);
}

/* Placeholder Image Fallback */
img[src="/images/ui/placeholder-school.jpg"] {
  background: linear-gradient(135deg, var(--neutral-background) 0%, var(--neutral-border) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--neutral-medium);
  font-size: 0.875rem;
}

img[src="/images/ui/placeholder-school.jpg"]:after {
  content: "School Image";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Carousel Container */
.carousel-container {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  padding-bottom: var(--space-2);
  margin: 0 calc(-1 * var(--space-3)); /* Negative margin to extend to edges */
  padding: 0 var(--space-3);
}

.carousel-container::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.carousel-container .row {
  flex-wrap: nowrap !important;
}

.carousel-container .col {
  flex: 0 0 auto;
  width: 300px;
  max-width: 300px;
}

/* Carousel Navigation Header */
.carousel-header {
  margin-bottom: var(--space-4);
}

.carousel-title {
  font-size: 1.5rem;
  font-weight: var(--font-weight-semibold);
  color: var(--neutral-dark);
}

.carousel-nav-buttons {
  display: flex;
  gap: var(--space-2);
}

.carousel-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--neutral-border);
  background: var(--white);
  color: var(--neutral-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.75rem;
}

.carousel-nav-btn:hover:not(:disabled) {
  border-color: var(--neutral-dark);
  transform: scale(1.04);
  box-shadow: var(--shadow-sm);
}

.carousel-nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  color: var(--neutral-light);
}

.carousel-nav-btn:active:not(:disabled) {
  transform: scale(0.96);
}

/* Loading States */
.loading-skeleton-container {
  animation: fadeIn 0.3s ease-in-out;
}

.demo-card-container {
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   SHARED SEARCH BAR & MODAL STYLES (Migrated from search.ejs inline)
   Applies to both Landing Page and Search Page
   ========================================================================== */

/* 1. Airbnb-Style Search Section Highlight */
.search-section-btn {
    border: 1px solid transparent;
    margin: 0;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1) !important;
}

.search-section-btn:hover {
    background-color: rgba(0, 0, 0, 0.05); /* Light gray hover */
    border-color: transparent;
    z-index: 10;
}

.search-section-btn.active {
    background-color: #fff !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2) !important;
    border-color: transparent !important;
    z-index: 20 !important; /* Highest priority */
    transform: scale(1.02); /* Subtle pop */
}

/* Make labels bolder like Airbnb */
.section-label {
    font-weight: 700 !important; /* Bold labels */
    color: #222 !important;
    font-size: 12px !important;
    letter-spacing: 0.04em !important;
}

/* 2. Nested Calendar Modal Transparency
   Prevents double-dark overlay when Calendar opens on top of Search Modal */
.transportation-calendar-modal.nested-mode .modal-backdrop {
    background-color: transparent !important;
    opacity: 0 !important;
}

/* Ensure the calendar itself remains visible and on top */
.transportation-calendar-modal.nested-mode .modal-container {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important; /* Stronger shadow since backdrop is gone */
    border: 1px solid rgba(0, 0, 0, 0.1);
}
