/**
 * ============================================================================
 * Front-End Engineering Specification: UI/UX & Visual Polish Layer
 * Target: schoolsindia.com
 * File: enhancements.css
 * 
 * Non-destructive CSS modernization layer preserving all HTML IDs, class hooks,
 * form attributes, and JS event bindings.
 * ============================================================================
 */

/* ----------------------------------------------------------------------------
 * 1. DESIGN SYSTEM VARIABLES & TOKENS
 * ---------------------------------------------------------------------------- */
:root {
  /* Brand Identity Palette */
  --si-primary: #0070c9;
  --si-primary-hover: #005a9e;
  --si-primary-soft: rgba(0, 112, 201, 0.08);
  --si-primary-border: rgba(0, 112, 201, 0.2);

  --si-dark: #051229;
  --si-dark-surface: #0f172a;
  --si-dark-hover: #1e293b;

  --si-accent-emerald: #10b981;
  --si-accent-amber: #f59e0b;
  --si-accent-rose: #f43f5e;

  /* Modern Neutral Scale (Eliminating harsh black & stark greys) */
  --si-neutral-text-main: #1e293b;     /* Slate-800: high-contrast, WCAG AA */
  --si-neutral-text-muted: #64748b;    /* Slate-500: readable secondary text */
  --si-neutral-text-light: #94a3b8;    /* Slate-400: subtle placeholder */
  
  --si-surface-canvas: #ffffff;
  --si-surface-subtle: #f8fafc;        /* Slate-50: soft elevated surface */
  --si-surface-card: #ffffff;
  
  --si-border-light: #e2e8f0;          /* Slate-200: soft border */
  --si-border-medium: #cbd5e1;         /* Slate-300 */
  --si-divider: #f1f5f9;               /* Slate-100 */

  /* Elevation & Shadow Tokens */
  --si-shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --si-shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.06);
  --si-shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --si-shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --si-shadow-hover: 0 12px 24px -4px rgba(15, 23, 42, 0.1), 0 4px 6px -2px rgba(15, 23, 42, 0.05);

  /* Radius Tokens */
  --si-radius-sm: 6px;
  --si-radius-md: 10px;
  --si-radius-lg: 14px;
  --si-radius-pill: 9999px;

  /* Transitions */
  --si-transition-fast: 0.2s ease;
  --si-transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ----------------------------------------------------------------------------
 * 2. TYPOGRAPHY & READABILITY DIRECTIVES (Section 2.A)
 * ---------------------------------------------------------------------------- */
body {
  font-family: 'Plus Jakarta Sans', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--si-neutral-text-main);
  background-color: var(--si-surface-canvas);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Standardized Heading Scale & Line Heights */
h1, h2, h3, h4, h5, h6 {
  color: var(--si-neutral-text-main);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
}

h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  letter-spacing: -0.015em;
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
}

h4 {
  font-size: 1.125rem;
  font-weight: 600;
}

/* Body Copy Spacing & Elimination of Wall-of-Text */
p {
  color: var(--si-neutral-text-main);
  line-height: 1.62;
  margin-bottom: 0.75rem;
}

p:last-child {
  margin-bottom: 0;
}

/* Replace harsh stark blacks in utility text */
.text-black, .text-\[\#051229\], .text-\[\#111827\], .text-gray-800, .text-gray-900 {
  color: var(--si-neutral-text-main) !important;
}

.text-\[\#364052\], .text-gray-700, .text-gray-600 {
  color: #334155 !important;
}

.text-\[\#8C8C8C\], .text-\[\#A9B0B8\], .text-gray-500 {
  color: var(--si-neutral-text-muted) !important;
}

/* ----------------------------------------------------------------------------
 * 3. COLOR PALETTE & SURFACE ELEVATION (Section 2.B)
 * ---------------------------------------------------------------------------- */

/* Soften legacy border lines */
.border-\[\#BFBFBF\],
.border-\[\#C4C3C3\],
.border-\[\#E5E7EB\],
.border-gray-200,
.border-gray-300 {
  border-color: var(--si-border-light) !important;
}

/* Elevated Containers & Cards */
.bg-white {
  background-color: var(--si-surface-card);
}

.rounded-lg {
  border-radius: var(--si-radius-md) !important;
}

.rounded-xl {
  border-radius: var(--si-radius-lg) !important;
}

/* Refined dividers */
hr, .border-b, .border-t {
  border-color: var(--si-divider);
}

/* ----------------------------------------------------------------------------
 * 4. DIRECTORY CARDS & LISTING ITEMS (Section 2.C)
 * ---------------------------------------------------------------------------- */

/* School listing item card enhancement */
div[class*="border border-[#C4C3C3]"],
.school-item-card,
.school-group-card {
  background: var(--si-surface-card);
  border: 1px solid var(--si-border-light) !important;
  border-radius: var(--si-radius-lg) !important;
  box-shadow: var(--si-shadow-sm) !important;
  transition: transform var(--si-transition-fast), box-shadow var(--si-transition-fast), border-color var(--si-transition-fast) !important;
  padding: 1.25rem !important;
}

/* Subtle hover lift and shadow expansion */
div[class*="border border-[#C4C3C3]"]:hover,
.school-item-card:hover,
.school-group-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1 !important;
  box-shadow: var(--si-shadow-hover) !important;
}

/* School image container styling */
div[class*="border border-[#C4C3C3]"] .relative.w-\[270px\] img,
.school-item-card img.object-cover {
  border-radius: var(--si-radius-md);
  border: 1px solid var(--si-border-light);
  transition: transform var(--si-transition-fast);
}

/* Metadata Pill Badges (CBSE, Co-Ed, English Medium, Day School, etc.) */
span.bg-\[\#0070C91A\],
span[class*="bg-[#0070C91A]"],
.badge-pill {
  background-color: #f0f7ff !important;
  color: #0265b8 !important;
  border: 1px solid #d0e4ff !important;
  border-radius: var(--si-radius-pill) !important;
  padding: 0.35rem 0.85rem !important;
  font-size: 0.785rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background-color var(--si-transition-fast), color var(--si-transition-fast);
}

span.bg-\[\#0070C91A\]:hover {
  background-color: #e0effe !important;
  color: #005a9e !important;
}

/* Status Badges */
span.bg-\[\#21A989\],
span.bg-emerald-600 {
  background-color: #ecfdf5 !important;
  color: #047857 !important;
  border: 1px solid #a7f3d0 !important;
  font-weight: 600 !important;
  font-size: 0.75rem !important;
}

span.bg-\[\#0070C9\],
span.bg-blue-600 {
  background-color: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1px solid #bfdbfe !important;
  font-weight: 600 !important;
}

span.bg-\[\#B45309\],
span.bg-\[\#FEF3C7\] {
  background-color: #fffbeb !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
  font-weight: 600 !important;
}

/* ----------------------------------------------------------------------------
 * 5. FORM ELEMENTS & INTERACTIVE CONTROLS (Section 2.D)
 * ---------------------------------------------------------------------------- */

/* Search Box Container */
.home-search-tabs {
  border-bottom: 1px solid var(--si-border-light);
}

.search-tab {
  border-bottom-width: 2px !important;
  font-weight: 600;
  transition: all var(--si-transition-fast) !important;
}

.search-tab:hover {
  color: var(--si-primary) !important;
}

/* Modernized Search Inputs */
input[type="text"]:not(.clean-input),
input[type="search"]:not(.clean-input),
input[type="email"]:not(.clean-input),
input[type="password"]:not(.clean-input),
input[type="number"]:not(.clean-input),
input[type="tel"]:not(.clean-input),
select:not(.clean-input),
textarea:not(.clean-input) {
  background-color: var(--si-surface-subtle) !important;
  border: 1.5px solid var(--si-border-light) !important;
  color: var(--si-neutral-text-main) !important;
  border-radius: var(--si-radius-md) !important;
  transition: border-color var(--si-transition-fast), background-color var(--si-transition-fast), box-shadow var(--si-transition-fast) !important;
  font-size: 0.95rem;
}

input[type="text"]:not(.clean-input):focus,
input[type="search"]:not(.clean-input):focus,
input[type="email"]:not(.clean-input):focus,
input[type="tel"]:not(.clean-input):focus,
select:not(.clean-input):focus,
textarea:not(.clean-input):focus {
  background-color: #ffffff !important;
  border-color: var(--si-primary) !important;
  outline: 2px solid var(--si-primary) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 4px rgba(0, 112, 201, 0.12) !important;
}

/* Placeholder refinement */
::placeholder {
  color: var(--si-neutral-text-light) !important;
  opacity: 1;
}

/* Modern Dropdown & Autocomplete Panels */
#history-dropdown,
.share-menu,
.phone-menu {
  border: 1px solid var(--si-border-light) !important;
  border-radius: var(--si-radius-md) !important;
  box-shadow: var(--si-shadow-lg) !important;
  backdrop-filter: blur(8px);
}

/* Buttons & Touch Targets */
button,
a.btn,
.search-btn,
.btn-mobile,
.hero-btn {
  transition: all var(--si-transition-fast) ease-in-out !important;
}

/* Mobile & Touch Target Standard (44px Minimum) */
@media (max-width: 768px) {
  button,
  a[role="button"],
  .search-tab,
  .fav-heart-btn,
  .compare-btn,
  .view-map-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* Standardized Primary & Secondary Button Polishing */
.search-btn {
  background-color: var(--si-dark) !important;
  border-radius: var(--si-radius-pill) !important;
  box-shadow: var(--si-shadow-xs);
}

.search-btn:hover {
  background-color: var(--si-primary) !important;
  box-shadow: var(--si-shadow-md);
  transform: translateY(-1px);
}

/* Action buttons in school card */
a[href*="school-detail"],
a[href*="schoolEnquiry"],
.upcoming-admission-btn {
  border-radius: var(--si-radius-pill) !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
  padding: 0.5rem 1.15rem !important;
  box-shadow: var(--si-shadow-xs);
  transition: all var(--si-transition-fast) !important;
}

a[href*="school-detail"]:hover,
a[href*="schoolEnquiry"]:hover {
  box-shadow: var(--si-shadow-md);
  transform: translateY(-1px);
}

/* ----------------------------------------------------------------------------
 * 6. DATA PRESENTATION: TABLES & INFO GRIDS (Section 2.E)
 * ---------------------------------------------------------------------------- */

/* Responsive Table Container with Smooth Scrolling */
.compare-wrapper,
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--si-radius-lg);
  border: 1px solid var(--si-border-light);
  box-shadow: var(--si-shadow-sm);
  background: var(--si-surface-card);
}

/* Table Modernization & Zebra Striping */
.compare-table,
table.data-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

.compare-table th,
table.data-table th {
  background: var(--si-primary) !important;
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 14px 18px !important;
  border-bottom: 2px solid #005a9e;
}

.compare-table td,
table.data-table td {
  padding: 14px 18px !important;
  font-size: 0.925rem;
  color: var(--si-neutral-text-main);
  border-bottom: 1px solid var(--si-divider) !important;
  vertical-align: middle;
}

/* Zebra Striping */
.compare-table tbody tr:nth-child(even) td,
table.data-table tbody tr:nth-child(even) td {
  background-color: var(--si-surface-subtle) !important;
}

/* Hover Row Highlight */
.compare-table tbody tr:hover td,
table.data-table tbody tr:hover td {
  background-color: #f1f8fe !important;
}

/* First Column Sticky & Distinct Styling */
.compare-table td:first-child {
  background-color: #0f172a !important;
  color: #e2e8f0 !important;
  font-weight: 600;
}

/* School Detail Key Stats Grid Polishing */
#key-stats-card,
#nearby-card {
  background-color: var(--si-surface-card) !important;
  border: 1px solid var(--si-border-light) !important;
  border-radius: var(--si-radius-lg) !important;
  box-shadow: var(--si-shadow-sm) !important;
}

#key-stats-card .grid > div {
  padding: 0.75rem 1rem;
  background: var(--si-surface-subtle);
  border: 1px solid var(--si-divider);
  border-radius: var(--si-radius-md);
  transition: border-color var(--si-transition-fast), background-color var(--si-transition-fast);
}

#key-stats-card .grid > div:hover {
  background: #ffffff;
  border-color: #cbd5e1;
}

#key-stats-card p.text-\[\#8C8C8C\] {
  color: var(--si-neutral-text-muted) !important;
  font-size: 0.775rem !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

#key-stats-card p.text-\[\#364052\] {
  color: var(--si-neutral-text-main) !important;
  font-size: 0.95rem !important;
  font-weight: 700;
}

/* ----------------------------------------------------------------------------
 * 7. MICRO-TRANSITIONS & VISUAL POLISH (Section 2.F)
 * ---------------------------------------------------------------------------- */

/* Global Smooth Transitions */
a,
button,
input,
select,
textarea {
  transition: color var(--si-transition-fast),
              background-color var(--si-transition-fast),
              border-color var(--si-transition-fast),
              box-shadow var(--si-transition-fast),
              transform var(--si-transition-fast);
}

/* Subtle focus indicators for accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--si-primary);
  outline-offset: 3px;
}

/* Fallback & Missing Image Treatment */
img[alt]:after {
  content: "";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  border-radius: inherit;
}

/* City cards polish */
#city-container a {
  background: #ffffff !important;
  border: 1px solid var(--si-border-light) !important;
  box-shadow: var(--si-shadow-xs) !important;
  border-radius: var(--si-radius-md) !important;
  transition: transform var(--si-transition-fast), box-shadow var(--si-transition-fast), border-color var(--si-transition-fast) !important;
}

#city-container a:hover {
  border-color: var(--si-primary) !important;
  transform: translateY(-2px) !important;
  box-shadow: var(--si-shadow-hover) !important;
}

/* Empty State Modernization */
div[class*="border border-[#C4C3C3]"].justify-center {
  background: var(--si-surface-subtle) !important;
  border: 1.5px dashed #cbd5e1 !important;
  border-radius: var(--si-radius-lg) !important;
  box-shadow: none !important;
}

/* ----------------------------------------------------------------------------
 * 8. RESPONSIVE PARITY (Desktop 1200px+, Tablet 768px-1024px, Mobile <768px)
 * ---------------------------------------------------------------------------- */
@media (min-width: 1200px) {
  .max-w-7xl {
    max-width: 80rem;
  }
}

@media (max-width: 768px) {
  /* Prevent horizontal overflow */
  body, html {
    overflow-x: hidden;
  }

  /* Full-width cards on mobile with generous touch padding */
  div[class*="border border-[#C4C3C3]"] {
    padding: 1rem !important;
    gap: 1rem !important;
  }

  div[class*="border border-[#C4C3C3]"] .relative.w-\[270px\] {
    width: 100% !important;
    height: 220px !important;
  }

  div[class*="border border-[#C4C3C3]"] .relative.w-\[270px\] img {
    width: 100% !important;
    height: 220px !important;
  }
}

/* ----------------------------------------------------------------------------
 * 9. UNIFIED HERO & SERVICE STRIP SPECIFICATIONS
/* ----------------------------------------------------------------------------
 * 14. DEDICATED STREAMLINED SERVICE STRIP & UNIFIED HERO EXTENSIONS
 * ---------------------------------------------------------------------------- */
.unified-hero-section {
  background: linear-gradient(135deg, #FAF9F6 0%, #F1F5F9 50%, #E8EEF5 100%);
  border-bottom: 1px solid #E2E8F0;
}

.service-strip-card {
  position: relative;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  transition: all var(--si-transition-normal);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.service-strip-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  transition: background-color var(--si-transition-fast);
}

.service-strip-card:hover {
  transform: translateY(-4px);
  border-color: #cbd5e1;
  box-shadow: 0 12px 24px -4px rgba(0, 112, 201, 0.12), 0 4px 8px -2px rgba(15, 23, 42, 0.05);
}

.service-strip-card:hover::before {
  background: var(--si-primary);
}

.service-strip-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 9999px;
  background-color: #f1f5f9;
  color: #475569;
  margin-bottom: 10px;
  width: fit-content;
  transition: all var(--si-transition-fast);
}

.service-strip-card:hover .service-strip-badge {
  background-color: var(--si-primary-soft);
  color: var(--si-primary);
}

.service-strip-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(0, 112, 201, 0.08) 0%, rgba(0, 112, 201, 0.02) 100%);
  color: var(--si-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(0, 112, 201, 0.12);
  margin-bottom: 12px;
  transition: all var(--si-transition-fast);
}

.service-strip-card:hover .service-strip-icon-wrap {
  background: var(--si-primary);
  color: #ffffff;
  border-color: var(--si-primary);
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(0, 112, 201, 0.25);
}

.service-strip-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--si-neutral-text-main);
  margin-bottom: 4px;
  line-height: 1.25;
  transition: color var(--si-transition-fast);
}

.service-strip-card:hover .service-strip-title {
  color: var(--si-primary);
}

.service-strip-desc {
  font-size: 12px;
  color: var(--si-neutral-text-muted);
  line-height: 1.45;
  margin-bottom: 0;
}

.service-strip-cta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--si-primary);
  opacity: 0;
  transform: translateX(-4px);
  transition: all var(--si-transition-fast);
}

.service-strip-card:hover .service-strip-cta {
  opacity: 1;
  transform: translateX(0);
}

/* ----------------------------------------------------------------------------
 * 15. HIGH-CONTRAST DARK CONTAINER CONTRAST GUARDS (Stats Bar, Dark Footers)
 * ---------------------------------------------------------------------------- */
.stats-bg,
.stats-bg p,
.stats-bg span,
.stats-bg div {
  color: #ffffff;
}

.stats-bg .stats-number {
  color: #ffffff !important;
  font-weight: 800 !important;
  line-height: 1.15 !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5) !important;
}

.stats-bg .stats-label {
  color: #f1f5f9 !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4) !important;
}

.stats-bg p:last-child {
  margin-bottom: 0;
}

/* Prevent general paragraph color from bleeding into explicitly dark backgrounds */
.text-white p,
.stats-bg p,
.bg-\[\#051229\] p,
[class*="bg-[#051229]"] p,
.bg-slate-900 p {
  color: inherit !important;
}

/* ============================================================================
 * 60-30-10 Design System Utility Classes
 * ============================================================================ */
.accent-gradient {
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
}

.amber-gradient {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
}

.card-hover-halo {
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-hover-halo:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -10px rgba(37, 99, 235, 0.12), 0 0 0 1px rgba(37, 99, 235, 0.15);
}

.bento-service-card {
  transition: all 0.25s ease;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
}

.bento-service-card:hover {
  border-color: #93c5fd;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -6px rgba(37, 99, 235, 0.1);
}

