/* ——— Class 9 & 10 resource pages shared styles ——— */

/* Resource tiles nav (index page) */
.resource-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(12px, 2.5vw, 18px);
  margin: 0 0 clamp(28px, 4vw, 40px);
  padding: 0;
}

.resource-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 5rem;
  padding: clamp(18px, 3vw, 26px) clamp(12px, 2vw, 18px);
  border-radius: var(--q-r-lg);
  background: linear-gradient(145deg, var(--q-navy-l) 0%, var(--q-navy) 55%, var(--q-navy-d) 100%);
  color: #ffffff;
  text-decoration: none;
  font-family: inherit;
  font-weight: 700;
  font-size: clamp(0.9rem, 2vw, 1rem);
  text-align: center;
  box-shadow: var(--q-sh-md);
  transition: transform 0.25s var(--q-ease), box-shadow 0.25s var(--q-ease);
  position: relative;
  overflow: hidden;
}

.resource-tile::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--q-accent), var(--q-royal));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.resource-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--q-sh-lg);
}

.resource-tile:hover::after {
  opacity: 1;
}

.resource-tile:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(53, 40, 217, 0.4);
}

.resource-tile-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.resource-tile-label {
  line-height: 1.25;
  font-size: clamp(0.88rem, 1.8vw, 0.98rem);
}

.resource-hub-actions {
  margin-top: clamp(20px, 3vw, 28px);
}

.resource-hub-actions .btn-outline {
  margin-top: 0;
}

/* Intro box */
.resource-intro {
  margin: 0 0 clamp(28px, 4vw, 40px);
  padding: clamp(20px, 3vw, 28px) clamp(20px, 3.5vw, 26px);
  background: rgba(255, 255, 255, 0.75);
  border-radius: var(--q-r-lg);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--q-sh-sm);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.resource-intro h2 {
  margin: 0 0 12px;
  font-size: clamp(1rem, 2.2vw, 1.12rem);
  font-weight: 700;
  color: var(--q-navy);
}

.resource-intro p {
  margin: 0;
  font-size: clamp(0.92rem, 1.8vw, 1rem);
  line-height: 1.7;
  color: var(--q-muted);
}

.resource-intro p + p { margin-top: 12px; }

.resource-intro ul {
  margin: 14px 0 0;
  padding-left: 1.2rem;
  color: var(--q-muted);
  font-size: clamp(0.92rem, 1.8vw, 1rem);
  line-height: 1.6;
}

.resource-intro li + li { margin-top: 8px; }

.resource-intro-note {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(20, 27, 79, 0.15);
  font-size: 0.88rem !important;
  color: var(--q-soft) !important;
}

/* Inline code */
.inline-code {
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  font-size: 0.85em;
  font-weight: 600;
  padding: 0.1em 0.4em;
  border-radius: 6px;
  background: rgba(20, 27, 79, 0.07);
  color: var(--q-navy);
  word-break: break-all;
}

/* NCERT chapter list */
.pdf-chapter-list {
  list-style: none;
  margin: 0 0 clamp(24px, 4vw, 40px);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pdf-chapter-list__item {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  gap: 0 16px;
  align-items: center;
  padding: 16px 18px;
  border-radius: var(--q-r-md);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: var(--q-sh-sm);
  transition: transform 0.2s var(--q-ease), box-shadow 0.2s var(--q-ease);
}

.pdf-chapter-list__item:has(.pdf-chapter-list__link):hover {
  transform: translateX(3px);
  box-shadow: var(--q-sh-md);
}

.pdf-chapter-list__item--missing {
  opacity: 0.75;
  background: rgba(255, 255, 255, 0.5);
}

.pdf-chapter-list__num {
  font-weight: 800;
  font-size: 1rem;
  color: var(--q-accent);
  text-align: center;
  line-height: 1;
}

.pdf-chapter-list__body {
  min-width: 0;
}

.pdf-chapter-list__link {
  font-weight: 700;
  color: var(--q-navy);
  text-decoration: none;
  font-size: clamp(0.95rem, 2vw, 1.02rem);
  line-height: 1.35;
  display: block;
}

.pdf-chapter-list__link:hover {
  color: var(--q-royal);
}

.pdf-chapter-list__meta {
  display: block;
  margin-top: 3px;
  font-size: 0.75rem;
  color: var(--q-muted);
  font-weight: 500;
}

.pdf-chapter-list__title-muted {
  font-weight: 600;
  color: var(--q-muted);
  font-size: clamp(0.92rem, 2vw, 1rem);
  display: block;
}

.pdf-chapter-list__badge {
  display: inline-block;
  margin-top: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--q-ink-soft);
  background: rgba(228, 91, 124, 0.1);
  padding: 3px 10px;
  border-radius: 999px;
}

.pdf-chapter-list__open-icon {
  color: var(--q-accent);
  font-size: 1rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.pdf-chapter-list__item:has(.pdf-chapter-list__link):hover .pdf-chapter-list__open-icon {
  opacity: 1;
}

/* Auto-discovered PDFs (notes / pyqs / tests) */
.pdf-auto-list {
  list-style: none;
  margin: 0 0 clamp(24px, 4vw, 36px);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pdf-auto-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--q-r-md);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: var(--q-sh-sm);
  transition: transform 0.2s var(--q-ease), box-shadow 0.2s var(--q-ease);
}

.pdf-auto-list li:hover {
  transform: translateX(3px);
  box-shadow: var(--q-sh-md);
}

.pdf-auto-list__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--q-accent) 0%, var(--q-royal) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.pdf-auto-list__info {
  flex: 1;
  min-width: 0;
}

.pdf-auto-list__link {
  font-weight: 700;
  color: var(--q-navy);
  text-decoration: none;
  font-size: 0.98rem;
  display: block;
}

.pdf-auto-list__link:hover {
  color: var(--q-royal);
}

.pdf-auto-list__file {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--q-muted);
  font-family: ui-monospace, monospace;
  word-break: break-all;
}

/* Responsive */
@media (max-width: 640px) {
  .resource-tiles {
    grid-template-columns: repeat(2, 1fr);
  }

  .resource-tile {
    min-height: 4.5rem;
    padding: 16px 12px;
  }

  .pdf-chapter-list__item {
    grid-template-columns: 2.5rem minmax(0, 1fr);
    padding: 14px 14px;
  }

  .pdf-chapter-list__open-icon {
    display: none;
  }
}

@media (max-width: 380px) {
  .resource-tiles {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

/* ── Coming Soon tile (Class 9) ─────────────────────── */
.resource-tile--soon {
  cursor: default;
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.resource-tile-soon-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(228, 91, 124, 0.85);
  color: #fff;
  padding: 2px 7px;
  border-radius: 999px;
}

.coming-soon-pill {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 999px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.3);
}

/* ── Test pages (tests.php / tests-subject.php / tests-chapter.php) ── */

/* Subject boxes — tests.php */
.subject-boxes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 2.5vw, 20px);
  margin-bottom: clamp(16px, 2.5vw, 20px);
}

.subject-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: clamp(28px, 4vw, 40px) clamp(16px, 2.5vw, 24px);
  border-radius: var(--q-r-lg);
  text-decoration: none;
  color: #fff;
  text-align: center;
  box-shadow: var(--q-sh-md);
  transition: transform 0.22s var(--q-ease), box-shadow 0.22s var(--q-ease);
  position: relative;
  overflow: hidden;
}
.subject-box::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.2s ease;
}
.subject-box:hover::after { background: rgba(255,255,255,0.07); }
.subject-box:hover { transform: translateY(-5px); box-shadow: var(--q-sh-lg); }

.subject-box--chem { background: linear-gradient(145deg, #4a3de8 0%, #141b4f 100%); }
.subject-box--phys { background: linear-gradient(145deg, #e45b7c 0%, #3528d9 100%); }
.subject-box--bio  { background: linear-gradient(145deg, #1a7a4a 0%, #0d3d26 100%); }

.subject-box__icon { font-size: 2.2rem; line-height: 1; }
.subject-box__name { font-size: clamp(1.05rem, 2.2vw, 1.2rem); font-weight: 800; line-height: 1.2; }
.subject-box__sub  { font-size: 0.78rem; font-weight: 500; opacity: 0.8; }

.preboard-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-radius: var(--q-r-lg);
  background: linear-gradient(135deg, #7c3aed 0%, #141b4f 100%);
  color: #fff;
  text-decoration: none;
  box-shadow: var(--q-sh-md);
  margin-bottom: clamp(24px, 4vw, 36px);
  transition: transform 0.2s var(--q-ease), box-shadow 0.2s var(--q-ease);
}
.preboard-box:hover { transform: translateY(-3px); box-shadow: var(--q-sh-lg); }
.preboard-box__icon { font-size: 1.8rem; flex-shrink: 0; }
.preboard-box__name { display: block; font-size: 1rem; font-weight: 700; }
.preboard-box__sub  { display: block; font-size: 0.78rem; opacity: 0.8; margin-top: 2px; }
.preboard-box__arrow { margin-left: auto; font-size: 1.3rem; opacity: 0.7; }

/* Chapter list — tests-subject.php */
.chapter-list {
  list-style: none;
  margin: 0 0 clamp(24px, 4vw, 36px);
  padding: 0;
  border-radius: var(--q-r-md);
  overflow: hidden;
  box-shadow: var(--q-sh-sm);
  border: 1px solid rgba(20,27,79,0.1);
}
.chapter-list li { border-bottom: 1px solid rgba(20,27,79,0.07); }
.chapter-list li:last-child { border-bottom: none; }

.chapter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(255,255,255,0.9);
  text-decoration: none;
  transition: background 0.15s ease, padding-left 0.15s ease;
}
.chapter-row:hover { background: #fff; padding-left: 26px; }

.chapter-row__name  { flex: 1; font-size: clamp(0.92rem, 2vw, 1rem); font-weight: 600; color: var(--q-navy); }
.chapter-row__count { font-size: 0.75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: rgba(53,40,217,0.1); color: var(--q-royal); }
.chapter-row__arrow { color: var(--q-accent); font-size: 1rem; opacity: 0.7; }

.chapter-list--chem     .chapter-row { border-left: 3px solid #3528d9; }
.chapter-list--phys     .chapter-row { border-left: 3px solid #e45b7c; }
.chapter-list--bio      .chapter-row { border-left: 3px solid #1a7a4a; }
.chapter-list--preboard .chapter-row { border-left: 3px solid #7c3aed; }

/* Test file list — tests-chapter.php */
.coming-soon-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: clamp(40px, 6vw, 60px) 20px;
  border-radius: var(--q-r-lg);
  background: rgba(255,255,255,0.7);
  border: 2px dashed rgba(20,27,79,0.15);
  margin-bottom: clamp(24px, 4vw, 36px);
  text-align: center;
}
.coming-soon-box__icon { font-size: 2.5rem; }
.coming-soon-box__text { font-size: 1rem; font-weight: 600; color: var(--q-muted); margin: 0; }

.test-file-list {
  list-style: none;
  margin: 0 0 clamp(24px, 4vw, 36px);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.test-file-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--q-r-md);
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.95);
  box-shadow: var(--q-sh-sm);
  transition: transform 0.18s var(--q-ease), box-shadow 0.18s var(--q-ease);
}
.test-file-item:hover { transform: translateX(3px); box-shadow: var(--q-sh-md); }

.test-file-item__num {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--q-accent), var(--q-royal));
  color: #fff;
  font-size: 0.75rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.test-file-item__name { flex: 1; font-size: clamp(0.9rem, 1.9vw, 1rem); font-weight: 600; color: var(--q-navy); text-transform: capitalize; }
.test-file-item__btn {
  flex-shrink: 0;
  font-size: 0.82rem; font-weight: 700;
  color: var(--q-royal); text-decoration: none;
  padding: 6px 14px;
  border: 1.5px solid var(--q-royal);
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.test-file-item__btn:hover { background: var(--q-royal); color: #fff; }

@media (max-width: 640px) {
  .subject-boxes { grid-template-columns: 1fr; }
  .subject-box { flex-direction: row; justify-content: flex-start; padding: 18px 20px; gap: 14px; text-align: left; }
  .subject-box__icon { font-size: 1.6rem; }
}
@media (max-width: 480px) {
  .test-file-item { padding: 12px 14px; }
  .chapter-row { padding: 14px 16px; }
  .chapter-row:hover { padding-left: 20px; }
}

/* ── Notes tiles (notes.php) ────────────────────────── */
.notes-tiles {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 560px;
  margin: 0 auto clamp(28px,4vw,40px);
}

.notes-tile {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  border-radius: var(--q-r-lg);
  text-decoration: none;
  color: #fff;
  box-shadow: var(--q-sh-md);
  transition: transform 0.22s var(--q-ease), box-shadow 0.22s var(--q-ease);
  position: relative;
  overflow: hidden;
}

.notes-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.2s ease;
}
.notes-tile:hover::before { background: rgba(255,255,255,0.07); }
.notes-tile:hover { transform: translateY(-3px); box-shadow: var(--q-sh-lg); }

.notes-tile--free    { background: linear-gradient(135deg, #1e9e5e 0%, #0d3d26 100%); }
.notes-tile--premium { background: linear-gradient(135deg, #4a3de8 0%, #141b4f 100%); }

.notes-tile__icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
  width: 52px; height: 52px;
  background: rgba(255,255,255,0.15);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
}

.notes-tile__body {
  flex: 1;
  min-width: 0;
}

.notes-tile__name {
  display: block;
  font-size: clamp(1rem, 2.2vw, 1.12rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 4px;
}

.notes-tile__desc {
  display: block;
  font-size: 0.8rem;
  opacity: 0.8;
  line-height: 1.4;
  font-weight: 400;
}

.notes-tile__arrow {
  font-size: 1.3rem;
  opacity: 0.7;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.notes-tile:hover .notes-tile__arrow { transform: translateX(4px); opacity: 1; }

@media (max-width: 480px) {
  .notes-tile { padding: 18px 18px; gap: 14px; }
  .notes-tile__icon { width: 44px; height: 44px; font-size: 1.6rem; }
}
