/* ============================================================
   MCAT PREP — Shared Stylesheet
   Colors: Pink #FF66C4, Electric Teal #5CE1E6,
           Navy Sea #141C40, Globe Blue #C0DBFE, White #FFFFFF
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ── Custom Properties ────────────────────────────────── */
:root {
  --pink: #FF66C4;
  --teal: #5CE1E6;
  --navy: #141C40;
  --globe: #C0DBFE;
  --white: #FFFFFF;

  --pink-glow: rgba(255, 102, 196, .35);
  --teal-glow: rgba(92, 225, 230, .35);
  --navy-light: #1e2a54;
  --navy-dark: #0d1229;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 30px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .12);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, .18);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .25);
  --shadow-glow-pink: 0 0 30px var(--pink-glow);
  --shadow-glow-teal: 0 0 30px var(--teal-glow);

  --font-body: 'Inter', sans-serif;
  --font-heading: 'Outfit', sans-serif;

  --transition: .25s cubic-bezier(.4, 0, .2, 1);
}

/* ── Reset & Base ─────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--navy-dark);
  color: var(--white);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  cursor: pointer;
  font-family: inherit;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  line-height: 1.25;
}

/* ── Utility ──────────────────────────────────────────── */
.container {
  width: 90%;
  max-width: 1260px;
  margin: 0 auto;
}

/* ── Geometric Decorative Shapes ──────────────────────── */
.shape {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
  opacity: .45;
}

.shape--pink {
  background: var(--pink);
}

.shape--teal {
  background: var(--teal);
}

.shape--globe {
  background: var(--globe);
}

/* ── Hero Section ─────────────────────────────────────── */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 60%, #0f1833 100%);
  padding: 100px 0 80px;
  text-align: center;
  overflow: hidden;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--teal);
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0.7;
}

.icon-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

.icon-svg {
  width: 18px;
  height: 18px;
  fill: var(--teal);
  filter: drop-shadow(0 0 5px rgba(92, 225, 230, 0.4));
}

.icon-btn--delete .icon-svg {
  fill: var(--pink);
  filter: drop-shadow(0 0 5px rgba(255, 0, 127, 0.4));
}

/* --- Mathematical Formatting --- */
.math-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 25px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--teal);
  border-radius: 4px;
}

.formula {
  font-family: 'Inter', sans-serif;
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--teal);
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 0 10px rgba(92, 225, 230, 0.3);
  margin-bottom: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Fraction */
.fraction {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  margin: 0 4px;
}

.fraction__num {
  padding: 0 4px;
  font-size: 0.9em;
}

.fraction__bar {
  width: 100%;
  height: 1px;
  background: var(--teal);
  margin: 2px 0;
  box-shadow: 0 0 5px rgba(92, 225, 230, 0.5);
}

.fraction__den {
  padding: 0 4px;
  font-size: 0.9em;
}

/* Matrix */
.matrix {
  display: inline-flex;
  align-items: center;
  position: relative;
  padding: 0 10px;
  margin: 0 5px;
}

.matrix__bracket {
  width: 10px;
  height: 100%;
  border: 1.5px solid var(--teal);
  position: absolute;
  top: 0;
}

.matrix__bracket--left {
  left: 0;
  border-right: none;
  border-radius: 6px 0 0 6px;
}

.matrix__bracket--right {
  right: 0;
  border-left: none;
  border-radius: 0 6px 6px 0;
}

.matrix__grid {
  display: grid;
  gap: 10px 15px;
  padding: 8px 5px;
  text-align: center;
  font-size: 1.1rem;
}

/* Radical (Square Root) */
.radical {
  display: inline-flex;
  align-items: flex-start;
  position: relative;
  margin: 0 2px;
}

.radical__symbol {
  font-size: 1.25em;
  line-height: 1;
  margin-top: -1px;
  color: var(--teal);
}

.radical__content {
  border-top: 1px solid var(--teal);
  padding: 2px 4px 0;
  margin-top: 2px;
  box-shadow: 0 -2px 5px rgba(92, 225, 230, 0.2);
}

/* Inline fraction inside exponent (avoids cutoff) */
.frac-inline {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  font-size: 0.85em;
}
.frac-inline .fraction__num,
.frac-inline .fraction__den { padding: 0 2px; }
.frac-inline .fraction__bar { height: 1px; background: var(--teal); margin: 1px 0; width: 100%; }
.radical-inline { display: inline-flex; align-items: baseline; }
.formula-pow2 { white-space: nowrap; }
.formula-pow2 sup { font-size: 0.75em; vertical-align: super; line-height: 0; }

.formula-key {
  width: 100%;
  max-width: 400px;
  font-size: 0.9rem;
  color: var(--globe);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 10px;
}

.formula-key__item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.formula-key__var {
  font-weight: 600;
  color: var(--pink);
}

/* Refined Sup/Sub */
sup {
  font-size: 0.7em;
  vertical-align: super;
  line-height: 0;
}

sub {
  font-size: 0.7em;
  vertical-align: sub;
  line-height: 0;
}

.hero__badge {
  display: inline-block;
  background: rgba(92, 225, 230, .12);
  color: var(--teal);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 18px;
  border-radius: 50px;
  border: 1px solid rgba(92, 225, 230, .2);
  margin-bottom: 22px;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 800;
  margin-bottom: 18px;
  background: linear-gradient(135deg, var(--white), var(--globe));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--pink), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.15rem;
  color: var(--globe);
  max-width: 620px;
  margin: 0 auto 36px;
}

/* floating stat badges in hero */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.hero-stat {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-md);
  padding: 18px 28px;
  text-align: center;
  min-width: 150px;
}

.hero-stat__num {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--teal);
}

.hero-stat__label {
  font-size: .82rem;
  color: var(--globe);
  margin-top: 4px;
}

/* ── Section Nav Bar (ACT Sections) ───────────────────── */
.section-nav {
  background: rgba(20, 28, 64, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.section-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.section-tabs .filter-pill {
  font-size: .95rem;
  padding: 10px 24px;
}

/* ── Section Panels & Outline Hierarchy ─────────────── */
.section-panel {
  display: none;
  padding: 20px 0 80px;
}

#panel-math.section-panel {
  display: block;
}

.section-panel[aria-hidden="false"] {
  display: block;
}

.section-panel[aria-hidden="true"] {
  display: none;
}

.section-panel:first-of-type {
  padding-top: 30px;
}

.act-section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--white);
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 2px solid rgba(255, 255, 255, .12);
}

.subsection-heading {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--teal);
  margin-top: 36px;
  margin-bottom: 12px;
}

.subsection-heading:first-of-type {
  margin-top: 0;
}

.subheading {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--globe);
  margin-top: 20px;
  margin-bottom: 12px;
  padding-left: 4px;
}

.concept-grid {
  padding: 8px 0 20px;
}

.concept-grid .topic-card {
  min-height: auto;
}

/* ── Category Filter Pills ────────────────────────────── */
.filters {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 40px 0 10px;
}

.filter-pill {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  color: var(--globe);
  font-size: .85rem;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 50px;
  transition: var(--transition);
  cursor: pointer;
}

.filter-pill:hover,
.filter-pill.active {
  background: var(--pink);
  color: var(--white);
  border-color: var(--pink);
  box-shadow: var(--shadow-glow-pink);
}

/* ── Topic Grid ───────────────────────────────────────── */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 22px;
  padding: 30px 0 80px;
}

/* ── Topic Card ───────────────────────────────────────── */
.topic-card {
  position: relative;
  background: linear-gradient(145deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius-md);
  padding: 26px 24px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.topic-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--pink-glow), transparent 60%);
  opacity: 0;
  transition: var(--transition);
}

.topic-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 102, 196, .3);
  box-shadow: var(--shadow-lg), var(--shadow-glow-pink);
}

.topic-card:hover::before {
  opacity: 1;
}

.topic-card__number {
  position: relative;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: .75rem;
  color: var(--teal);
  letter-spacing: 1px;
  opacity: .7;
}

.topic-card__title {
  position: relative;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--white);
  line-height: 1.35;
}

.topic-card__category {
  position: relative;
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 12px;
  border-radius: 50px;
  margin-top: auto;
  width: fit-content;
}

/* Category badge colors */
.badge-physics {
  background: rgba(92, 225, 230, .15);
  color: var(--teal);
}

.badge-genchem {
  background: rgba(255, 102, 196, .15);
  color: var(--pink);
}

.badge-orgchem {
  background: rgba(192, 219, 254, .18);
  color: var(--globe);
}

.badge-biochem {
  background: rgba(255, 102, 196, .22);
  color: #ff99d6;
}

.badge-biology {
  background: rgba(92, 225, 230, .22);
  color: #7eedf0;
}

.badge-psychology {
  background: rgba(192, 219, 254, .25);
  color: #d6e8ff;
}

.badge-sociology {
  background: rgba(255, 255, 255, .1);
  color: var(--white);
}

/* ── Section Headings ─────────────────────────────────── */
.section-label {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  padding: 50px 0 10px;
  border-bottom: 2px solid rgba(255, 255, 255, .06);
  margin-bottom: 4px;
}

/* ============================================================
   Brand Identity - Logo
   ============================================================ */

.brand-logo {
  position: fixed;
  top: 30px;
  left: 40px;
  display: flex;
  align-items: center;
  gap: 15px;
  text-decoration: none;
  z-index: 1000;
}

.logo-icon {
  width: 100px;
  height: 100px;
  filter: drop-shadow(0 0 10px rgba(92, 225, 230, 0.4));
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Asset is now transparent, applying subtle glow to the neon lines */
  filter: drop-shadow(0 0 8px rgba(255, 0, 127, 0.4));
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-text__top {
  font-family: 'Inter', sans-serif;
  font-size: 1.8rem;
  font-weight: 200;
  color: var(--teal);
  line-height: .9;
  text-transform: none;
  letter-spacing: -1px;
  text-shadow: 0 0 12px rgba(92, 225, 230, 0.3);
}

.logo-text__line {
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, var(--pink), var(--teal));
  margin: 6px 0;
  box-shadow: 0 0 5px var(--teal);
}

.logo-text__bottom {
  font-family: 'Inter', sans-serif;
  font-size: 0.55rem;
  letter-spacing: 6px;
  color: var(--pink);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 1;
  opacity: 0.8;
}

@media (max-width: 768px) {
  .brand-logo {
    position: absolute;
    top: 20px;
    left: 20px;
    transform: scale(0.8);
  }
}

/* ============================================================
   TOPIC PAGE STYLES
   ============================================================ */

/* ── Topic Header ─────────────────────────────────────── */
.topic-header {
  position: relative;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  padding: 70px 0 50px;
  text-align: center;
  overflow: hidden;
}

.topic-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--white), var(--globe));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
  position: relative;
}

.topic-header .breadcrumb {
  font-size: .9rem;
  color: var(--globe);
  opacity: .7;
  position: relative;
}

.topic-header .breadcrumb a {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Content Sections ─────────────────────────────────── */
.topic-section {
  padding: 50px 0;
}

.topic-section:nth-child(even) {
  background: rgba(255, 255, 255, .02);
}

.topic-section h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--teal);
}

.topic-section h2 .icon {
  margin-right: 10px;
}

.topic-section p {
  color: var(--globe);
  font-size: 1.02rem;
  max-width: 800px;
  margin-bottom: 16px;
  line-height: 1.75;
}

/* ── Flashcards ───────────────────────────────────────── */
.flashcard-deck {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.flashcard-container {
  perspective: 900px;
  width: 100%;
  max-width: 520px;
  height: 300px;
}

.flashcard {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform .5s cubic-bezier(.4, 0, .2, 1);
}

.flashcard.flipped {
  transform: rotateY(180deg);
}

.flashcard__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
}

.flashcard__front {
  background: linear-gradient(145deg, var(--pink), #e04faa);
  color: var(--white);
  box-shadow: var(--shadow-md), var(--shadow-glow-pink);
}

.flashcard__front h3 {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
}

.flashcard__front .tap-hint {
  font-size: .8rem;
  opacity: .7;
  margin-top: 14px;
}

.flashcard__back {
  background: linear-gradient(145deg, var(--navy-light), var(--navy));
  color: var(--globe);
  border: 1px solid rgba(92, 225, 230, .2);
  box-shadow: var(--shadow-md), var(--shadow-glow-teal);
  transform: rotateY(180deg);
  font-size: 1.05rem;
  line-height: 1.65;
}

.flashcard-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.flashcard-nav button {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  color: var(--white);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.flashcard-nav button:hover {
  background: var(--pink);
  border-color: var(--pink);
  box-shadow: var(--shadow-glow-pink);
}

.flashcard-counter {
  font-size: .9rem;
  color: var(--globe);
  font-weight: 600;
}

/* ── MCQ Section ──────────────────────────────────────── */
.mcq-block {
  background: linear-gradient(145deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .02));
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius-md);
  padding: 28px;
  margin-bottom: 24px;
  max-width: 800px;
}

.mcq-block__question {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 18px;
  color: var(--white);
}

.mcq-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
}

.mcq-option:hover {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .12);
}

.mcq-option__letter {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  color: var(--globe);
}

.mcq-option__text {
  color: var(--globe);
  font-size: .97rem;
  padding-top: 3px;
}

/* Correct / Incorrect States */
.mcq-option.correct {
  background: rgba(92, 225, 230, .12);
  border-color: var(--teal);
}

.mcq-option.correct .mcq-option__letter {
  background: var(--teal);
  color: var(--navy);
}

.mcq-option.incorrect {
  background: rgba(255, 102, 196, .1);
  border-color: var(--pink);
}

.mcq-option.incorrect .mcq-option__letter {
  background: var(--pink);
  color: var(--white);
}

.mcq-explanation {
  margin-top: 14px;
  padding: 16px;
  background: rgba(92, 225, 230, .06);
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--globe);
  font-size: .93rem;
  display: none;
  line-height: 1.6;
}

.mcq-explanation.visible {
  display: block;
}

/* ── Passage Section ──────────────────────────────────── */
.passage-block {
  background: linear-gradient(145deg, rgba(20, 28, 64, .6), rgba(13, 18, 41, .8));
  border: 1px solid rgba(192, 219, 254, .1);
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 840px;
  margin-bottom: 30px;
}

.passage-block p {
  color: var(--globe);
  font-size: .98rem;
  line-height: 1.8;
  margin-bottom: 16px;
}

.passage-block p:last-child {
  margin-bottom: 0;
}

/* ── Real-World Examples ──────────────────────────────── */
.example-card {
  background: linear-gradient(145deg, rgba(92, 225, 230, .08), rgba(255, 255, 255, .03));
  border: 1px solid rgba(92, 225, 230, .15);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 16px;
  max-width: 800px;
}

.example-card h4 {
  color: var(--teal);
  font-size: 1rem;
  margin-bottom: 8px;
}

.example-card p {
  color: var(--globe);
  font-size: .95rem;
}

/* ── MCAT Key Term Highlight ─────────────────────────── */
.term {
  color: var(--pink);
  font-weight: 700;
}

/* ── Back to Home Link ────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--teal);
  font-weight: 600;
  font-size: .95rem;
  padding: 12px 24px;
  border-radius: 50px;
  border: 1px solid rgba(92, 225, 230, .2);
  transition: var(--transition);
  margin-top: 20px;
}

.back-link:hover {
  background: rgba(92, 225, 230, .1);
  border-color: var(--teal);
  box-shadow: var(--shadow-glow-teal);
}

/* ── Footer ───────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 40px 0;
  color: rgba(192, 219, 254, .4);
  font-size: .82rem;
  border-top: 1px solid rgba(255, 255, 255, .05);
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
  .hero {
    padding: 70px 0 50px;
  }

  .hero-stats {
    gap: 14px;
  }

  .hero-stat {
    padding: 14px 20px;
    min-width: 120px;
  }

  .topic-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .flashcard-container {
    height: 260px;
  }

  .passage-block {
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .topic-grid {
    grid-template-columns: 1fr;
  }

  .flashcard-container {
    height: 240px;
  }
}