/* =========================================================
   css/index.css — Index page specific styles
   ========================================================= */

/* ---- Hero ---- */
.hero {
  position: relative;
  min-height: 100vh;
  background: linear-gradient(135deg, #2D1659 0%, #4B2C82 40%, #763393 75%, #6F2496 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding-bottom: 80px;
}

#hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  width: 100%;
  padding: 80px 24px 80px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-eyebrow-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 28px;
  animation: fadeSlideUp 0.5s ease both;
}

.hero-heading {
  font-size: 48px;
  font-weight: 600;
  line-height: 58px;
  color: white;
  margin-bottom: 20px;
  animation: fadeSlideUp 0.5s ease 0.1s both;
}

.hero-heading .highlight {
  color: #FDB933;
  font-style: italic;
}

.hero-subheading {
  font-size: 20px;
  line-height: 30px;
  color: rgba(255,255,255,0.85);
  max-width: 720px;
  margin-bottom: 32px;
  animation: fadeSlideUp 0.5s ease 0.2s both;
}

.hero-cta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 40px;
  animation: fadeSlideUp 0.5s ease 0.3s both;
}

/* Hero Search */
.hero-search-wrap {
  position: relative;
  width: 100%;
  max-width: 660px;
  margin-bottom: 48px;
  animation: fadeSlideUp 0.5s ease 0.35s both;
  z-index: 10;
}

.hero-search-bar {
  display: flex;
  align-items: center;
  background: white;
  border-radius: 999px;
  padding: 6px 6px 6px 20px;
  border: 2px solid transparent;
  transition: border-color 0.22s, box-shadow 0.22s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.hero-search-bar:focus-within {
  border-color: #763393;
  box-shadow: 0 4px 20px rgba(118,51,147,0.25);
}

.hero-search-icon {
  flex-shrink: 0;
  color: #763393;
  margin-right: 10px;
}

.hero-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  color: #333;
  background: transparent;
  min-width: 0;
}

.hero-search-input::placeholder {
  color: #777;
}

.hero-search-btn {
  background: var(--gradient-btn);
  color: white;
  border: none;
  border-radius: 0 999px 999px 0;
  padding: 10px 28px;
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.22s;
}

.hero-search-btn:hover {
  background: var(--gradient-btn-hover);
  transform: scale(1.02);
}

.hero-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: white;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  display: none;
  z-index: 50;
  overflow: hidden;
  border: 1px solid var(--color-border);
  max-height: 320px;
  overflow-y: auto;
}

/* Stats Strip */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 900px;
  margin: 48px auto 0;
  padding: 0 24px;
  position: relative;
  z-index: 5;
  animation: fadeSlideUp 0.5s ease 0.42s both;
}

.stat-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 24px 16px;
  text-align: center;
  position: relative;
}

.stat-number {
  font-family: 'Poppins', sans-serif;
  font-size: 40px;
  font-weight: 600;
  color: #FDB933;
  line-height: 1.1;
}

.stat-suffix {
  font-size: 22px;
  font-weight: 600;
  color: #FDB933;
  line-height: 1.1;
}

.stat-label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.3;
}

/* Stat card info tooltip */
.stat-label-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 8px;
}

.stat-info-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  position: relative;
}

.info-icon {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  transition: color 0.15s;
}

.stat-info-btn:hover .info-icon,
.stat-info-btn:focus .info-icon {
  color: #FDB933;
}

.stat-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #FFFFFF;
  color: #444;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  line-height: 18px;
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px solid #E8E0F0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  max-width: 280px;
  width: max-content;
  z-index: 9999;
  pointer-events: none;
}

.stat-tooltip::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-bottom-color: #FFFFFF;
}

.stat-card:hover .stat-tooltip,
.stat-info-btn:focus + .stat-tooltip,
.stat-card.tooltip-active .stat-tooltip {
  display: block;
}

.stat-card:hover,
.stat-card.tooltip-active {
  z-index: 10000;
}

@media (max-width: 767px) {
  .stat-tooltip{
    width: 210px;
    padding: 5px;
    font-size: 11px;
    line-height: 15px;
  }
}

/* Methodology note */
.stats-methodology-note {
  text-align: center;
  font-size: 12px;
  line-height: 18px;
  color: rgba(255,255,255,0.65);
  max-width: 700px;
  margin: 16px auto 0;
  padding: 0 24px;
  font-style: italic;
}

/* Purpose / About section */
.purpose-section {
  padding: 64px 0;
  background: white;
}

.purpose-card {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.purpose-text {
  font-size: 16px;
  line-height: 28px;
  color: #555;
  margin-bottom: 16px;
  text-align: left;
}

.purpose-highlights {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 32px;
  text-align: center;
}

.purpose-item {
  background: #F9F7FC;
  border: 1px solid #E8E0F0;
  border-radius: 12px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.purpose-icon {
  font-size: 28px;
}

.purpose-label {
  font-size: 14px;
  font-weight: 600;
  color: #763393;
}

.purpose-desc {
  font-size: 13px;
  line-height: 20px;
  color: #555;
}

/* Footer disclaimer */
.footer-disclaimer {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  margin-top: 24px;
  max-width: 800px;
}
.footer-disclaimer p {
  font-size: 12px;
  line-height: 20px;
  color: rgba(255,255,255,0.45);
}
.footer-disclaimer p + p {
  margin-top: 10px;
}
.footer-disclaimer a {
  color: #FDB933;
  text-decoration: underline;
}

/* ---- Filter Bar Tooltip (ftip) ---- */
.ftip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.ftip-btn {
  background: none;
  border: none;
  color: #aaa;
  font-size: 13px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.15s;
  flex-shrink: 0;
}

.ftip-btn:hover,
.ftip-btn:focus {
  color: #763393;
  outline: none;
}

.ftip-box {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: white;
  color: #444;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  line-height: 18px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #E8E0F0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  max-width: 240px;
  width: max-content;
  z-index: 9999;
  pointer-events: none;
  white-space: normal;
  text-align: left;
  animation: ftipFade 0.15s ease;
}

.ftip-box::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: white;
}

.ftip-box-right {
  left: auto;
  right: 0;
  transform: none;
}

.ftip-box-right::before {
  left: auto;
  right: 16px;
  transform: none;
}

.ftip-wrap:hover .ftip-box,
.ftip-btn:focus + .ftip-box {
  display: block;
}

@keyframes ftipFade {
  from { opacity: 0; transform: translateX(-50%) translateY(-4px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes ftipFadeRight {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ftip-box-right {
  animation: ftipFadeRight 0.15s ease;
}

/* Policy disclaimer (university + compare pages) */
.policy-disclaimer {
  font-size: 13px;
  line-height: 20px;
  color: #777;
  background: #FFFBF0;
  border: 1px solid #F0E4C8;
  border-radius: 8px;
  padding: 14px 18px;
  margin: 32px auto;
  max-width: 900px;
}
.policy-disclaimer a {
  color: #1A6FC4;
  text-decoration: underline;
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: none;
  border: none;
  animation: bounce 2s infinite;
}

.scroll-indicator-text {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  font-family: 'Poppins', sans-serif;
}

.scroll-chevron {
  color: rgba(255,255,255,0.85);
  font-size: 20px;
}

/* Universities section */
#universities-section {
  background: var(--color-light-purple);
  padding-bottom: 0;
}

.filters-sticky {
  position: sticky;
  top: 95px;
  z-index: var(--z-sticky);
  background: white;
  box-shadow: 0 2px 8px rgba(118,51,147,0.06);
}

.filter-bar {
  background: white;
  border-bottom: 1px solid var(--color-border);
  padding: 12px 0;
}

.alpha-nav-bar {
  background: white;
  border-bottom: 1px solid var(--color-border);
}

.filter-bar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.filter-chips-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-sep {
  width: 1px;
  height: 24px;
  background: var(--color-border);
}

.result-count {
  font-size: 14px;
  color: var(--color-muted);
  white-space: nowrap;
}

.alpha-nav-container {
  padding: 10px 0;
}

.letter-group {
  margin-bottom: 8px;
}

/* Animations */
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Responsive — iPad portrait */
@media (min-width: 768px) and (max-width: 1024px) {
  .hero-heading { font-size: 36px; line-height: 44px; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .university-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 16px;
    align-items: center;
  }
  .purpose-highlights {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Responsive — Phone */
@media (max-width: 767px) {
  .hero-content { padding: 80px 20px 40px; gap: 0; }
  .hero-heading { font-size: 28px; line-height: 36px; }
  .hero-subheading { font-size: 15px; line-height: 24px; }
  .hero-cta-row { flex-direction: column; gap: 10px; }
  .hero-cta-row .btn { width: 100%; }
  .hero-search-wrap { margin: 0 16px; z-index: 15; }
  .hero-search-dropdown { z-index: 60; }
  .stats-strip {
    display: flex;
    flex-wrap: wrap;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 10px;
    padding: 0;
    justify-content: space-between;
    width: 100%;
  }
  .stats-strip::-webkit-scrollbar { display: none; }
  .stat-card { min-width: 160px; flex-shrink: 0; scroll-snap-align: start; padding: 24px 3px; text-align: center; position: relative; display: inline-flex; flex-direction: column; width: 48%; }
  .stat-number { font-size: 36px; }
  .stat-suffix { font-size: 20px; }
  .stat-label{ font-size: 10px; }
  .filter-bar { flex-wrap: wrap; gap: 8px; }
  .filter-bar-inner { gap: 8px; }
  .filter-sep { display: none; }
  .sort-select { width: 100%; margin-top: 8px; }
  .alpha-nav { gap: 4px; }
  .alpha-btn { width: 32px; height: 32px; font-size: 13px; }
  .university-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .purpose-highlights {
    grid-template-columns: 1fr 1fr;
  }
  .purpose-section {
    padding: 40px 0;
  }
}

@media (max-width: 480px) {
  .purpose-highlights {
    grid-template-columns: 1fr;
  }
  .hero{
    padding-bottom: 100px;
  }
}

/* Search no results */
.search-no-results {
  padding: 24px 20px;
  text-align: center;
}
.search-no-icon {
  font-size: 24px;
  margin-bottom: 8px;
}
.search-no-title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}
.search-no-text {
  font-size: 13px;
  color: #777;
  line-height: 20px;
  margin-bottom: 10px;
}
.search-suggest-link {
  font-size: 13px;
  color: #763393;
  font-weight: 500;
  text-decoration: none;
}
.search-suggest-link:hover {
  text-decoration: underline;
}

/* Listing legend */
.listing-legend {
  background: #F9F7FC;
  border: 1px solid #E8E0F0;
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 28px;
}
.legend-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.legend-icon {
  font-size: 20px;
}
.legend-title {
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #763393;
}
.legend-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.legend-block {
  background: white;
  border: 1px solid #F0EBF4;
  border-radius: 8px;
  padding: 16px;
}
.legend-block-title {
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}
.legend-example {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.coverage-sample {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}
.coverage-sample.high { background: #E8F5E9; color: #2E7D32; }
.coverage-sample.mid { background: #FFF8E1; color: #F57F17; }
.coverage-sample.low { background: #FFF3E0; color: #E65100; }
.type-chip-sample {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
}
.type-chip-sample.public { background: #E3F2FD; color: #1565C0; }
.type-chip-sample.private { background: #F3E5F5; color: #7B1FA2; }
.legend-explain {
  font-size: 12px;
  line-height: 18px;
  color: #666;
  margin: 0;
}
@media (max-width: 1024px) {
  .legend-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 767px) {
  .legend-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-eyebrow-badge,
  .hero-heading,
  .hero-subheading,
  .hero-cta-row,
  .hero-search-wrap,
  .stats-strip { animation: none; }
  .scroll-indicator { animation: none; }
}
