/* ========================================
   EB-Course Ultimate Hybrid Design
   Quizon Style + Medical App Functionality
   ======================================== */

:root {
    /* Backgrounds */
    --bg-app: #f0f4f8;
    --purple-primary: #6C5CE7;
    --purple-gradient: linear-gradient(135deg, #8E2DE2, #4A00E0);
    --flashcard-gradient: linear-gradient(135deg, #a55eea, #4b7bec);

    /* SRS Colors (Distinct & Bold) */
    --srs-skip: #636e72;
    --srs-easy: #00b894;
    --srs-medium: #f1c40f;
    --srs-hard: #e17055;
    --srs-vhard: #d63031;

    /* Text & UI */
    --text-dark: #2d3436;
    --text-light: #636e72;
    --card-radius: 20px;
}

/* OVERLAY SETUP - Full Screen Medical App Style */
.drcourse-srs-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999999 !important;
    background: #f0f4f8 !important;
    /* Medical light gray/blue */
    display: none;
    /* Controlled by JS .addClass('active') or .css('display','flex') */
    align-items: center;
    justify-content: center;
    font-family: 'Inter', 'Poppins', sans-serif !important;
    overflow-y: auto !important;
}

.drcourse-srs-overlay.active {
    display: flex !important;
}

.drcourse-srs-wrapper {
    width: 100%;
    max-width: 800px;
    height: 100%;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
}

body.drcourse-quiz-active {
    overflow: hidden !important;
}

/* --- LAYOUT WRAPPER --- */
.quiz-layout-wrapper {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* --- TOP STATS DASHBOARD --- */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 12px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border-left: 4px solid var(--purple-primary);
    text-align: center;
}

.stat-card h5 {
    margin: 0;
    font-size: 10px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card span {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--purple-primary);
    margin-top: 5px;
}

/* --- MAIN QUESTION CARD --- */
.main-quiz-card {
    background: white;
    border-radius: var(--card-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    padding: 30px;
    position: relative;
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

/* --- VIDEO BUTTON (FLOATING) --- */
.video-review-btn-float {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #e3f2fd;
    color: #0984e3;
    border: 1px solid #00000000;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    z-index: 10;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.video-review-btn-float:hover {
    background: #6971eb;
    border: 1px solid #232721;
    color: white;
}

.q-meta-top {
    margin-bottom: 20px;
    font-size: 12px;
    color: var(--text-light);
    font-weight: 600;
    margin-right: 100px;
    /* Space for video button */
}

/* --- QUESTION TEXT --- */
.q-text-area h4 {
    font-size: 20px;
    color: var(--text-dark);
    line-height: 1.5;
    font-weight: 700;
    margin: 0 0 25px 0;
}

/* --- MC OPTIONS --- */
.q-options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.opt-btn {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: #fdfdfd;
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 15px;
    color: #444;
    text-align: left;
    position: relative;
}

.opt-btn:hover {
    border-color: var(--purple-primary);
    background: #f8f5ff;
}

/* Radio Circle */
.opt-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 50%;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.opt-radio::after {
    content: '';
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    transition: 0.2s;
}

/* States */
.opt-btn.correct {
    border-color: var(--srs-easy) !important;
    background: #e8f5e9 !important;
    color: #1b5e20 !important;
}

.opt-btn.correct .opt-radio {
    border-color: var(--srs-easy);
    background: var(--srs-easy);
}

.opt-btn.correct .opt-radio::after {
    opacity: 1;
}

.opt-btn.wrong {
    border-color: var(--srs-vhard) !important;
    background: #ffebee !important;
    color: #b71c1c !important;
}

.opt-btn.wrong .opt-radio {
    border-color: var(--srs-vhard);
    background: var(--srs-vhard);
}

.opt-btn.wrong .opt-radio::after {
    opacity: 1;
}

/* --- EXPLANATION BOX --- */
.explanation-box {
    margin-top: 25px;
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 20px;
    border-radius: 8px;
    display: none;
    animation: fadeIn 0.3s;
}

.exp-title {
    font-weight: 700;
    color: #0d47a1;
    font-size: 13px;
    margin-bottom: 5px;
    display: block;
}

.exp-text {
    color: #1565c0;
    font-size: 14px;
    line-height: 1.4;
}

/* --- FLASHCARD --- */
.flashcard-container-mod {
    perspective: 1000px;
    min-height: 350px;
    cursor: pointer;
}

.fc-inner-mod {
    position: relative;
    width: 100%;
    min-height: 350px;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.fc-inner-mod.flipped {
    transform: rotateY(180deg);
}

.fc-face-mod {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--card-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.fc-front-mod {
    background: var(--flashcard-gradient);
    color: white;
}

.fc-back-mod {
    background: white;
    transform: rotateY(180deg);
    border: 2px solid #eee;
}

.fc-label {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 12px;
    margin-bottom: 20px;
    opacity: 0.8;
}

.fc-main-text {
    font-size: 26px;
    font-weight: 700;
}

.fc-sub-text {
    font-size: 13px;
    margin-top: 20px;
    opacity: 0.7;
}

/* On-Card Result Buttons (Flashcard Back) */
.fc-result-btns {
    margin-top: 30px;
    display: flex;
    gap: 15px;
}

.fc-res-btn {
    padding: 10px 20px;
    border-radius: 30px;
    border: 2px solid #eee;
    background: white;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.fc-res-btn:hover {
    transform: scale(1.05);
}

.fc-res-btn.right-btn {
    color: var(--srs-easy);
    border-color: var(--srs-easy);
}

.fc-res-btn.right-btn:hover {
    background: var(--srs-easy);
    color: white;
}

.fc-res-btn.wrong-btn {
    color: var(--srs-vhard);
    border-color: var(--srs-vhard);
}

.fc-res-btn.wrong-btn:hover {
    background: var(--srs-vhard);
    color: white;
}


/* --- SRS ACTION BAR (Bottom) --- */
.srs-action-bar {
    margin-top: 20px;
    padding: 0 10px 30px 10px;
    display: none;
}

.srs-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.srs-btn-cell.full-width {
    grid-column: span 2;
}

.srs-big-btn {
    border: none;
    padding: 15px;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
    min-height: 60px;
}

.srs-big-btn:hover {
    transform: translateY(-3px);
    filter: brightness(110%);
}

.srs-big-btn span {
    font-weight: 400;
    font-size: 11px;
    opacity: 0.9;
    margin-top: 3px;
}

/* Colors */
.btn-skip {
    background: var(--srs-skip);
    opacity: 0.8;
}

.btn-easy {
    background: var(--srs-easy);
}

.btn-med {
    background: var(--srs-medium);
    color: #333;
}

.btn-hard {
    background: var(--srs-hard);
}

.btn-vhard {
    background: var(--srs-vhard);
}

/* --- HEADER CLOSE BTN --- */
.close-app-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 35px;
    height: 35px;
    background: #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: #555;
    z-index: 100;
}

/* Responsive */
@media(max-width: 600px) {
    .stats-dashboard {
        grid-template-columns: 1fr 1fr !important;
    }

    .fc-main-text {
        font-size: 20px;
    }
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popUpOut {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -100%) scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -150%) scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.srs-action-bar {
    animation: slideUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.flashcard-container-mod,
.main-quiz-card {
    animation: fadeIn 0.5s ease-out;
}