/* ============================================================
   tinyhuda.com — components.css
   Sidebar, timeline spine, year rows, event cards,
   quran / quiz / subjects panels
   ============================================================ */

/* ── SIDEBAR HERO ── */
.s-hero {
  background: linear-gradient(155deg, #1A1206 0%, #2C1F0E 55%, #1A3D25 100%);
  border-radius: var(--radius);
  padding: 22px 18px;
  position: relative;
  overflow: hidden;
}
.s-geo {
  position: absolute;
  right: -6px; top: -6px;
  width: 90px; height: 90px;
  opacity: .09;
}
.s-eyebrow {
  font-size: 11px;
  letter-spacing: 2.5px;
  color: var(--gold2);
  text-transform: uppercase;
  font-weight: 800;
  margin-bottom: 6px;
}
.s-title {
  font-size: 24px;
  font-weight: 900;
  color: #F5EDD8;
  line-height: 1.2;
  letter-spacing: -0.3px;
  margin-bottom: 10px;
}
.s-sub {
  font-size: 14px;
  color: #A89878;
  line-height: 1.65;
}

/* ── SIDEBAR BOX ── */
.s-box {
  background: white;
  border-radius: var(--radius);
  border: 2px solid var(--sand3);
  padding: 16px;
}
.s-box-label {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--ink3);
  margin-bottom: 12px;
}

/* Phase info */
.phase-row { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.phase-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.phase-name { font-size: 16px; font-weight: 900; }
.phase-span { font-size: 12px; color: var(--ink3); font-weight: 700; }

/* Progress */
.prog-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink3);
  margin-bottom: 5px;
}
.prog-bar { height: 6px; background: var(--sand2); border-radius: 4px; overflow: hidden; }
.prog-fill { height: 100%; border-radius: 4px; transition: width .4s ease; }

/* Subjects grid */
.subj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.subj-card {
  background: var(--purple-l);
  border: 2px solid #D4C0F0;
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  transition: .2s;
}
.subj-card:hover:not(.soon) { border-color: var(--purple); }
.subj-card.soon { opacity: .5; cursor: default; }
.subj-icon { font-size: 20px; margin-bottom: 3px; }
.subj-name { font-size: 11px; font-weight: 900; color: var(--purple); }
.subj-sub { font-size: 9px; color: #9A7ABF; font-weight: 700; margin-top: 1px; }

/* ── SIDEBAR TOPIC NAV ── */
.sidebar-nav { margin-top: 0; }
.snav-section { border-bottom: 1px solid var(--sand2); }
.snav-section:last-child { border-bottom: none; }
.snav-header {
  padding: 10px 0;
  font-size: 13px;
  font-weight: 900;
  color: var(--ink);
  cursor: pointer;
  transition: .15s;
  user-select: none;
}
.snav-header:hover { color: var(--gold); }
.snav-items { display: none; flex-direction: column; gap: 6px; padding-bottom: 8px; }
.snav-section.open .snav-items { display: flex; }
.snav-link {
  display: block;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink2);
  text-decoration: none;
  background: var(--sand);
  border: 1.5px solid var(--sand3);
  border-radius: 10px;
  transition: .15s;
  text-align: center;
}
.snav-link:hover {
  color: var(--ink);
  border-color: var(--gold);
  background: var(--sand2);
}

/* ── TIMELINE SPINE ── */
.timeline { position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 22px; top: 10px; bottom: 10px;
  width: 3px;
  background: repeating-linear-gradient(
    to bottom, var(--sand3) 0 8px, transparent 8px 16px
  );
  border-radius: 2px;
}

/* ── YEAR ROW ── */
.year-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 8px;
  cursor: pointer;
}
.yr-node-col {
  width: 46px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding-top: 14px;
  position: relative;
  z-index: 1;
}
.yr-dot {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 3px solid var(--makkah);
  background: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  transition: transform .2s;
}
.year-row:hover .yr-dot,
.year-row.open .yr-dot { transform: scale(1.18); }

.yr-card {
  flex: 1;
  background: white;
  border-radius: var(--radius);
  border: 2px solid var(--sand2);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color .3s, background .3s, box-shadow .3s, transform .2s;
  user-select: none;
}
.year-row.open .yr-card {
  border-color: var(--gold);
  background: var(--sand2);
  box-shadow: 0 4px 16px rgba(212, 160, 50, .15);
}
.year-row:hover .yr-card { border-color: var(--sand4); }

.yr-meta { flex-shrink: 0; min-width: 78px; text-align: right; }
.yr-ce { font-size: 16px; font-weight: 900; color: var(--ink2); line-height: 1; }
.yr-hijri { font-size: 12px; color: var(--ink3); font-weight: 700; margin-top: 3px; }
.yr-divider { width: 1px; height: 38px; background: var(--sand3); flex-shrink: 0; }
.yr-info { flex: 1; min-width: 0; }
.yr-title { font-size: 19px; font-weight: 900; color: var(--ink); letter-spacing: -0.2px; line-height: 1.3; }
.yr-sub { font-size: 13px; color: var(--ink3); font-weight: 700; margin-top: 3px; }
.yr-icon { font-size: 28px; flex-shrink: 0; }
.yr-chev { font-size: 16px; color: var(--gold); font-weight: 900; transition: transform .35s ease; flex-shrink: 0; }
.year-row.open .yr-chev { transform: rotate(180deg); }

/* ── EVENTS PANEL ── */
.events-panel {
  margin-left: 46px;
  padding: 0 0 0 18px;
  border-left: 3px dashed var(--sand3);
  margin-bottom: 8px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .35s cubic-bezier(0, 1, 0, 1), opacity .2s ease, padding .2s ease;
}
.events-panel.open {
  max-height: 99999px;
  padding: 6px 0 4px 18px;
  opacity: 1;
  transition: max-height .5s cubic-bezier(1, 0, 1, 0), opacity .3s ease .05s, padding .2s ease;
}

/* ── EVENT CARD ── */
.ev-card {
  background: white;
  border-radius: var(--radius);
  border: 2px solid var(--sand2);
  margin-bottom: 12px;
  overflow: hidden;
}
.ev-top { padding: 16px 18px 12px; }
.ev-tag-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ev-emoji { font-size: 22px; }
.ev-tag {
  font-size: 9px; font-weight: 900;
  letter-spacing: 1px; text-transform: uppercase;
  padding: 3px 9px; border-radius: 6px;
}
.ev-title {
  font-size: 18px; font-weight: 900;
  color: var(--ink); letter-spacing: -0.3px;
  line-height: 1.3; margin-bottom: 8px;
}
.ev-body { font-size: 16px; color: var(--ink2); line-height: 1.75; }

/* ── PROPHETS CALLOUT ── */
.prophets-callout {
  margin-top: 16px;
  border: 2px solid var(--sand3);
  border-radius: var(--radius);
  overflow: hidden;
}
.prophets-title {
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 900;
  color: var(--ink);
  background: var(--sand2);
  border-bottom: 2px solid var(--sand3);
}
.prophet-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--sand2);
}
.prophet-item:last-child { border-bottom: none; }
.prophet-heaven {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink3);
  margin-bottom: 2px;
}
.prophet-name {
  font-size: 16px;
  font-weight: 900;
  color: var(--ink);
}
.prophet-role {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 4px;
}
.prophet-desc {
  font-size: 14px;
  color: var(--ink2);
  line-height: 1.65;
}

/* ── LISTEN BUTTON ── */
.ev-listen {
  display: inline-block;
  margin-top: 12px;
  padding: 7px 16px;
  background: var(--sand);
  border: 2px solid var(--sand3);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink2);
  cursor: pointer;
  transition: .2s;
  font-family: 'Nunito', sans-serif;
}
.ev-listen:hover {
  border-color: var(--gold);
  background: var(--sand2);
}

/* ── SECTION TABS ── */
.ev-tabs {
  display: flex;
  border-top: 2px solid var(--sand2);
  background: var(--sand);
}
.ev-tab {
  flex: 1;
  padding: 10px 8px;
  font-size: 11px; font-weight: 900; letter-spacing: .2px;
  border: none; background: transparent;
  cursor: pointer; color: var(--ink3);
  border-bottom: 3px solid transparent;
  transition: .15s;
}
.ev-tab:hover { color: var(--ink2); }
.ev-tab.active { color: var(--ink); border-bottom-color: var(--gold); }

/* ── QURAN PANEL ── */
.quran-panel {
  background: var(--quran-dark);
  max-height: 0;
  overflow: hidden;
  padding: 0 18px;
  transition: max-height .25s cubic-bezier(0, 1, 0, 1), padding .2s ease;
}
.quran-panel.open {
  max-height: 800px;
  padding: 16px 18px 18px;
  transition: max-height .35s cubic-bezier(1, 0, 1, 0), padding .2s ease;
}
.q-eyebrow {
  font-size: 9px; font-weight: 900;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--quran-t); opacity: .6; margin-bottom: 4px;
}
.q-surah { font-size: 12px; font-weight: 800; color: var(--gold2); margin-bottom: 10px; }
.q-arabic {
  font-family: 'Amiri', serif;
  font-size: 22px; color: #DCF0E4;
  line-height: 2; text-align: right; direction: rtl;
  border-bottom: 1px solid rgba(126,207,160,.2);
  padding-bottom: 10px; margin-bottom: 10px;
}
.q-trans { font-size: 15px; color: var(--quran-t); font-style: italic; line-height: 1.7; margin-bottom: 10px; }
.q-reflect-note {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold2);
  background: rgba(212, 160, 50, 0.12);
  border: 1px solid rgba(212, 160, 50, 0.35);
  border-radius: 8px;
  padding: 8px 11px;
  margin-bottom: 12px;
  line-height: 1.5;
}
.q-spark { font-size: 14px; color: rgba(126,207,160,.8); line-height: 1.55; }

/* ── QUIZ PANEL ── */
.quiz-panel {
  background: var(--quiz-l);
  max-height: 0;
  overflow: hidden;
  padding: 0 18px;
  transition: max-height .25s cubic-bezier(0, 1, 0, 1), padding .2s ease;
}
.quiz-panel.open {
  max-height: 800px;
  padding: 16px 18px 18px;
  transition: max-height .35s cubic-bezier(1, 0, 1, 0), padding .2s ease;
}
.quiz-q { font-size: 17px; font-weight: 900; color: var(--ink); line-height: 1.4; margin-bottom: 12px; }
.quiz-opts { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt {
  background: white;
  border: 2px solid #C5D0F0;
  border-radius: 10px;
  padding: 11px 15px;
  font-size: 15px; font-weight: 700;
  color: var(--ink);
  cursor: pointer; transition: .2s; text-align: left;
}
.quiz-opt:hover { border-color: var(--quiz-dark); background: #EAF0FC; }
.quiz-opt.correct { background: #E5F4EC; border-color: var(--madinah); color: var(--madinah); }
.quiz-opt.wrong { background: #FDEAE8; border-color: #C0392B; color: #C0392B; }
.quiz-result {
  display: none;
  margin-top: 12px; padding: 11px 14px;
  background: white; border-radius: 10px;
  font-size: 14px; font-weight: 700;
  color: var(--ink); line-height: 1.55;
}
.quiz-result.show { display: block; }

/* ── CONTEXT / BIGGER PICTURE PANEL ── */
.context-panel {
  background: var(--sand2);
  max-height: 0;
  overflow: hidden;
  padding: 0 20px;
  transition: max-height .25s cubic-bezier(0, 1, 0, 1), padding .2s ease;
}
.context-panel.open {
  max-height: 800px;
  padding: 18px 20px 20px;
  transition: max-height .35s cubic-bezier(1, 0, 1, 0), padding .2s ease;
}
.ctx-eyebrow {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink3);
  margin-bottom: 10px;
}
.ctx-body {
  font-size: 15px;
  color: var(--ink);
  line-height: 1.8;
}

/* ── SUBJECTS PANEL ── */
.subjects-panel {
  max-height: 0;
  overflow: hidden;
  padding: 0 18px;
  transition: max-height .25s cubic-bezier(0, 1, 0, 1), padding .2s ease;
}
.subjects-panel.open {
  max-height: 2000px;
  padding: 16px 18px 18px;
  transition: max-height .4s cubic-bezier(1, 0, 1, 0), padding .2s ease;
}
.subjects-panel .subj-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }

/* ── SUBJECT DETAIL PANEL ── */
.subj-content {
  display: none;
  margin-top: 14px;
  padding: 16px;
  background: white;
  border: 2px solid var(--sand3);
  border-radius: var(--radius);
}
.subj-content.show { display: block; }
.subj-detail-title {
  font-size: 17px;
  font-weight: 900;
  color: var(--purple);
  margin-bottom: 10px;
}
.subj-detail-body {
  font-size: 15px;
  color: var(--ink2);
  line-height: 1.75;
  margin-bottom: 14px;
}
.subj-detail-example {
  font-size: 14px;
  color: var(--ink2);
  line-height: 1.65;
  background: var(--purple-l);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.subj-detail-lesson {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.6;
  margin-bottom: 10px;
}
.subj-detail-ref {
  font-size: 12px;
  color: var(--ink3);
  font-weight: 700;
}
.subj-empty {
  font-size: 14px;
  color: var(--ink3);
  font-weight: 700;
  text-align: center;
  padding: 16px;
}

/* ── AGE SELECTOR ── */
.age-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .65);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.age-overlay.open { display: flex; }
.age-card {
  background: white;
  border-radius: 16px;
  padding: 36px 28px 28px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .3);
}
.age-icon { font-size: 40px; margin-bottom: 12px; }
.age-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--ink);
  margin-bottom: 6px;
}
.age-sub {
  font-size: 15px;
  color: var(--ink2);
  margin-bottom: 22px;
}
.age-buttons {
  display: flex;
  gap: 12px;
}
.age-btn {
  flex: 1;
  padding: 18px 12px;
  border: 3px solid var(--sand3);
  border-radius: var(--radius);
  background: white;
  cursor: pointer;
  transition: .2s;
  font-family: 'Nunito', sans-serif;
}
.age-btn:hover { border-color: var(--gold); transform: translateY(-2px); }
.age-btn-emoji { display: block; font-size: 28px; margin-bottom: 8px; }
.age-btn-label { display: block; font-size: 15px; font-weight: 900; color: var(--ink); }

/* ── NAV SETTINGS BUTTON ── */
.nav-settings {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  opacity: .6;
  transition: .2s;
}
.nav-settings:hover { opacity: 1; }
.age-group-ctrl {
  display: flex;
  align-items: center;
  gap: 4px;
}
.age-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--gold2);
  background: rgba(240,200,74,.12);
  border: 1px solid rgba(240,200,74,.3);
  border-radius: 20px;
  padding: 4px 10px;
  white-space: nowrap;
}

/* App footer */
.app-footer {
  text-align: center;
  padding: 0 16px 20px;
  margin-top: -40px;
}
.footer-about {
  background: none;
  border: 2px solid var(--sand3);
  border-radius: 20px;
  padding: 8px 20px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink3);
  cursor: pointer;
  transition: .2s;
}
.footer-about:hover {
  border-color: var(--gold);
  color: var(--ink2);
}

/* Sidebar info button */
.sidebar-info-btn {
  width: 100%;
  padding: 10px;
  margin-top: 12px;
  background: white;
  border: 2px solid var(--sand3);
  border-radius: var(--radius);
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink3);
  cursor: pointer;
  transition: .2s;
}
.sidebar-info-btn:hover {
  border-color: var(--gold);
  color: var(--ink2);
}

/* ── MODAL ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal-card {
  background: white;
  border-radius: var(--radius);
  padding: 28px 24px 22px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
}
.modal-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--ink);
  margin-bottom: 12px;
}
.modal-body {
  font-size: 15px;
  color: var(--ink2);
  line-height: 1.7;
  margin-bottom: 20px;
}
.modal-close {
  display: inline-block;
  padding: 10px 28px;
  background: var(--madinah);
  color: white;
  font-weight: 800;
  font-size: 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  transition: .2s;
}
.modal-close:hover { opacity: .85; }

/* ── FONT SCALING ── */
:root { --fb: 0px; }
body .ev-body          { font-size: calc(16px + var(--fb)); }
body .ev-title         { font-size: calc(18px + var(--fb)); }
body .yr-title         { font-size: calc(19px + var(--fb)); }
body .yr-sub           { font-size: calc(13px + var(--fb)); }
body .q-trans          { font-size: calc(15px + var(--fb)); }
body .q-spark          { font-size: calc(14px + var(--fb)); }
body .quiz-q           { font-size: calc(17px + var(--fb)); }
body .quiz-opt         { font-size: calc(15px + var(--fb)); }
body .quiz-result      { font-size: calc(14px + var(--fb)); }
body .ctx-body         { font-size: calc(15px + var(--fb)); }
body .subj-detail-body { font-size: calc(15px + var(--fb)); }

/* Responsive adjustments for panels */
@media (max-width: 660px) {
  .yr-title { font-size: 17px; }
  .yr-sub { font-size: 12px; }
  .yr-ce { font-size: 15px; }
  .yr-hijri { font-size: 11px; }
  .ev-title { font-size: 17px; }
  .ev-body { font-size: 15px; }
  .quiz-q { font-size: 16px; }
  .quiz-opt { font-size: 14px; }
  .q-trans { font-size: 14px; }
  .subjects-panel .subj-grid { grid-template-columns: 1fr 1fr; }
  .ev-listen {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px 16px;
    font-size: 15px;
  }
}
