/* Exam UI Styles - extracted from templates/single-quiz.php */

/* Simulated fullscreen for WebView: toggled via body.test-fullscreen */
.test-fullscreen header,
.test-fullscreen footer,
.test-fullscreen .site-header,
.test-fullscreen .site-footer {
    display: none !important;
}

/* Keep the in-exam header visible (the selector above would otherwise hide it) */
.test-fullscreen header.exam-header {
    display: flex !important;
}

.test-fullscreen {
    height: 100vh;
    overflow: hidden;
}

/* Fullscreen toggle: single icon button (no text, no duplicate buttons) */
.cbt-exam-page .exam-header-right #fullscreenBtn.cbt-fs-toggle {
    width: clamp(2.75rem, 7vw, 3.25rem);
    height: clamp(2.75rem, 7vw, 3.25rem);
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.cbt-exam-page .exam-header-right #fullscreenBtn.cbt-fs-toggle .cbt-ico {
    font-size: clamp(1.15rem, 4.5vw, 1.5rem);
    line-height: 1;
}

@media (max-width: 520px) {
    .cbt-exam-page .exam-header-right #fullscreenBtn.cbt-fs-toggle {
        width: clamp(3rem, 10vw, 3.75rem);
        height: clamp(3rem, 10vw, 3.75rem);
        border-radius: 0.85rem;
    }
}

/* Ensure fullscreen buttons stay readable even if theme overrides button colors */
.cbt-exam-page .exam-header-right .exam-tool-btn,
.cbt-exam-page .exam-header-right .exam-tool-btn:visited {
    background: #ffffff !important;
    color: #111827 !important;
    border: 1px solid #e5e7eb !important;
}

.cbt-exam-page .exam-header-right .exam-tool-btn .cbt-ico {
    opacity: 1 !important;
}

/* Critical Instruction UI */
.instruction-screen {
    max-width: 760px;
    margin: 1.25rem auto;
    padding: 20px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .06);
    text-align: center
}

.instruction-title {
    display: inline-block;
    background: #2b6cb0;
    color: #fff;
    padding: .45rem .9rem;
    border-radius: 6px;
    font-size: 1.35rem;
    margin: 8px 0
}

.instruction-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
    margin: 12px 0
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 110px
}

.summary-icon {
    font-size: 22px;
    margin-bottom: 6px
}

.summary-label {
    font-weight: 600;
    color: #374151
}

.summary-value {
    font-size: 1.15rem;
    color: #111827;
    margin-top: 6px
}

.instruction-rules ul {
    padding-left: 0;
    list-style: none;
    margin: 10px 0
}

.instruction-rules li {
    position: relative;
    padding-left: 18px;
    display: block;
    margin: 8px 0;
    color: #374151
}

.instruction-actions {
    margin-top: 12px
}

.instruction-actions .cbt-button {
    background: #0ea5e9;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer
}

.cbt-guest-top-links .cbt-link {
    color: #0ea5e9;
    margin-right: 8px
}

@media (max-width:520px) {
    .instruction-summary {
        flex-direction: column;
        gap: 8px
    }

    .instruction-screen {
        padding: 14px
    }
}

/* Status Panel Overrides */
.status-panel {
    position: static !important;
    overflow: visible !important
}

.status-panel .legend {
    display: block !important;
    overflow: visible !important
}

@media(max-width:1024px) {
    .question-navigator {
        max-height: 24vh !important
    }

    .legend {
        max-height: none !important
    }
}

/* Right Panel Actions */
.status-panel-actions {
    padding: 20px 0 5px;
    border-top: 1px solid #f3f4f6;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cbt-button.full-width {
    width: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.cbt-button.secondary {
    background: #ffffff;
    color: #4b5563;
    border: 1px solid #d1d5db;
}

.cbt-button.secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
}

.cbt-button.submit-final {
    background: #10b981;
    /* Emerald 500 */
    color: #ffffff;
    border: 1px solid transparent;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.1), 0 2px 4px -1px rgba(16, 185, 129, 0.06);
}

.cbt-button.submit-final:hover {
    background: #059669;
    /* Emerald 600 */
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(16, 185, 129, 0.15), 0 4px 6px -1px rgba(16, 185, 129, 0.1);
}

/* Theme-conflict guard: ensure action buttons render correctly on live sites */
.cbt-exam-page .status-panel-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

.cbt-exam-page .status-panel-actions .cbt-button.full-width {
    width: 100% !important;
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 12px 16px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    text-decoration: none !important;
    position: static !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
}

.cbt-exam-page #submitBtn.cbt-button.submit-final.full-width {
    background: #10b981 !important;
    color: #ffffff !important;
    border: 1px solid transparent !important;
}

.cbt-exam-page #submitBtn.cbt-button.submit-final.full-width:hover {
    background: #059669 !important;
}

.cbt-exam-page #instructionBtn.cbt-button.secondary.full-width {
    background: #ffffff !important;
    color: #4b5563 !important;
    border: 1px solid #d1d5db !important;
}

.cbt-exam-page #instructionBtn.cbt-button.secondary.full-width:hover {
    background: #f9fafb !important;
    border-color: #9ca3af !important;
    color: #111827 !important;
}

/* Simulated fullscreen: keep bottom actions above system UI (RN WebView + mobile browsers) */
.test-fullscreen .exam-content-wrapper,
.test-fullscreen .cbt-exam-container {
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

.test-fullscreen .status-panel-actions,
.test-fullscreen .controls {
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
}

.test-fullscreen .status-panel-actions {
    position: static !important;
    bottom: auto !important;
}

.test-fullscreen #wpadminbar {
    display: none !important;
}

/* Instruction Modal Body */
.cbt-instruction-body {
    text-align: left;
    margin: 20px 0;
    max-height: 60vh;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.6;
    color: #374151;
}

.cbt-instruction-list {
    list-style: none;
    /* Custom bullets */
    padding: 0;
    margin: 0;
}

.cbt-instruction-list li {
    margin-bottom: 12px;
    position: relative;
    padding-left: 24px;
}

.cbt-instruction-list li::before {
    content: "•";
    color: #0ea5e9;
    font-weight: bold;
    position: absolute;
    left: 6px;
    top: 0;
}