/* Bespoke styles for the NSC Maths Hub to avoid the "AI/Generic" feel */

body {
  /* Subtle dot grid background for a "notebook" feel */
  background-color: #fdfdfc;
  background-image: radial-gradient(#d1d5db 1px, transparent 1px);
  background-size: 24px 24px;
}

.maths-hero {
  padding: 80px 0 60px;
  position: relative;
  border-bottom: 2px dashed #e5e7eb;
  background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(253,253,252,0.8) 100%);
}

.hero-content {
  max-width: 650px;
}

.subject-badge {
  display: inline-block;
  background: #1e3a8a;
  color: white;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 6px 12px;
  border-radius: 4px;
  margin-bottom: 16px;
  transform: rotate(-2deg); /* Slightly off-kilter */
  box-shadow: 2px 2px 0px rgba(17, 24, 39, 0.2);
}

.maths-hero h1 {
  font-size: 48px;
  color: #111827;
  margin-bottom: 16px;
  position: relative;
}

/* A hand-drawn style underline for the H1 */
.maths-hero h1::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 140px;
  height: 6px;
  background: #3b82f6;
  border-radius: 10px;
  transform: rotate(-1deg);
}

.hero-sub {
  font-size: 18px;
  color: #4b5563;
  line-height: 1.6;
}

.doodle-container {
  position: absolute;
  top: 40px;
  right: 10%;
  pointer-events: none;
}

.handwritten-note {
  font-family: 'Caveat', cursive;
  font-size: 24px;
  color: #2563eb;
  transform: rotate(4deg);
  max-width: 200px;
  line-height: 1.2;
}

/* Curriculum Grid Layout */
.maths-curriculum {
  padding: 60px 0 100px;
}

.curriculum-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

@media (max-width: 800px) {
  .curriculum-grid {
    grid-template-columns: 1fr;
  }
  .doodle-container {
    display: none;
  }
}

.paper-section {
  background: #ffffff;
  border: 2px solid #111827;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 6px 6px 0px rgba(17, 24, 39, 0.1); /* Brutalist/hand-crafted shadow */
  position: relative;
}

/* Offset borders to give a sketch feel */
.paper-section::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  right: -8px;
  bottom: -8px;
  border: 1px solid #9ca3af;
  border-radius: 12px;
  z-index: -1;
  pointer-events: none;
}

.paper-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  border-bottom: 2px solid #f3f4f6;
  padding-bottom: 12px;
}

.paper-header h2 {
  font-size: 28px;
  color: #111827;
}

.marks {
  font-family: 'Caveat', cursive;
  font-size: 20px;
  color: #6b7280;
}

.paper-desc {
  font-size: 15px;
  color: #4b5563;
  margin-bottom: 24px;
  line-height: 1.5;
}

.topic-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.topic-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  position: relative;
}

.topic-card:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  transform: translateX(4px);
}

.topic-card h3 {
  font-family: "Manrope", sans-serif;
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.topic-weight {
  font-family: 'Caveat', cursive;
  font-size: 18px;
  color: #6b7280;
}

/* Placeholder cards for topics without pages yet */
.topic-soon {
  opacity: 0.55;
  cursor: default;
}

.topic-soon:hover {
  background: #f9fafb;
  border-color: #e5e7eb;
  transform: none;
}

.soon-tag {
  font-family: monospace;
  font-size: 11px;
  font-weight: 400;
  color: #6b7280;
  border: 1px dashed #9ca3af;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  white-space: nowrap;
  vertical-align: middle;
}

.highlight-topic {
  border-color: #fcd34d;
  background: #fffbeb;
}

.highlight-topic:hover {
  background: #fef3c7;
  border-color: #fbbf24;
}

.post-it-doodle {
  position: absolute;
  top: -12px;
  right: -10px;
  background: #fef08a;
  color: #854d0e;
  font-family: 'Caveat', cursive;
  font-size: 16px;
  padding: 2px 8px;
  transform: rotate(6deg);
  box-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.promo-card {
  margin-top: 32px;
  background: #1e3a8a;
  border-radius: 8px;
  padding: 24px;
  color: white;
  position: relative;
  overflow: hidden;
}

/* Subtle background pattern for promo card */
.promo-card::after {
  content: "";
  position: absolute;
  top: -20px;
  right: -20px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
}

.promo-card h3 {
  color: #bfdbfe;
  font-size: 18px;
  margin-bottom: 8px;
}

.promo-card p {
  font-size: 14px;
  line-height: 1.5;
  color: #e0e7ff;
  margin-bottom: 16px;
}

.btn-promo {
  display: inline-block;
  background: #ffffff;
  color: #1e3a8a;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s;
}

.btn-promo:hover {
  background: #f8fafc;
}

/* Extracted from study notes */
.study-layout { max-width: 800px; margin: 0 auto; padding: 40px 24px 100px; }
.study-header { border-bottom: 3px solid var(--ink); padding-bottom: 24px; margin-bottom: 40px; }
.study-header h1 { font-size: 36px; margin-bottom: 12px; }
.study-header .meta { font-family: monospace; color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; }

.theorem-section { margin-bottom: 56px; }
.theorem-section h2 { border-bottom: 2px solid var(--outline); padding-bottom: 12px; margin-bottom: 24px; color: var(--ink); }

.concept-box { background: #f8fafc; border-left: 4px solid var(--brand); padding: 24px; margin-bottom: 24px; border-radius: 0 8px 8px 0; }
.concept-box h3 { color: var(--brand); margin-top: 0; margin-bottom: 12px; font-size: 18px; }

.dbe-reason { display: inline-block; background: #f1f5f9; color: var(--ink); padding: 4px 12px; border-radius: 6px; font-family: monospace; font-size: 13px; font-weight: 700; border: 1px solid #cbd5e1; margin-bottom: 16px; margin-right: 8px;}

.trap-box { border: 2px dashed #ef4444; padding: 24px; border-radius: 8px; background: #fef2f2; margin-top: 24px; }
.trap-title { color: #b91c1c; font-family: "Sora", sans-serif; font-size: 18px; margin-top: 0; display: flex; align-items: center; gap: 8px; }

/* Inline reason tags (worked examples, proof solutions) */
.reason-inline { font-family: monospace; color: #991b1b; font-size: 13px; background: #fff5f5; padding: 2px 6px; border-radius: 4px; border: 1px solid #fecaca; }

/* Examinable-proof pages */
.formal-proof { background: #ffffff; border: 1px solid var(--outline); padding: 32px; border-radius: 12px; margin-bottom: 48px; box-shadow: 0 4px 12px rgba(0,0,0,0.02); }
.formal-proof h2 { margin-top: 0; border-bottom: 1px solid var(--outline); padding-bottom: 16px; margin-bottom: 24px; }
.proof-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; }
.proof-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.proof-table th { text-align: left; border-bottom: 2px solid var(--ink); padding: 8px; font-family: "Sora", sans-serif; }
.proof-table td { padding: 12px 8px; border-bottom: 1px solid var(--outline); font-size: 15px; }
.proof-table td:last-child { font-family: monospace; color: #991b1b; }
.worked-example { background: #fffbeb; border: 1px solid #fde68a; padding: 32px; border-radius: 12px; margin-bottom: 48px; position: relative; }
.worked-example::before { content: "WORKED EXAMPLE"; position: absolute; top: -12px; left: 24px; background: #f59e0b; color: white; font-family: "Sora", sans-serif; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 4px; letter-spacing: 0.1em; }

@media (max-width: 700px) {
  .proof-grid { grid-template-columns: 1fr; }
}

/* Geometry hub (cheat-sheet) layout */
.cheat-sheet-layout { display: grid; grid-template-columns: 260px 1fr; gap: 40px; padding: 40px 0 80px; align-items: start; }
.sidebar-toc { position: sticky; top: 24px; padding: 24px; border-right: 2px dashed var(--outline); max-height: calc(100vh - 48px); overflow-y: auto; }
.sidebar-toc h3 { font-family: 'Sora', sans-serif; font-size: 15px; margin: 24px 0 12px; color: var(--ink); text-transform: uppercase; letter-spacing: 0.05em; }
.sidebar-toc h3:first-child { margin-top: 0; }
.toc-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.toc-list a { font-size: 13.5px; color: var(--muted); font-weight: 500; transition: color 0.2s ease; line-height: 1.4; display: block; }
.toc-list a:hover { color: var(--brand); }
.section-title { font-size: 36px; margin: 48px 0 24px; padding-bottom: 12px; border-bottom: 3px solid var(--ink); }
.theorem-block { margin-bottom: 40px; background: #ffffff; border: 1px solid var(--outline); border-radius: 12px; overflow: hidden; box-shadow: 0 4px 12px rgba(17, 24, 39, 0.03); }
.theorem-header { background: #f8fafc; padding: 16px 24px; border-bottom: 1px solid var(--outline); display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.theorem-header h4 { font-size: 18px; color: var(--ink); margin: 0; font-family: "Sora", sans-serif; }
.theorem-body { padding: 24px; display: grid; grid-template-columns: 1fr 200px; gap: 24px; }
.theorem-text p { font-size: 15px; line-height: 1.6; color: var(--muted); margin-bottom: 16px; }
.proof-badge { display: inline-block; background: #fef08a; color: #854d0e; font-family: 'Caveat', cursive; font-size: 18px; padding: 4px 12px; transform: rotate(-2deg); box-shadow: 2px 2px 4px rgba(0,0,0,0.1); margin-bottom: 16px; }
.diagram-box { display: flex; flex-direction: column; justify-content: center; align-items: center; background: #fdfdfc; border: 2px dashed #cbd5e1; border-radius: 8px; padding: 24px 12px; color: var(--muted); text-align: center; min-height: 160px; }
.reference-table { width: 100%; border-collapse: collapse; margin-bottom: 40px; background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid var(--outline); }
.reference-table th { background: #f1f5f9; text-align: left; padding: 12px 16px; font-size: 13px; text-transform: uppercase; color: var(--ink); border-bottom: 2px solid var(--outline); }
.reference-table td { padding: 16px; border-bottom: 1px solid var(--outline); font-size: 14px; color: var(--muted); vertical-align: top; }
.reference-table tr:last-child td { border-bottom: none; }
.reference-table .reason-col { font-family: monospace; color: #991b1b; font-weight: 600; width: 35%; background: #fff5f5; }

@media (max-width: 900px) {
  .cheat-sheet-layout { grid-template-columns: 1fr; }
  .sidebar-toc { display: none; }
  .theorem-body { grid-template-columns: 1fr; }
  .reference-table { display: block; overflow-x: auto; }
}

/* Flashcard Toggle */
.flashcard-toggle { background: var(--ink); color: #fff; border: none; padding: 8px 16px; border-radius: 6px; font-family: "Sora", sans-serif; font-weight: 600; cursor: pointer; margin-top: 16px; transition: opacity 0.2s; }
.flashcard-toggle:hover { opacity: 0.9; }
.flashcard-hidden { background: #e2e8f0 !important; color: transparent !important; border-color: #cbd5e1 !important; cursor: pointer; position: relative; user-select: none; }
.flashcard-hidden::after { content: "Click to reveal"; color: #64748b; position: absolute; left: 50%; transform: translateX(-50%); font-family: monospace; font-size: 11px; top: 4px; }
.flashcard-revealed { animation: reveal 0.3s ease; }
@keyframes reveal { from { opacity: 0; transform: translateY(-2px); } to { opacity: 1; transform: translateY(0); } }
