/* ═══════════════════════════════════════════════════════════════
   INDEX.CSS
   Page-specific styles for the home page (index.html).
   Load AFTER styles.css (global tokens, header/nav, footer,
   .resource-card component, .grid-3/4/5, .skeleton).
═══════════════════════════════════════════════════════════════ */

/* Local scale overrides used only on the home page's own
   components (its radius/shadow scale differs slightly from the
   defaults in styles.css) */
:root {
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 4px rgba(15,23,42,0.07);
  --shadow-md: 0 4px 20px rgba(15,23,42,0.10);
  --shadow-lg: 0 8px 40px rgba(15,23,42,0.13);
}

body { padding-bottom: 0; }

/* ─── Keyframes ─── */
@keyframes spin   { to { transform: rotate(360deg); } }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.45} }

/* ─── Section wrapper ─── */
.section { padding: 64px 20px; }
.section--alt  { background: var(--bg-alt); }
.section--dark { background: var(--ink); color: #fff; }

/* ─── Section header ─── */
.section-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--blue-light);
  padding: 4px 12px;
  border-radius: 99px;
  margin-bottom: 10px;
}
.section-eyebrow--green { color: var(--green); background: var(--green-light); }
.section-eyebrow--amber { color: #92400E; background: var(--amber-light); }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 8px;
}
.section--dark .section-title { color: #fff; }

.section-sub {
  font-size: 0.95rem;
  color: var(--ink-soft);
  max-width: 540px;
}
.section--dark .section-sub { color: #94A3B8; }

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 2px 12px rgba(37,99,235,0.30);
}
.btn--primary:hover { background: #1D4ED8; box-shadow: 0 4px 20px rgba(37,99,235,0.38); }
.btn--secondary {
  background: transparent;
  color: var(--blue);
  border: 2px solid var(--blue-mid);
}
.btn--secondary:hover { background: var(--blue-light); }
.btn--green {
  background: var(--green);
  color: #fff;
  box-shadow: 0 2px 12px rgba(16,185,129,0.28);
}
.btn--green:hover { background: #059669; }
.btn--ghost {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 2px solid rgba(255,255,255,0.25);
}
.btn--ghost:hover { background: rgba(255,255,255,0.2); }
.btn--sm { padding: 7px 14px; font-size: 0.80rem; }
.btn--outline-white {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.4);
}
.btn--outline-white:hover { background: rgba(255,255,255,0.1); }

/* ─── View-all link ─── */
.view-all {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--blue);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.view-all:hover { text-decoration: underline; }

/* ─────────────────────────────────────────────────────────────
   HERO
───────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0F172A 0%, #1E3A5F 60%, #164E63 100%);
  padding: 48px 20px 56px;
  text-align: center;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}
.hero-orb--1 { width: 380px; height: 380px; background: rgba(37,99,235,0.38); top: -120px; left: -80px; }
.hero-orb--2 { width: 300px; height: 300px; background: rgba(16,185,129,0.22); bottom: -80px; right: -60px; }

.hero-inner {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
  animation: fadeUp 0.7s ease both;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  color: #CBD5E1;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 99px;
  margin-bottom: 22px;
  backdrop-filter: blur(4px);
}
.hero-badge span {
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.7rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, #60A5FA, #34D399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: #94A3B8;
  max-width: 560px;
  margin: 0 auto 20px;
  line-height: 1.65;
}
.hero-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 28px;
}
.hero-stats { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; }
.hero-stat  { text-align: center; }
.hero-stat-num {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  color: #fff;
}
.hero-stat-label {
  font-size: 0.75rem;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

/* ─────────────────────────────────────────────────────────────
   SEARCH BAR
───────────────────────────────────────────────────────────── */
.search-section { background: var(--bg); padding: 0 20px; position: relative; z-index: 2; }
.search-wrap {
  max-width: 720px;
  margin: 0 auto;
  transform: translateY(-28px);
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px 6px 6px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--border);
}
.search-wrap input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.93rem;
  color: var(--ink);
  background: transparent;
  padding: 8px 0;
}
.search-wrap input::placeholder { color: var(--ink-mute); }
.search-wrap .btn { flex-shrink: 0; }

#searchResults {
  max-width: 720px;
  margin: -20px auto 0;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 420px;
  overflow-y: auto;
  display: none;
  z-index: 100;
  position: relative;
}
#searchResults:not(:empty) { display: block; }

/* ─────────────────────────────────────────────────────────────
   STUDY TIP
───────────────────────────────────────────────────────────── */
.tip-wrap {
  max-width: 760px;
  margin: 0 auto;
  background: linear-gradient(135deg, #1E3A8A, #1D4ED8);
  border-radius: var(--radius-lg);
  padding: 40px 48px;
  display: flex;
  align-items: center;
  gap: 28px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.tip-wrap::after {
  content: '💡';
  position: absolute;
  right: 32px; bottom: -8px;
  font-size: 5rem;
  opacity: 0.10;
  pointer-events: none;
}
.tip-day { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #93C5FD; margin-bottom: 10px; }
.tip-text { font-family: var(--font-display); font-size: clamp(1.1rem, 2.5vw, 1.4rem); font-weight: 700; line-height: 1.45; }
.tip-icon { font-size: 3rem; flex-shrink: 0; display: none; }

/* ─────────────────────────────────────────────────────────────
   QUIZ HUB
───────────────────────────────────────────────────────────── */
.quiz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.quiz-card {
  border-radius: var(--radius-md);
  padding: 28px 26px;
  position: relative;
  overflow: hidden;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.quiz-card--daily   { background: linear-gradient(135deg, #2563EB, #7C3AED); }
.quiz-card--weekly  { background: linear-gradient(135deg, #10B981, #0D9488); }
.quiz-card--subject { background: linear-gradient(135deg, #F59E0B, #EF4444); }
.quiz-card--board   { background: linear-gradient(135deg, #1E293B, #334155); }
.quiz-card__label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.7; }
.quiz-card__title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 800; line-height: 1.3; }
.quiz-card__sub   { font-size: 0.82rem; opacity: 0.75; }
.quiz-card__bg-icon { position: absolute; right: 16px; bottom: -8px; font-size: 5rem; opacity: 0.12; pointer-events: none; }

/* ─────────────────────────────────────────────────────────────
   ABOUT
───────────────────────────────────────────────────────────── */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }

.about-values { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.about-value  { background: var(--bg-alt); border-radius: var(--radius-sm); padding: 16px; }
.about-value__icon  { font-size: 1.4rem; margin-bottom: 8px; }
.about-value__label { font-weight: 700; font-size: 0.85rem; color: var(--ink); margin-bottom: 4px; }
.about-value__text  { font-size: 0.78rem; color: var(--ink-soft); line-height: 1.5; }

.about-visual { border-radius: var(--radius-lg); overflow: hidden; background: linear-gradient(135deg, var(--blue-light) 0%, #EDE9FE 100%); padding: 40px; text-align: center; }
.about-visual__emoji { font-size: 5rem; margin-bottom: 16px; }
.about-visual__stat { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 24px; }
.about-visual__stat-item  { text-align: center; }
.about-visual__stat-num   { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; color: var(--blue); }
.about-visual__stat-label { font-size: 0.72rem; color: var(--ink-soft); }

/* ─────────────────────────────────────────────────────────────
   SEARCH RESULTS MODAL
───────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.show { display: flex; }

.modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: modalIn .2s ease;
}
@keyframes modalIn {
  from { transform: scale(.95); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.modal-box--search {
  max-width: 560px;
  width: 92%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  position: relative;
  text-align: left;
}
.modal-box--search h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
  padding-right: 24px;
}
.modal-box--search .modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--ink-mute, #94A3B8);
  cursor: pointer;
  line-height: 1;
}
.search-modal-results {
  overflow-y: auto;
  margin-top: 12px;
  padding-right: 4px;
}

/* ─────────────────────────────────────────────────────────────
   LOADING STATES (local card skeleton, distinct from the
   resources-page .skel-* variant)
───────────────────────────────────────────────────────────── */
.loading-card { border-radius: var(--radius-md); overflow: hidden; border: 1.5px solid var(--border); }
.loading-card__img  { height: 180px; }
.loading-card__body { padding: 18px 20px; }
.loading-card__line { height: 14px; margin-bottom: 10px; }
.loading-card__line--sm { height: 10px; width: 60%; }

/* ─────────────────────────────────────────────────────────────
   UTILITY
───────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.divider { border: none; border-top: 1.5px solid var(--border); margin: 0; }

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .mobile-nav { display: block; }
  body { padding-bottom: 70px; }
  .section { padding: 48px 16px; }
  .hero { padding: 32px 16px 40px; }
  .tip-wrap { padding: 28px 24px; flex-direction: column; }
  .tip-icon { display: block; }
  .about-values { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-actions { gap: 6px; }
  .hero-actions .btn { padding: 7px 8px; font-size: 0.68rem; white-space: nowrap; flex-shrink: 1; min-width: 0; }
  .quiz-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .quiz-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .hero-stats { gap: 24px; }
  .search-wrap { padding: 4px 4px 4px 14px; }
}
