/*
 * Past Examination Papers — page styles.
 * Built on the library site's own Bootstrap + style.css; the primary colour comes from there.
 * Card, hero and note styles are copied from the library homepage.
 */
/* Blue accents, exactly as on databases.php (the template's yellow primary is hard to read on white) */
:root { --pp-primary: #0d6efd; }
.pp-scope { --az-blue: #0d6efd; --az-blue-dark: #0a58ca; --az-blue-soft: #f1f6ff; }
.pp-scope .btn-primary,
.pp-scope .btn-outline-primary { border-radius: 30px; font-weight: 600; border: 1px solid var(--az-blue); transition: background .15s, color .15s; }
.pp-scope .btn-primary { background: var(--az-blue); color: #fff; }
.pp-scope .btn-primary:hover, .pp-scope .btn-primary:focus { background: var(--az-blue-dark); border-color: var(--az-blue-dark); color: #fff; }
.pp-scope .btn-outline-primary { background: #fff; color: var(--az-blue); }
.pp-scope .btn-outline-primary:hover, .pp-scope .btn-outline-primary:focus { background: var(--az-blue); color: #fff; }
.pp-scope .btn-outline-primary:disabled, .pp-scope .btn-primary:disabled { opacity: .65; }
.pp-scope a:not(.btn), .pp-scope .btn-link { color: var(--az-blue); }
.pp-scope .btn-link:hover { color: var(--az-blue-dark); }
.pp-scope .bg-primary { background-color: var(--az-blue) !important; }
.pp-scope .text-primary { color: var(--az-blue) !important; }
.pp-scope .form-control:focus, .pp-scope .form-select:focus { border-color: #86b7fe; box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25); }
.pp-scope #q, .pp-scope #list-filter { border-radius: 30px; }
.pp-scope mark { background: #fff3cd; color: inherit; }

/* Homepage hero (carousel item) */
.pp-hero { position: relative; background: #1b2229; }
.pp-hero .hero-img { height: 300px; object-fit: cover; display: block; }
.pp-hero .hero-overlay { position: absolute; inset: 0; display: flex; align-items: center; background: rgba(0, 0, 0, .45); }
@media (max-width: 991.98px) { .pp-hero .hero-img { height: 240px; } }

/* Homepage card styles */
.resource-box, .balanced-card {
    background: #fff; border-radius: 10px; box-shadow: 0 0 45px rgba(0, 0, 0, .08); padding: 30px;
}
.mini-note {
    background: #f1f6ff; border-left: 4px solid var(--pp-primary); padding: 14px 16px; border-radius: 10px; margin-top: 20px;
}
.section-text { text-align: justify; }
.pp-finder { position: relative; z-index: 2; margin-top: -70px; }
.pp-or { display: flex; align-items: center; gap: 14px; margin: 28px 0 18px; color: #6c757d; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; }
.pp-or::before, .pp-or::after { content: ""; flex: 1; height: 1px; background: #dee2e6; }

/* Results / contents list */
.pp-panel { padding: 0; overflow: hidden; scroll-margin-top: 110px; }
.pp-panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 30px; border-bottom: 1px solid #e9ecef; }
.pp-panel-head h2 { margin: 0; }
.pp-panel-head .form-control { max-width: 300px; }
.course-list { list-style: none; margin: 0; padding: 0; }
.course { display: grid; grid-template-columns: 170px 1fr; gap: 4px 24px; padding: 16px 30px; border-bottom: 1px solid #f1f3f5; }
.course:last-child { border-bottom: 0; }
.course:hover { background: #f8f9fa; }
.course-code { font-weight: 700; color: var(--pp-primary); overflow-wrap: anywhere; }
.course-title { font-weight: 600; color: #212529; }
.course-title.missing { font-weight: 400; font-style: italic; color: #6c757d; }
.course-where { font-size: .875rem; color: #6c757d; }
.course-papers { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.course-papers .btn { border-radius: 50rem; }
.course-papers .btn b { margin-right: 4px; }
.empty-state { padding: 34px 30px; text-align: center; color: #6c757d; }
mark { padding: 0 2px; }

/* Paper reader */
.pp-reader-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; }
.pp-reader-toolbar .page-status { min-width: 110px; text-align: center; font-size: .875rem; }
.reader-stage { height: min(76vh, 880px); min-height: 560px; overflow: auto; display: flex; justify-content: center; align-items: flex-start; padding: 24px; background: #e9ecef; }
.reader-stage[hidden] { display: none !important; }
.reader-sheet { position: relative; flex: 0 0 auto; background: #fff; box-shadow: 0 0 45px rgba(0, 0, 0, .15); }
.reader-sheet canvas { display: block; }
.reader-loading { min-height: 560px; display: grid; place-items: center; padding: 24px; text-align: center; color: #6c757d; font-weight: 600; background: #e9ecef; }
.reader-loading[hidden] { display: none !important; }

/* "How it works" boxes reuse the homepage facts markup */
.pp-facts .btn-lg-square { width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; }

/* Report dialog + toast */
.report-dialog { width: min(680px, calc(100% - 28px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 10px; box-shadow: 0 0 45px rgba(0, 0, 0, .25); }
.report-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.report-honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.report-status { display: none; }
.report-status.show { display: block; }
.report-toast { position: fixed; right: 20px; bottom: 20px; z-index: 1100; width: min(430px, calc(100% - 40px)); padding: 15px 18px; color: #fff; background: #212529; border-radius: 10px; box-shadow: 0 0 45px rgba(0, 0, 0, .25); opacity: 0; visibility: hidden; transform: translateY(12px); transition: opacity .2s, transform .2s, visibility .2s; font-weight: 600; }
.report-toast.show { opacity: 1; visibility: visible; transform: none; }
.report-toast.success { background: var(--bs-success, #198754); }
.report-toast.error { background: var(--bs-danger, #dc3545); }

@media (max-width: 767.98px) {
    .pp-finder { margin-top: -40px; }
    .resource-box { padding: 22px 18px; }
    .pp-panel { padding: 0; }
    .pp-panel-head { padding: 18px; }
    .pp-panel-head .form-control { max-width: none; }
    .course { grid-template-columns: 1fr; padding: 14px 18px; }
    .course-papers { grid-column: 1; }
    .reader-stage, .reader-loading { min-height: 62vh; padding: 12px; }
}

/* Darker, easier-to-read text on this page (the template's body text is a light grey) */
.pp-scope { color: #212529; }
.pp-scope p, .pp-scope span, .pp-scope label, .pp-scope li { color: inherit; }
.pp-scope h1, .pp-scope h2, .pp-scope h3, .pp-scope h4, .pp-scope h5 { color: #1a1d20; }
.pp-hero h1, .pp-hero p { color: #fff !important; }
.pp-scope .text-muted, .pp-scope .course-where, .pp-scope .pp-or, .pp-scope .empty-state { color: #495057 !important; }
.pp-scope .course-title { color: #1a1d20; }
.pp-scope .course-title.missing { color: #5c636a; }
.pp-scope .form-control::placeholder { color: #6c757d; }
.pp-scope .form-select:disabled { color: #495057; }
.pp-facts span { color: #343a40; }
