/* ===== Shell & Layout ===== */

.rep-exam-container {
    max-width: 960px;
    margin: 30px auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.18);
    padding: 24px 24px 32px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.rep-exam-container h2 {
    font-size: 1.4rem;
    margin: 0 0 12px;
    font-weight: 700;
    color: #0f172a;
}

/* ===== Instructions ===== */

.rep-exam-instructions {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, #eff6ff, #eef2ff);
    border: 1px solid #bfdbfe;
    position: relative;
}

.rep-exam-instructions p {
    margin: 0 0 6px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rep-exam-instructions p::before {
    content: "⚠️";
    font-size: 0.9rem;
}

.rep-exam-instructions ul {
    margin: 0;
    padding-left: 18px;
}

.rep-exam-instructions li {
    font-size: 0.9rem;
    color: #334155;
    margin-bottom: 4px;
}

/* ===== Header (Timer & Violations) ===== */

.rep-exam-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #ffffffee;
    backdrop-filter: blur(12px);
    padding: 10px 12px;
    margin: 0 -24px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.rep-exam-header .rep-timer,
.rep-exam-header .rep-violation-count {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rep-exam-header .rep-timer span,
.rep-exam-header .rep-violation-count span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    padding: 4px 8px;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.rep-exam-header .rep-timer span {
    background: #ecfdf3;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.rep-exam-header .rep-violation-count span {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.rep-exam-header .rep-timer::before {
    content: "⏱️";
}

.rep-exam-header .rep-violation-count::before {
    content: "🚨";
}

/* ===== Buttons ===== */

.rep-start-exam-btn,
.rep-submit-exam-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: transform 0.08s ease, box-shadow 0.12s ease, background 0.12s ease;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    margin-top: 10px;
}

.rep-start-exam-btn:hover,
.rep-submit-exam-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(37, 99, 235, 0.45);
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.rep-start-exam-btn:active,
.rep-submit-exam-btn:active {
    transform: translateY(0);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.35);
}

.rep-submit-exam-btn {
    margin-top: 20px;
    width: 100%;
    max-width: 260px;
}

/* ===== Camera / Proctoring Panel ===== */

.rep-camera-box {
    margin: 8px 0 18px;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: radial-gradient(circle at top left, #eff6ff 0, #ffffff 55%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

#rep-webcam-video {
    width: 100%;
    max-width: 360px;
    border-radius: 12px;
    background: #020617;
    border: 1px solid rgba(15, 23, 42, 0.75);
}

.rep-camera-box small {
    font-size: 0.8rem;
    color: #6b7280;
}

/* ===== Question Blocks ===== */

.rep-exam-questions {
    margin-top: 4px;
}

.rep-question-block {
    padding: 14px 14px 12px;
    margin-bottom: 10px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: #f9fafb;
    position: relative;
}

.rep-question-block:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.rep-question-block p {
    margin: 0 0 8px;
    font-size: 0.95rem;
    color: #111827;
}

.rep-question-block p strong {
    color: #0f172a;
}

/* "Answered" status tag (optional, for future JS use) */
.rep-question-block[data-answered="true"]::after {
    content: "Answered";
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 999px;
    background: #ecfdf3;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* ===== Options Styling ===== */

.rep-options-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.rep-options-list li {
    margin-bottom: 6px;
}

.rep-options-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.9rem;
    color: #111827;
    transition: background 0.12s ease, border-color 0.12s ease, transform 0.05s ease;
}

.rep-options-list input[type="radio"] {
    accent-color: #2563eb;
    width: 16px;
    height: 16px;
}

.rep-options-list label:hover {
    background: #e5edff;
    border-color: #93c5fd;
    transform: translateY(-0.5px);
}

/* ===== Result Card ===== */

.rep-exam-result {
    max-width: 560px;
    margin: 30px auto;
    padding: 22px 20px;
    border-radius: 16px;
    background: radial-gradient(circle at top left, #eff6ff 0, #ffffff 45%);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
    border: 1px solid rgba(148, 163, 184, 0.55);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.rep-exam-result h2 {
    margin: 0 0 10px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
}

.rep-exam-result p {
    margin: 3px 0;
    font-size: 0.95rem;
    color: #111827;
}

.rep-exam-result p strong {
    color: #0f172a;
}

/* You can add .rep-status-pass / .rep-status-fail later via PHP if needed */

/* ===== Small Screen Adjustments ===== */

@media (max-width: 768px) {
    .rep-exam-container {
        margin: 16px;
        padding: 18px 16px 24px;
        border-radius: 14px;
    }

    .rep-exam-header {
        margin: 0 -16px 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .rep-start-exam-btn,
    .rep-submit-exam-btn {
        width: 100%;
        justify-content: center;
        margin-top: 14px;
    }

    #rep-webcam-video {
        max-width: 100%;
    }
}
