@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=DM+Sans:wght@400;500;600;700&family=Poppins:wght@300;400;500;600;700&family=Roboto:wght@300;400;500;700&display=swap');

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  overflow-x: clip;
  /* Prevent horizontal scroll without breaking sticky header */
  max-width: 100vw;
  font-family: "Inter", "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

:root {
  /* Official Brand Colors */
  --rp-blue-dark: #00205d;
  --rp-blue-med: #0371be;
  --rp-yellow: #f9e07f;

  /* Legacy Mappings (Updating to Brand) */
  --primary-color: var(--rp-yellow);
  --primary-dark: #e5c960;
  /* Darker accent for hover */
  --secondary-color: var(--rp-blue-med);
  --text-dark: #212121;
  --text-light: #757575;
  --bg-light: #f5f5f5;
  --bg-white: #ffffff;
  --border-color: #e0e0e0;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);

  /* Typography - Unified Master Fonts */
  --font-heading:
    "Inter", "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body:
    "Inter", "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;

  /* Transitions */
  --transition: all 0.3s ease;
}

body {
  font-family: var(--font-body);
  color: var(--text-dark);
  line-height: 1.6;
  background-color: var(--bg-white);
  width: 100%;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.header {
  background-color: var(--bg-white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: var(--transition);
  /* NOTE: backdrop-filter removed — it creates a new containing block
     that breaks position:fixed children (mobile nav overlay). */
}

/* Achieve blur via pseudo-element which doesn't affect fixed children */
.header::before {
  content: '';
  position: absolute;
  inset: 0;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: -1;
  pointer-events: none;
}

.header.sticky {
  box-shadow: var(--shadow-hover);
}

.header-content {
  /* Use flexible padding instead of fixed left margin so header centers on small screens */
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem var(--spacing-md);
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.logo {
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}

.nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: var(--spacing-lg);
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  transition: var(--transition);
  padding: var(--spacing-xs) 0;
  position: relative;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--secondary-color);
  outline: none;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--secondary-color);
  transition: var(--transition);
}

.nav-link:hover::after,
.nav-link:focus::after {
  width: 100%;
}

.header-actions {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
  flex-shrink: 0;
}

/* Buttons */
.btn-primary,
.btn-secondary {
  padding: 0.625rem 1.25rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  display: inline-block;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--text-dark);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  outline: none;
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-dark);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: var(--bg-light);
  outline: none;
}

/* Premium Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  cursor: pointer;
  z-index: 1100;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  padding: 0;
}

.hamburger:hover {
  background: rgba(0, 0, 0, 0.05);
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--text-dark);
  margin: 2.5px 0;
  transition: all 0.4s cubic-bezier(0.68, -0.6, 0.32, 1.6);
  border-radius: 4px;
}

/* Custom width for a tapered look */
.hamburger span:nth-child(2) {
  width: 16px;
  margin-right: -6px;
  /* Offset to one side */
}

.hamburger.active {
  background: #f8fafc;
  border-color: rgba(25, 118, 212, 0.2);
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  width: 22px;
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(10px);
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  width: 22px;
}

.mobile-compare-header-btn {
  display: none;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  /* Responsive hero height: scales with viewport but caps to comfortable max */
  /* increased hero height */
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 6vw, 4rem) 0;
  overflow: visible !important;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
}

.hero-background::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  animation: heroSlide 18s infinite ease-in-out;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  /* Black overlay */
  z-index: 0;
  /* sit above background but behind content */
}

/* Slideshow Animation */
@keyframes heroSlide {
  0% {
    background-image: url("../images/bg-image/scl1.webp");
  }

  33% {
    background-image: url("../images/bg-image/scl5.jpg");
  }

  66% {
    background-image: url("../images/bg-image/scl2.jfif");
  }

  100% {
    background-image: url("../images/bg-image/scl4.avif");
  }
}

#globalLoader {
  /* loader is hidden by default; toggled visible by JS when needed */
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: white;
  align-items: center;
  justify-content: center;
}

.hero-content {
  text-align: center;
  color: var(--bg-white);
  max-width: 800px;
  padding: var(--spacing-md);
  animation: fadeInUp 0.8s ease-out;
  margin: 0 auto;
  align-self: center;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: var(--spacing-lg);
  opacity: 0.95;
}

.hero-image {
  max-width: 150px;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.search-tabs .tab {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1rem;
  padding: 10px 10px;
  cursor: pointer;
  position: relative;
  display: inline-block;
  /* ★ MUST */
}

.search-tabs .tab.active {
  color: #ffffff;
  font-weight: 700;
}

.search-tabs .tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  /* ★ Change this from -4px */
  width: 100%;
  height: 1.5px;
  background: #ffffff;
  border-radius: 4px;
}

/* Search input box inside the blue hero search */
.school-search-box {
  background: linear-gradient(180deg, #02102c 100%);
  padding: 1.25rem;
  border-radius: 0.5rem;
  margin-top: 1rem;
  color: #fff;
}

.search-input-box {
  display: flex;
  width: 100%;
  background: #fff;
  border-radius: 0.5rem;
  overflow: hidden;
  margin-top: 10px;
}

.search-input-box input {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 0.95rem;
  border: none;
  outline: none;
  color: var(--text-dark);
}

.search-red-btn {
  background: #e63946;
  color: #fff;
  padding: 0 1rem;
  border: none;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.search-red-btn:hover {
  background: #c92632;
}

.search-tabs {
  display: flex;
  gap: 1rem;
  position: relative;
}

/* make hero search compact on small screens */
@media (max-width: 768px) {
  .school-search-box {
    padding: 0.9rem;
  }

  .search-tabs {
    gap: 0.6rem;
  }

  .search-input-box input {
    padding: 0.6rem 0.8rem;
  }
}

/* Board block - matches location-select styling */
.board-select {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-white);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
  height: 48px;
  padding: 0 12px;
  min-width: 180px;
  flex: 0 0 200px;
}

.board-icon {
  color: var(--primary-color);
  font-size: 18px;
  flex-shrink: 0;
}

/* Remove native arrow and style select */
.board-select select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-dark);
  padding: 6px 8px;
  width: 100%;
  outline: none;
  cursor: pointer;
}

.search-wrapper {
  display: flex;
  background-color: var(--bg-white);
  border-radius: 50px;
  padding: 0.5rem;
  box-shadow: var(--shadow-hover);
  max-width: 700px;
  margin: 0 auto;
}

.search-icon {
  color: var(--text-light);
  padding: 0.75rem 1rem;
  align-self: center;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0.75rem;
  font-size: 1rem;
  font-family: var(--font-body);
  color: var(--text-dark);
}

.search-input::placeholder {
  color: var(--text-light);
}

.search-btn {
  background-color: var(--primary-color);
  color: var(--text-dark);
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  font-family: var(--font-body);
}

.search-btn:hover,
.search-btn:focus {
  background-color: var(--primary-dark);
  transform: scale(1.05);
  outline: none;
}

.search-bar-form {
  width: 100%;
}

.search-bar-inner {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

/* Location block */
.location-select {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-white);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
  height: 48px;
  padding: 0 12px;
  min-width: 200px;
  flex: 0 0 220px;
}

.location-select .location-icon {
  color: var(--primary-color);
  font-size: 18px;
  flex-shrink: 0;
}

/* Remove native arrow and style select */
.location-select select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-dark);
  padding: 6px 8px;
  width: 100%;
  outline: none;
  cursor: pointer;
}

/* Search block */
.search-section {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-white);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
  height: 48px;
  padding: 0 12px;
  flex: 1 1 auto;
  min-width: 250px;
  max-width: 500px;
  border: 2px solid transparent;
  transition: border-color 0.3s ease;
}

.search-section:focus-within {
  border-color: var(--primary-color);
}

/* left search icon inside input */
.search-left-icon {
  color: var(--text-light);
  font-size: 18px;
  flex-shrink: 0;
  padding: 0 8px;
  margin-right: 4px;
}

/* KEEP your existing ID `searchInput` - style applied here */
#searchInput {
  border: none;
  outline: none;
  font-size: 0.95rem;
  padding: 8px 6px;
  background: transparent;
  width: 100%;
  min-width: 150px;
  flex: 1;
  font-family: var(--font-body);
  color: var(--text-dark);
}

#searchInput:focus,
.search-btn:focus {
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.12);
}

/* Mobile: stack vertically */
@media (max-width: 768px) {
  .search-bar-inner {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .location-select,
  .board-select,
  .search-section {
    width: 100%;
    min-width: 0;
    flex: 0 0 auto;
  }

  .search-btn {
    height: 44px;
    padding: 10px 16px;
    border-radius: 10px;
    margin-right: 0;
  }

  .search-section {
    padding: 0 10px;
  }
}

/* Small tweak for very small screens */
@media (max-width: 480px) {

  .location-select,
  .board-select {
    padding: 0 10px;
  }

  .search-left-icon,
  .location-select .location-icon,
  .board-select .board-icon {
    font-size: 15px;
  }

  #searchInput {
    font-size: 0.95rem;
  }
}

/* ============================================
   CITIES SECTION
   ============================================ */
.cities-section {
  padding: var(--spacing-xl) 0;
  background-color: var(--bg-light);
}

.section-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: var(--spacing-lg);
  text-align: center;
  color: var(--text-dark);
}

.cities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
}

.city-card {
  background-color: var(--bg-white);
  border-radius: 12px;
  overflow: hidden;
  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.06);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.city-card:hover,
.city-card:focus {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(16, 24, 40, 0.1);
  outline: none;
}

.city-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.city-info {
  padding: 1rem;
  text-align: center;
}

.city-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  color: var(--text-dark);
}

.city-link {
  color: var(--secondary-color);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  margin-top: var(--spacing-xs);
}

.footer-logo {
  height: clamp(32px, 3.5vh, 48px);
  width: auto;
  display: block;
}

.site-logo {
  height: clamp(36px, 4.5vh, 56px);
  width: auto;
  display: block;
}

.city-link:hover,
.city-link:focus {
  text-decoration: underline;
  outline: none;
}

/* ============================================
   RESULTS SECTION
   ============================================ */
.results-section {
  padding: var(--spacing-xl) 0;
  background-color: var(--bg-light);
  min-height: 400px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.results-count {
  color: var(--text-light);
  font-size: 0.9rem;
}

.schools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-lg);
}

/* Premium card refinements for dynamically-generated cards inside #schoolsGrid */
#schoolsGrid>div,
#schoolsGrid .group,
#schoolsGrid .school-card,
#schoolsGrid .bg-white.rounded-lg,
#schoolsGrid .bg-white.rounded-2xl {
  border-radius: 14px !important;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.08) !important;
  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  background-clip: padding-box;
}

#schoolsGrid>div:hover,
#schoolsGrid .group:hover,
#schoolsGrid .school-card:hover {
  transform: translateY(-6px) scale(1.01) !important;
  box-shadow: 0 18px 40px rgba(16, 24, 40, 0.12) !important;
}

/* Ensure header images cover and are responsive */
#schoolsGrid img,
#schoolsGrid .relative img,
.city-card .city-image,
.school-image {
  width: 100% !important;
  height: auto !important;
  object-fit: cover !important;
  display: block !important;
}

/* Fix card content spacing and ensure footer button sticks to bottom */
#schoolsGrid .p-5,
#schoolsGrid .p-6,
#schoolsGrid .school-info,
#schoolsGrid .card-content {
  padding: 1rem !important;
}

/* Keep long text from breaking layout */
.truncate-multiline {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Facilities icons uniform size */
#schoolsGrid .w-6.h-6,
#schoolsGrid .w-6.h-6 i,
#schoolsGrid .flex-shrink-0 i {
  width: 20px;
  height: 20px;
  font-size: 12px;
}

/* City cards: premium look */
.city-card {
  border-radius: 12px;
  overflow: hidden;
  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.06);
}

.city-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(16, 24, 40, 0.1);
}

.city-image {
  height: 160px;
  object-fit: cover;
}

.city-info {
  padding: 1rem;
}

/* Make hero height responsive */
@media (max-width: 1200px) {
  .hero {
    /* larger hero on large tablets / small laptops */
    min-height: 80vh;
  }
}

@media (max-width: 768px) {
  .hero {
    /* increased for tablets */
    min-height: 70vh;
    padding: var(--spacing-lg) 0;
  }

  .hero-title {
    font-size: 2rem;
  }
}

/* Small screens: tighter card paddings and readable text */
@media (max-width: 480px) {

  #schoolsGrid>div,
  #schoolsGrid .school-card,
  .city-card {
    border-radius: 10px !important;
    box-shadow: 0 6px 18px rgba(16, 24, 40, 0.06) !important;
  }

  .hero {
    /* increased for small screens */
    min-height: 50vh;
  }
}

/* Override any inline left-margin used in dynamic placeholders so cards stay centered */
#schoolsGrid .w-full.h-40 {
  margin-left: 0 !important;
}

/* Ensure text inside dynamic gradient placeholders scales on small screens */
#schoolsGrid .w-full.h-40 {
  padding: 0.75rem;
}

#schoolsGrid .w-full.h-40,
#schoolsGrid .w-full.h-40>* {
  white-space: normal;
  word-break: break-word;
}

.school-card {
  background-color: var(--bg-white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.school-card:hover,
.school-card:focus-within {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.school-image {
  width: 100%;
  /* Use aspect-ratio so images scale responsively without hard-coded heights */
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.school-info {
  padding: var(--spacing-md);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.school-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: var(--spacing-xs);
}

.school-name {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0;
  flex: 1;
}

.school-rating {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.9rem;
}

.school-description {
  color: var(--text-light);
  font-size: 0.9rem;
  margin: var(--spacing-xs) 0;
  line-height: 1.5;
  flex: 1;
}

.school-location {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-light);
  font-size: 0.85rem;
  margin: var(--spacing-xs) 0;
}

.school-location i {
  color: var(--secondary-color);
}

.school-btn {
  margin-top: var(--spacing-sm);
  padding: 0.625rem 1rem;
  background-color: var(--secondary-color);
  color: var(--bg-white);
  border: none;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  text-decoration: none;
  display: inline-block;
  width: 100%;
}

.school-btn:hover,
.school-btn:focus {
  background-color: #1565c0;
  transform: translateY(-2px);
  outline: none;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background-color: var(--text-dark);
  color: var(--bg-white);
  padding: var(--spacing-xl) 0 var(--spacing-md);
  margin-top: var(--spacing-xl);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.footer-section h3,
.footer-section h4 {
  font-family: var(--font-heading);
  margin-bottom: var(--spacing-sm);
  color: var(--primary-color);
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: var(--spacing-xs);
}

.footer-section a {
  color: var(--bg-white);
  text-decoration: none;
  transition: var(--transition);
  opacity: 0.9;
}

.footer-section a:hover,
.footer-section a:focus {
  opacity: 1;
  color: var(--primary-color);
  outline: none;
}

.footer-bottom {
  text-align: center;
  padding-top: var(--spacing-md);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0.8;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet */
@media (max-width: 1100px) {
  .mobile-compare-header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #00205d;
    color: #ffffff;
    font-weight: 700;
    font-size: 12px;
    height: 36px;
    padding: 0 14px;
    border-radius: 8px;
    text-decoration: none;
    margin-right: 12px;
    box-shadow: 0 2px 8px rgba(0, 32, 93, 0.25);
    transition: all 0.2s ease;
  }

  .hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0;
    height: 40px;
    width: 40px;
    border-radius: 10px;
    padding: 0;
  }

  .nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }

  .header-content {
    display: flex;
    align-items: center;
    -webkit-align-items: center;
    /* Safari fix */
    justify-content: space-between;
    flex-wrap: nowrap;
    /* Prevent wrapping on mobile */
    height: 70px;
    /* Consistent height matching nav offset */
    padding: 0 var(--spacing-xs);
    /* Reduced horizontal padding to move items towards edges */
  }

  .nav-list {
    position: fixed;
    inset: 0;
    height: 100vh;
    overflow: hidden;
    /* prevent internal scroll shifting nav items */
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-lg);
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1050;
    gap: 1.25rem;
  }

  .nav-list.active {
    transform: translateY(0);
    opacity: 1;
  }

  .nav-list li {
    width: 100%;
    max-width: 300px;
    text-align: center;
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .nav-list.active li {
    transform: translateY(0);
    opacity: 1;
  }

  .nav-list.active li:nth-child(1) { transition-delay: 0.1s; }
  .nav-list.active li:nth-child(2) { transition-delay: 0.15s; }
  .nav-list.active li:nth-child(3) { transition-delay: 0.2s; }
  .nav-list.active li:nth-child(4) { transition-delay: 0.25s; }
  .nav-list.active li:nth-child(5) { transition-delay: 0.3s; }
  .nav-list.active li:nth-child(6) { transition-delay: 0.35s; }
  .nav-list.active li:nth-child(7) { transition-delay: 0.4s; }

  .nav-link {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 160px !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    font-size: 0.95rem !important;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #0170c0 0%, #02205c 100%);
    padding: 0.6rem 1rem !important;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(2, 32, 92, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all 0.3s ease;
  }

  .nav-link:hover, .nav-link:active, .nav-link:focus {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(2, 32, 92, 0.3);
    background: linear-gradient(135deg, #0371be 0%, #00205d 100%);
    color: #ffffff; /* Keep text white on hover instead of turning blue */
  }

  /* Hide the underline effect on mobile for the premium button look */
  .nav-link::after {
    display: none;
  }

  .header-actions {
    gap: var(--spacing-xs);
  }

  .btn-primary,
  .btn-secondary {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .search-wrapper {
    flex-direction: column;
    border-radius: 8px;
    padding: var(--spacing-sm);
  }

  .search-btn {
    width: 100%;
    justify-content: center;
    border-radius: 4px;
  }

  .cities-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-sm);
  }

  .schools-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--spacing-md);
  }

  .results-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .container {
    padding: 0 var(--spacing-xs);
    /* Use smaller spacing for very small screens */
  }

  .header-content {
    padding: var(--spacing-xs) 0;
  }

  .logo-text {
    font-size: 1.2rem;
  }

  .header-actions {
    display: none;
  }

  .hero {
    /* increased for mobile devices */
    min-height: 55vh;
    padding: var(--spacing-lg) 0;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .cities-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .schools-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
*:focus-visible {
  outline: 2px solid var(--secondary-color);
  outline-offset: 2px;
}

/* Skip to main content link (hidden by default, visible on focus) */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--secondary-color);
  color: var(--bg-white);
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================
   ABOUT US PAGE STYLES
   ============================================ */

/* About Hero */
.about-hero {
  position: relative;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--bg-white);
  overflow: hidden;
  margin-bottom: var(--spacing-xl);
}

.about-hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  animation: aboutHeroSlide 24s infinite ease-in-out;
  z-index: -2;
}

@keyframes aboutHeroSlide {

  /* using available / verified images; duplicates used as fallbacks */
  0% {
    background-image: url("../images/about-hero/bul-2.jfif");
  }

  33% {
    background-image: url("../images/about-hero/bul-2.jfif");
  }

  66% {
    background-image: url("../images/about-hero/bul-2.jfif");
  }

  100% {
    background-image: url("../images/about-hero/bul-2.jfif");
  }
}

.about-hero-bg::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1;
}

.about-hero-content {
  max-width: 800px;
  padding: var(--spacing-md);
  animation: fadeInUp 1s ease-out;
  position: relative;
  z-index: 10;
}

.about-title {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: var(--spacing-sm);
  line-height: 1.1;
}

.about-title .highlight {
  color: var(--primary-color);
}

.about-subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* Mission Section */
.mission-section {
  padding: var(--spacing-xl) 0;
  background-color: var(--bg-white);
}

.mission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-lg);
}

.mission-card {
  background: var(--bg-white);
  padding: var(--spacing-lg);
  border-radius: 12px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.mission-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-color);
}

.icon-box {
  width: 70px;
  height: 70px;
  background-color: rgba(255, 193, 7, 0.1);
  color: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin: 0 auto var(--spacing-md);
  transition: var(--transition);
}

.mission-card:hover .icon-box {
  background-color: var(--primary-color);
  color: var(--bg-white);
  transform: rotateY(360deg);
}

.mission-card h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin-bottom: var(--spacing-sm);
  color: var(--text-dark);
}

.mission-card p {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* Stats Section */
.stats-section {
  padding: var(--spacing-xl) 0;
  background-color: var(--secondary-color);
  color: var(--bg-white);
  margin: var(--spacing-xl) 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--spacing-lg);
  text-align: center;
}

.stat-item {
  padding: var(--spacing-md);
}

.stat-number {
  display: block;
  font-size: 3rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--primary-color);
  margin-bottom: var(--spacing-xs);
}

.stat-label {
  font-size: 1rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Story Section */
.story-section {
  padding: var(--spacing-xl) 0;
}

.story-content {
  display: flex;
  align-items: center;
  gap: var(--spacing-xl);
  flex-wrap: wrap;
}

.story-text {
  flex: 1;
  min-width: 300px;
}

.story-text h2 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  margin-bottom: var(--spacing-md);
  position: relative;
  display: inline-block;
}

.story-text h2::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 50px;
  height: 4px;
  background-color: var(--primary-color);
  border-radius: 2px;
}

.story-text p {
  margin-bottom: var(--spacing-md);
  font-size: 1.05rem;
  color: var(--text-light);
}

.story-image {
  flex: 1;
  min-width: 300px;
  position: relative;
}

.story-image img {
  width: 100%;
  border-radius: 12px;
  box-shadow: var(--shadow-hover);
}

.story-image::before {
  content: "";
  position: absolute;
  top: -20px;
  right: -20px;
  width: 100%;
  height: 100%;
  border: 2px solid var(--primary-color);
  border-radius: 12px;
  z-index: -1;
}

/* Team Section */
.team-section {
  padding: var(--spacing-xl) 0;
  background-color: var(--bg-light);
}

.text-center {
  text-align: center;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-lg);
}

.team-card {
  background: var(--bg-white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  text-align: center;
}

.team-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
}

.member-img {
  height: 250px;
  overflow: hidden;
}

.member-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.team-card:hover .member-img img {
  transform: scale(1.1);
}

.member-info {
  padding: var(--spacing-md);
}

.member-info h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: 5px;
  color: var(--text-dark);
}

.member-info span {
  color: var(--primary-dark);
  font-size: 0.9rem;
  font-weight: 600;
  display: block;
  margin-bottom: var(--spacing-sm);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: var(--spacing-sm);
}

.social-links a {
  width: 35px;
  height: 35px;
  background-color: var(--bg-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  transition: var(--transition);
}

.social-links a:hover {
  background-color: var(--secondary-color);
  color: var(--bg-white);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .about-title {
    font-size: 2.5rem;
  }

  .story-content {
    flex-direction: column;
  }

  .story-image::before {
    display: none;
  }
}

/* Select2 overrides to match site styles (48px height, rounded corners) */
.select2-container--default .select2-selection--single {
  height: 48px;
  border-radius: 10px;
  background: var(--bg-white);
  border: none;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
  padding: 6px 10px;
  display: flex;
  align-items: center;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 16px !important;
  color: var(--text-dark);
  font-family: var(--font-body);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 48px;
  right: 8px;
}

/* ensure dropdown width behaves well inside flex */
.select2-container {
  width: 100% !important;
}

/* Make sure the original select is visually hidden when Select2 is active
   (Select2 will handle the visible UI) */
.location-select select {
  display: block;
  /* keep it available for forms; Select2 hides it visually */
}

/* Global field error styling (Red outline + Red text) */
.field-error .select2-container--default .select2-selection--single,
.field-error select,
select.field-error,
.field-error input,
input.field-error {
  border: 2px solid #ef4444 !important;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25) !important;
  background-color: #fff5f5 !important;
  color: #ef4444 !important;
}

.field-error .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #ef4444 !important;
}

.field-error .select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: #ef4444 transparent transparent transparent !important;
}

select.field-error option {
  color: #000000;
}

/* Anti-gravity floating animation */
@keyframes float-modal {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-8px);
  }

  100% {
    transform: translateY(0px);
  }
}

.animate-float-modal {
  animation: float-modal 6s ease-in-out infinite;
}

/* ============================================
   NEW SECTIONS STYLES
   ============================================ */

/* Hide Scrollbar */
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Swiper Custom Buttons */
.swiper-button-prev-custom.swiper-button-disabled,
.swiper-button-next-custom.swiper-button-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* FAQ Transition */
.faq-content {
  transition: all 0.3s ease-in-out;
}

/* Board Card Snap */
.snap-x {
  scroll-snap-type: x mandatory;
}

.snap-center {
  scroll-snap-align: center;
}

/* ============================================
   AI CHAT WIDGET STYLES
   ============================================ */
.ai-chat-float {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  z-index: 1000;
  font-size: 24px;
  transition: all 0.3s ease;
  animation: floatChat 3s ease-in-out infinite;
}

.ai-chat-float:hover {
  transform: scale(1.1);
}

@keyframes floatChat {
  0% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }

  100% {
    transform: translateY(0);
  }
}

@media (max-width: 430px) {
  .ai-chat-float {
    width: 44px;
    height: 44px;
    bottom: 20px;
    right: 12px;
    font-size: 20px;
  }
}

.hidden {
  display: none !important;
}

.ai-chat-window {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 350px;
  height: 500px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.5);
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-chat-header {
  background: linear-gradient(135deg, #4f46e5, #9333ea);
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
}

.ai-chat-body {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: #f9fafb;
}

.ai-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.user-msg {
  align-self: flex-end;
  max-width: 80%;
}

.ai-avatar {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #4f46e5, #9333ea);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  flex-shrink: 0;
}

.msg-bubble {
  padding: 10px 15px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.ai-msg .msg-bubble {
  background: white;
  color: #374151;
  border-top-left-radius: 2px;
}

.user-msg .msg-bubble {
  background: #4f46e5;
  color: white;
  border-bottom-right-radius: 2px;
}

.ai-chat-footer {
  padding: 10px;
  background: white;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 10px;
}

#aiChatInput {
  flex: 1;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 10px 15px;
  outline: none;
  font-size: 14px;
  transition: 0.2s;
}

#aiChatInput:focus {
  border-color: #4f46e5;
}

#aiChatSend {
  width: 40px;
  height: 40px;
  background: #4f46e5;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  border: none;
  transition: 0.2s;
}

#aiChatSend:hover {
  background: #4338ca;
  transform: scale(1.05);
}

.typing-indicator span {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #9ca3af;
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
  margin: 0 2px;
}

.typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {

  0%,
  80%,
  100% {
    transform: scale(0);
  }

  40% {
    transform: scale(1);
  }
}

/* Custom Scrollbar for Compare List */
.custom-scrollbar::-webkit-scrollbar {
  width: 5px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ============================================================
   MOBILE COMPACT UI OVERRIDES (Compact Cards & Shorter Scroll)
   ============================================================ */
@media (max-width: 768px) {
  /* Section Spacing */
  section,
  .section,
  .py-16,
  .py-20,
  .py-24,
  .py-12 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }

  /* Card Compact Padding & Margins */
  .card,
  .contact-card,
  .school-card,
  .rp-search-card,
  .bg-white.rounded-2xl,
  .bg-white.rounded-xl,
  .bg-slate-900.rounded-2xl,
  .shadow-lg,
  .shadow-xl,
  .shadow-2xl {
    padding: 1.25rem 1rem !important;
    margin-bottom: 1rem !important;
    border-radius: 14px !important;
  }

  /* Compact Card Heights & Layouts */
  .min-h-\[400px\],
  .min-h-\[500px\],
  .min-h-\[600px\] {
    min-height: auto !important;
  }

  /* Compact Input & Select Heights on Mobile */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  select,
  .select2-container--default .select2-selection--single {
    height: 48px !important;
    min-height: 48px !important;
    font-size: 14px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  /* Headings & Text Margins on Mobile */
  h1:not(.blog-content *):not(.ql-editor *), .h1 {
    font-size: 1.75rem !important;
    margin-bottom: 0.75rem !important;
  }

  h2:not(.blog-content *):not(.ql-editor *), .h2, .section-title {
    font-size: 1.35rem !important;
    margin-bottom: 0.5rem !important;
    line-height: 1.25 !important;
  }

  h3:not(.blog-content *):not(.ql-editor *), .h3 {
    font-size: 1.15rem !important;
    margin-bottom: 0.5rem !important;
  }

  p:not(.blog-content *):not(.ql-editor *) {
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
  }

  .gap-8, .gap-10, .gap-12 {
    gap: 1rem !important;
  }

  .space-y-6 > :not([hidden]) ~ :not([hidden]),
  .space-y-8 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 1rem !important;
  }
}