/* --- Modern MCQ Quiz Refresh (FINAL VERSION) --- */

/* ===================================================================
1. GLOBAL WRAPPER & VARIABLES (THEME SETUP)
=================================================================== 
*/
.fc-quiz-wrap {
    --fc-primary: #1e40af;
    --fc-primary-light: #eff6ff;
    --fc-primary-dark: #1e3a8a;
    --fc-success: #059669;
    --fc-success-light: #ecfdf5; 
    --fc-danger: #ef4444;
    --fc-danger-light: #fef2f2;
    --fc-text-dark: #111827;
    --fc-text-light: #4b5563;
    --fc-border: #d1d5db;
    --fc-bg-light: #ffffff;
    --fc-bg-muted: #f9fafb;
    
    max-width: 850px;
    margin: 3rem auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: var(--fc-bg-muted);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); 
    font-size: 1rem;
    line-height: 1.6;
}

/* Quiz Title Styling */
.fc-quiz-title {
    text-align: center;
    font-size: 1.5rem; 
    font-weight: 800;
    color: var(--fc-text-dark);
    margin: 0 0 3rem 0; 
    padding-bottom: 1.5rem; 
    border-bottom: 3px solid var(--fc-border);
    letter-spacing: -0.025em;
}

/* ===================================================================
2. CARD (QUESTION CONTAINER) STYLING
=================================================================== 
*/
.fc-card {
    background: var(--fc-bg-light);
    border: 1px solid var(--fc-border);
    border-radius: 18px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    margin-bottom: 2.5rem;
}

.fc-front {
    padding: 2.5rem 2.5rem 1rem 2.5rem;
}

.fc-back {
    display: none;
    padding: 1.5rem 2.5rem 2.5rem 2.5rem; 
    background: var(--fc-primary-light);
    border-top: 1px dashed var(--fc-border);
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.fc-card.done .fc-back { 
    display: block; 
    opacity: 1;     
}

/* ===================================================================
3. QUESTION & OPTIONS STYLING
=================================================================== 
*/

.fc-qnum {
    color: var(--fc-primary); 
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.fc-question {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--fc-text-dark);
    margin-top: 0; 
    margin-bottom: 2rem;
    line-height: 1.4;
    text-align: justify;
    white-space: pre-wrap;
}

.fc-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 1.5rem; 
}

.fc-opt {
    display: block;
    width: 100%;
    text-align: left;
    height: auto;
    white-space: normal;
    box-sizing: border-box;
    padding: 1rem 1.5rem; 
    border-radius: 12px;
    border: 2px solid var(--fc-border); 
    background-color: var(--fc-bg-light);
    cursor: pointer;
    font-weight: 600; 
    color: var(--fc-text-dark);
    transition: all 0.3s ease;
    font-size: 1rem; 
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    line-height: 1.5; 
}

.fc-opt:hover:not(:disabled) {
    border-color: var(--fc-primary);
    background-color: var(--fc-primary-light); 
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); 
}

.fc-opt:disabled {
    cursor: not-allowed;
    opacity: 0.9;
}

.fc-opt.correct {
    background-color: var(--fc-success-light) !important;
    border-color: var(--fc-success) !important;
    color: var(--fc-success) !important;
    font-weight: 700;
    box-shadow: 0 0 0 2px var(--fc-success);
}

.fc-opt.incorrect {
    background-color: var(--fc-danger-light) !important;
    border-color: var(--fc-danger) !important;
    color: var(--fc-danger) !important;
}

.fc-opt .emoji {
    font-size: 1.5rem;
    line-height: 1;
    margin-left: 15px;
    float: right;
}

/* ===================================================================
4. RESULTS & NAVIGATION
=================================================================== 
*/

.fc-result {
    font-size: 1.25rem; 
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--fc-text-dark);
}

.fc-back .fc-explain-title {
    font-weight: 700;
    color: var(--fc-text-dark);
    margin-top: 1.5rem;
    font-size: 1.1rem;
}

.fc-back .fc-explain {
    margin-top: 0.75rem;
    color: var(--fc-text-light);
    line-height: 1.7;
    font-size: 0.95rem;
    white-space: pre-wrap;
}

.fc-next-card {
    float: right;
    margin-top: 2rem;
    padding: 0.9rem 1.8rem;
    border-radius: 12px;
    border: none;
    background-color: var(--fc-primary);
    color: #fff;
    font-weight: 700;
    font-size: 1rem; 
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.fc-next-card:hover {
    background-color: var(--fc-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 10px -1px rgba(0, 0, 0, 0.15);
}

a.fc-page-link {
    color: #fff !important;
    border-color: var(--fc-primary);
}

.fc-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--fc-border);
}

.fc-page-link {
    text-decoration: none;
    padding: 0.7rem 1.4rem;
    border-radius: 10px;
    font-weight: 700;
    transition: all 0.3s ease;
    white-space: nowrap;
    border: 2px solid transparent; 
    font-size: 0.95rem;
}

a.fc-page-link {
    background-color: var(--fc-primary);
    color: #fff;
    border-color: var(--fc-primary);
}

a.fc-page-link:hover {
    background-color: var(--fc-primary-dark);
    border-color: var(--fc-primary-dark);
}

.fc-disabled {
    background-color: #e5e7eb; 
    color: #9ca3af;
    cursor: not-allowed;
    border-color: var(--fc-border);
}

.fc-page-info {
    color: var(--fc-text-light);
    font-weight: 600;
    font-size: 0.95rem;
}

#fc-quiz-complete-message {
    background: var(--fc-success-light);
    border: 2px solid var(--fc-success);
    padding: 2.5rem;
    text-align: center;
    border-radius: 18px;
    margin-top: 2.5rem;
    font-weight: 700;
    color: var(--fc-success);
    font-size: 1.25rem;
}

#fc-generate-report-btn {
    float: none !important;
    display: block !important; 
    width: auto !important;
    padding: 12px 25px !important; 
    font-size: 1.1rem !important;
    background-color: var(--fc-primary) !important;
    color: #fff !important;
    border-color: var(--fc-primary) !important;
    transition: background-color 0.2s;
    margin: 1.5rem auto 0 auto !important;
}

#fc-report-loading {
    color: var(--fc-text-light);
}

/* ===================================================================
5. RESPONSIVE DESIGN (MOBILE ADJUSTMENTS)
=================================================================== 
*/
@media (max-width: 640px) {
    .fc-quiz-wrap {
        padding: 1.5rem;
        margin: 1.5rem auto;
        border-radius: 16px;
    }
    .fc-quiz-title {
        font-size: 1.4rem;
        margin-bottom: 2rem;
    }
    .fc-question {
        font-size: 1.15rem;
    }
    .fc-front, .fc-back {
        padding: 1.5rem;
    }
    .fc-options {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .fc-opt {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }
    .fc-pagination {
        flex-direction: column;
        gap: 10px;
    }
    .fc-page-link, .fc-disabled, .fc-page-info {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
    .fc-next-card {
        float: none;
        width: 100%;
        margin-top: 1.5rem;
    }
}

/* ===================================================================
6. FORMATTING FIX: ENSURES BOLD/UNDERLINE APPEARS ON SCREEN AND PRINT
=================================================================== 
*/

/* 1. FORCE VISIBILITY ON SCREEN (Default Media) */
/* This is a general override to counteract theme/framework styles */
.fc-quiz-wrap u,
.fc-quiz-wrap strong,
.fc-quiz-wrap b {
    /* Ensures the underline shows up on the screen */
    text-decoration: underline !important;
    font-weight: bold !important;
    font-style: italic !important;
}

/* 2. FORCE VISIBILITY ON PRINT/PDF */
@media print {
    /* Target ALL elements within the quiz that might use these tags 
       to ensure the underline persists when printed. */
    .fc-quiz-wrap *,
    .fc-quiz-wrap * u,
    .fc-quiz-wrap * b,
    .fc-quiz-wrap * strong {
        /* This is the key property to force the underline in the print view */
        text-decoration: underline !important; 
        
        /* Ensures the bold weight is also retained */
        font-weight: bold !important;
        
        /* Ensures text color is black for printing clarity */
        color: #000 !important; 
    }
}