/* Exam Loading Screen */
#exam-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh; /* Fallback */
    height: 100dvh; /* Use dynamic viewport height for mobile browsers */
    background: #ffffff;
    /* Keep below Bootstrap navbar (z-index: 1030) so it remains visible */
    z-index: 1029;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    /* Leave space for the fixed navbar so loader content isn't hidden behind it */
    padding: calc(56px + 1rem) 2rem 2rem 2rem; /* top = navbar (56px) + small gap */
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px)); /* Account for iOS home bar */
    box-sizing: border-box; /* include padding in height calculations */
    pointer-events: auto;
    /* Use site's default font (Public Sans) */
    font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, "Helvetica Neue", Arial, sans-serif;
}

.exam-loader-content {
    text-align: left;
    max-width: 500px;
    padding: 0;
}

/* When showing prestart content, expand to full width so Bootstrap grid works */
#exam-loader-overlay.prestart-mode .exam-loader-content {
    max-width: 100%;
    width: 100%;
}

/* Allow scrolling the overlay when prestart content exceeds the viewport */
#exam-loader-overlay.prestart-mode {
    overflow-y: auto;
    overflow-x: hidden;
    /* Tighter horizontal padding only for prestart screen to bring columns closer to edges */
    padding: calc(56px + 1rem) 0.8rem 1rem 0.8rem;
}

/* Prestart container ensures full-width with controlled inner spacing */
#exam-loader-overlay.prestart-mode .prestart-container {
    padding-left: 0.1;
    padding-right: 0.1;
}

/* Background colors for specific prestart sections */
#exam-loader-overlay.prestart-mode .prestart-marks-card .card-body {
    background: #d0eeee;
}

#exam-loader-overlay.prestart-mode .prestart-terms-card .card-body {
    background: #f2f2f2;
}

.exam-loader-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 2rem;
    /* inherit overlay font-family (Public Sans) */
    font-family: inherit;
}

.exam-loader-progress {
    font-size: 1.125rem;
    color: #6c757d;
    margin-bottom: 3rem;
    /* ensure progress text uses default site font */
    font-family: inherit;
}

.exam-start-button {
    padding: 0.75rem 2rem;
    font-size: 1.125rem;
    font-weight: 700; /* make START text bold */
    transition: all 0.2s;
}

.exam-start-button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Spinner animation for loading state */
.exam-loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 0 1.5rem 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
