/* ============================================================
   OSCE THEME & INTERACTIVE COMPONENTS (Deep Medical Cyan & Slate)
   ============================================================ */

:root {
  --osce-primary: var(--accent, #FF861C);
  --osce-accent: var(--accent, #FF861C);
  --osce-secondary: color-mix(in srgb, var(--accent, #FF861C) 70%, #6366f1 30%);
}

/* 500px MAX IMAGE SIZING & ASPECT RATIO PRESERVATION */
.note-content img,
.callout img,
img.osce-zoomable-img {
    max-width: 500px !important;
    max-height: 500px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    aspect-ratio: auto !important;
    display: block;
    margin: 1.2rem 0;
    border-radius: 8px;
    cursor: zoom-in;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.note-content img:hover,
img.osce-zoomable-img:hover {
    transform: scale(1.015);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

/* TOP PROGRESS BAR & TRACKER */
.osce-top-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 1000;
    pointer-events: none;
}

.osce-top-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent, #FF861C), color-mix(in srgb, var(--accent, #FF861C) 70%, #f59e0b 30%));
    box-shadow: 0 0 10px color-mix(in srgb, var(--accent, #FF861C) 70%, transparent 30%);
    transition: width 0.1s ease-out;
}

.osce-question-tracker {
    position: relative;
    display: inline-flex;
    align-items: center;
    pointer-events: auto;
    margin-right: 4px;
}

.tracker-inner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.95));
    border: 1px solid color-mix(in srgb, var(--accent, #FF861C) 30%, transparent 70%);
    border-radius: 9999px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35), 0 0 10px color-mix(in srgb, var(--accent, #FF861C) 20%, transparent 80%);
    font-size: 0.82rem;
    color: #f1f5f9;
    user-select: none;
    transition: all 0.2s ease;
}

.tracker-inner:hover {
    border-color: color-mix(in srgb, var(--accent, #FF861C) 60%, transparent 40%);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4), 0 0 14px color-mix(in srgb, var(--accent, #FF861C) 25%, transparent 75%);
}

.tracker-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.15s ease;
}

.tracker-btn:hover {
    color: var(--accent, #FF861C);
    background: color-mix(in srgb, var(--accent, #FF861C) 15%, transparent 85%);
    transform: scale(1.15);
}

.tracker-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tracker-q-badge {
    font-weight: 600;
    color: var(--accent, #FF861C);
    white-space: nowrap;
}

.tracker-percent {
    font-size: 0.74rem;
    font-weight: 500;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 6px;
    border-radius: 10px;
}

.tracker-divider {
    width: 1px;
    height: 14px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 2px;
}

.tracker-answers-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #34d399;
    font-weight: 600;
    font-size: 0.78rem;
    white-space: nowrap;
}

.tracker-answers-badge svg {
    color: #34d399;
}

@media (max-width: 900px) {
    .tracker-inner {
        padding: 4px 8px;
        font-size: 0.75rem;
        gap: 4px;
    }
    .tracker-percent {
        display: none;
    }
}

/* Header Toggle All Answers button */
.osce-header-toggle-btn {
    transition: all 0.2s ease;
}

.osce-header-toggle-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.osce-header-toggle-btn.is-active {
    color: var(--accent);
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent, #FF861C) 15%, transparent 85%);
}

/* Question Headings */
.note-content h2,
.note-content h3.osce-q {
    color: var(--h2-color, var(--accent, #FF861C));
    font-size: 1.35rem;
    font-weight: 700;
    margin-top: 2em;
    margin-bottom: 0.5em;
    padding-bottom: 0.25em;
    border-bottom: 1px solid color-mix(in srgb, var(--accent, #FF861C) 25%, transparent 75%);
    scroll-margin-top: 90px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.note-content h2.osce-q-answered,
.note-content h3.osce-q-answered {
    color: #34d399 !important;
    border-bottom-color: rgba(52, 211, 153, 0.35);
}

.note-content h2.osce-q-answered::after,
.note-content h3.osce-q-answered::after {
    content: " \2713";
    color: #34d399;
    font-size: 0.9em;
    font-weight: bold;
}

/* LIST HIERARCHY & INDENTATION (Alphabetical & Sublists) */
.note-content ol,
.callout-content ol {
    margin: 0.5rem 0 0.75rem 1.5rem;
    padding-left: 0.5rem;
}

.note-content ul,
.callout-content ul {
    margin: 0.5rem 0 0.75rem 1.5rem;
    padding-left: 0.5rem;
}

.note-content li,
.callout-content li {
    margin-bottom: 0.35rem;
    line-height: 1.6;
}

.note-content ol,
.callout-content ol {
    list-style-type: decimal;
}

.callout-content ul ul,
.callout-content ol ul,
.callout-content ul ol,
.callout-content ol ol,
.note-content ul ul,
.note-content ol ul,
.note-content ul ol,
.note-content ol ol {
    margin-top: 0.35rem;
    margin-bottom: 0.5rem;
    padding-left: 1.25rem;
}

/* Level 2: Lowercase Letters (a., b., c.) */
.note-content ol ol,
.callout-content ol ol,
ol[type="a"],
ol.alpha-list {
    list-style-type: lower-alpha;
}

/* Level 3: Roman Numerals (i., ii., iii.) */
.note-content ol ol ol,
.callout-content ol ol ol {
    list-style-type: lower-roman;
}

/* ────────────────────────────────────────────────────────────
   VIEWERJS MODAL CLEANUP
   Ensure ViewerJS UI elements never occupy document layout flow
   or produce a blank bar at the bottom of the page.
   ──────────────────────────────────────────────────────────── */
.viewer-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 2015 !important;
}

.viewer-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}

/* When viewer is not active / closed, ensure it takes zero layout space */
.viewer-hide {
    display: none !important;
}

/* Prevent any stray viewer element from creating bottom scroll height */
body > .viewer-container:not(.viewer-in),
.note-content > .viewer-container:not(.viewer-in) {
    display: none !important;
}


