/* ExamCracker AI — Exam Library / Adda-style browse experience */
.exam-library-shell{display:grid;gap:18px}
.exam-library-hero{display:flex;justify-content:space-between;gap:20px;align-items:flex-end;padding:22px;border:1px solid var(--border-subtle);border-radius:18px;background:linear-gradient(135deg,rgba(99,102,241,.18),rgba(6,182,212,.08));}
.exam-library-hero h2{margin:0;font-family:var(--font-heading);font-size:1.6rem;color:#fff}.exam-library-hero p{margin:6px 0 0;color:var(--text-muted);font-size:.9rem}
.exam-library-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.exam-library-actions select,.exam-library-actions input{min-height:40px}
.exam-library-search-wrap{display:grid;grid-template-columns:1fr 200px;gap:10px}.exam-library-search-wrap input,.exam-library-search-wrap select{width:100%;box-sizing:border-box;background:var(--surface-2,#111827);border:1px solid var(--border-subtle);color:#fff;border-radius:10px;padding:10px 12px;outline:none}
.library-chip-row{display:flex;gap:8px;overflow:auto;padding-bottom:2px}.library-chip{border:1px solid var(--border-subtle);background:rgba(255,255,255,.035);color:var(--text-muted);border-radius:999px;padding:8px 12px;font-size:.78rem;white-space:nowrap;cursor:pointer}.library-chip.active{background:rgba(99,102,241,.18);border-color:rgba(99,102,241,.55);color:#fff}
.exam-library-exams{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.library-exam-card{display:flex;align-items:center;gap:10px;width:100%;text-align:left;background:var(--card-bg,rgba(255,255,255,.04));border:1px solid var(--border-subtle);color:var(--text);border-radius:14px;padding:11px;cursor:pointer}.library-exam-card:hover,.library-exam-card.selected{border-color:rgba(99,102,241,.65);background:rgba(99,102,241,.1)}.library-exam-icon{width:42px;height:42px;min-width:42px;border-radius:12px;display:grid;place-items:center;background:color-mix(in srgb,var(--exam-accent) 16%,transparent);border:1px solid color-mix(in srgb,var(--exam-accent) 40%,transparent);color:var(--exam-accent);font-size:.72rem;font-weight:800}.library-exam-copy{min-width:0;display:grid;gap:3px;flex:1}.library-exam-copy strong{font-size:.82rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.library-exam-copy small{font-size:.68rem;color:var(--text-dim);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.library-arrow{font-size:1.5rem;color:var(--text-dim)}
.library-tabs{display:flex;gap:6px;overflow:auto;border-bottom:1px solid var(--border-subtle);padding-bottom:6px}.library-tab{border:0;background:transparent;color:var(--text-dim);padding:10px 12px;border-radius:9px;cursor:pointer;white-space:nowrap;font-weight:700}.library-tab.active{background:rgba(99,102,241,.16);color:#fff}
.library-series-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.library-series-card{display:flex;align-items:center;gap:12px;background:rgba(255,255,255,.035);border:1px solid var(--border-subtle);color:#fff;border-radius:14px;padding:13px;text-align:left;cursor:pointer}.library-doc-icon{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;background:rgba(255,255,255,.07);color:var(--cyber-cyan);font-weight:800}.library-series-copy{display:grid;gap:4px;min-width:0;flex:1}.library-series-copy strong{font-size:.88rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.library-series-copy small{color:var(--text-dim);font-size:.72rem;line-height:1.35}
.library-subject-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.library-subject-card{display:flex;align-items:center;gap:9px;width:100%;text-align:left;padding:11px;border:1px solid var(--border-subtle);border-radius:12px;background:rgba(255,255,255,.03);color:#fff;cursor:pointer}.library-subject-card>span:nth-child(2){min-width:0;flex:1}.library-subject-card strong{display:block;font-size:.8rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.library-subject-card small{display:block;color:var(--text-dim);font-size:.66rem;margin-top:3px}.library-subject-icon{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:rgba(59,130,246,.13);color:#60a5fa;font-weight:800;font-size:.85rem}.library-search-line{display:flex;justify-content:space-between;gap:10px;align-items:center}.library-search-line input{max-width:300px;width:100%;box-sizing:border-box;background:var(--surface-2,#111827);border:1px solid var(--border-subtle);color:#fff;border-radius:10px;padding:9px 12px}.library-section-head{display:flex;justify-content:space-between;gap:12px;align-items:end;margin-bottom:10px}.library-section-head h3{margin:0;color:#fff;font-size:1.1rem}.library-section-head p{margin:4px 0 0;color:var(--text-dim);font-size:.75rem}.library-test-list{display:grid;gap:9px}.library-test-card{display:flex;justify-content:space-between;gap:15px;align-items:center;padding:14px;border:1px solid var(--border-subtle);border-radius:14px;background:rgba(255,255,255,.03)}.library-test-main{min-width:0}.library-test-type{font-size:.62rem;color:var(--cyber-cyan);font-weight:800;letter-spacing:.08em}.library-test-card h4{margin:4px 0 3px;color:#fff;font-size:.9rem}.library-test-card p{margin:0;color:var(--text-muted);font-size:.74rem}.library-test-meta{display:flex;gap:8px;flex-wrap:wrap;margin-top:9px}.library-test-meta span{font-size:.65rem;color:var(--text-dim);padding:4px 7px;border:1px solid var(--border-subtle);border-radius:999px}.library-empty{text-align:center;padding:24px;color:var(--text-dim);border:1px dashed var(--border-subtle);border-radius:12px}
.library-count{font-size:.72rem;color:var(--text-dim)}
body.light-mode .exam-library-hero,body.light-mode .library-exam-card,body.light-mode .library-series-card,body.light-mode .library-subject-card,body.light-mode .library-test-card{background:#fff;color:#0f172a;border-color:#dbe3ee}body.light-mode .exam-library-hero h2,body.light-mode .library-series-copy strong,body.light-mode .library-test-card h4,body.light-mode .library-subject-card strong{color:#0f172a}body.light-mode .exam-library-search-wrap input,body.light-mode .library-search-line input,body.light-mode .library-chip,body.light-mode .library-tab{color:#334155;background:#f8fafc}body.light-mode .library-tab.active,body.light-mode .library-chip.active{background:#eef2ff;color:#3730a3}
@media(max-width:1024px){.exam-library-exams{grid-template-columns:repeat(3,minmax(0,1fr))}.library-subject-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:767px){.exam-library-hero{display:grid;gap:12px;padding:16px}.exam-library-search-wrap{grid-template-columns:1fr}.exam-library-exams{grid-template-columns:1fr 1fr}.library-series-grid{grid-template-columns:1fr}.library-subject-grid{grid-template-columns:1fr 1fr}.library-test-card{align-items:flex-start}.library-test-card .btn{white-space:nowrap}.library-search-line{align-items:stretch;flex-direction:column}.library-search-line input{max-width:none}.exam-library-actions{width:100%}.exam-library-actions select{flex:1;min-width:0}}
@media(max-width:420px){.exam-library-exams{grid-template-columns:1fr}.library-subject-grid{grid-template-columns:1fr}.library-test-card{flex-direction:column}.library-test-card .btn{width:100%}}

/* v10 resource and exam-scope polish */
.notes-library-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.note-card{min-height:180px}.resource-note-body{max-height:60vh;overflow:auto;line-height:1.7}.resource-note-body div{padding:6px 0;border-bottom:1px solid rgba(255,255,255,.06)}.progress-topic-row small{display:block;color:var(--text-muted);font-size:.72rem;margin-top:3px}@media(max-width:800px){.notes-library-grid{grid-template-columns:1fr}}

/* V11: unified dark native select styling — never fall back to bright white controls in dark mode */
.exam-library-actions select,
.exam-select,
#studyHoursPerDaySelect,
select.exam-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  color-scheme: dark;
  color: #f8fafc;
  background-color: #111827;
  border: 1px solid rgba(99,102,241,.55);
  border-radius: 14px;
  min-height: 46px;
  padding: 11px 42px 11px 14px;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02), 0 6px 24px rgba(0,0,0,.18);
  background-image:
    linear-gradient(45deg, transparent 50%, #a5b4fc 50%),
    linear-gradient(135deg, #a5b4fc 50%, transparent 50%),
    linear-gradient(180deg, rgba(99,102,241,.10), rgba(34,211,238,.04));
  background-position:
    calc(100% - 20px) 20px,
    calc(100% - 14px) 20px,
    0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-repeat: no-repeat;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background-color .18s ease;
}
.exam-library-actions select:hover,
.exam-select:hover,
#studyHoursPerDaySelect:hover {
  border-color: rgba(129,140,248,.9);
  box-shadow: 0 8px 28px rgba(79,70,229,.18);
}
.exam-library-actions select:focus,
.exam-select:focus,
#studyHoursPerDaySelect:focus {
  outline: none;
  border-color: #22d3ee;
  box-shadow: 0 0 0 3px rgba(34,211,238,.14), 0 8px 30px rgba(79,70,229,.18);
}
.exam-library-actions select option,
.exam-select option,
#studyHoursPerDaySelect option {
  background: #0f172a;
  color: #f8fafc;
}
body.light-mode .exam-library-actions select,
body.light-mode .exam-select,
body.light-mode #studyHoursPerDaySelect {
  color-scheme: light;
  color: #0f172a;
  background-color: #f8fafc;
  border-color: #c7d2fe;
  background-image:
    linear-gradient(45deg, transparent 50%, #4f46e5 50%),
    linear-gradient(135deg, #4f46e5 50%, transparent 50%);
}
body.light-mode .exam-library-actions select option,
body.light-mode .exam-select option,
body.light-mode #studyHoursPerDaySelect option {
  background: #ffffff;
  color: #0f172a;
}
@media (max-width: 767px) {
  .exam-library-actions select,
  .exam-select {
    width: 100%;
    min-height: 48px;
    font-size: .95rem;
  }
}
