/* ==========================================================================
   1. CORE TEST WRAPPER & ANIMATIONS (CLS Safe)
   ========================================================================== */
#wc-test-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding-top: 1px; /* Prevents margin collapse jump */
    box-sizing: border-box;
}

#wc-test-area {
    margin-top: 30px;
}

#wc-question-box {
    animation: wcFadeIn 0.4s ease;
}

.wc-explanation {
    animation: wcSlideUp 0.4s ease;
}

@keyframes wcFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes wcSlideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.wc-donot {
    display: none !important;
}

/* ==========================================================================
   2. TOP NAVIGATION BAR (Progress, Status, Timer)
   ========================================================================== */
.wc-top-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.wc-progress {
    flex: 1;
    min-width: 200px;
}

#wc-progress-text {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
    color: #333;
    text-align: left;
    font-family: sans-serif;
}

.wc-progress-bar {
    width: 100%;
    height: 10px;
    background: #e9ecef;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.wc-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #007bff, #28a745);
    border-radius: 999px;
    transition: width 0.5s ease-in-out;
}

.wc-status {
    display: flex;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
}

.wc-status-item {
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 50px;
    justify-content: center;
}

#wc-timer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: #ffffff;
    border: 2px solid #007bff;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 700;
    color: #007bff;
    box-shadow: 0 4px 10px rgba(0,123,255,0.15);
}

.wc-timer-icon { font-size: 16px; }
#wc-time-text { min-width: 60px; text-align: center; }

/* ==========================================================================
   3. TYPOGRAPHY & QUESTION LAYOUTS (Cleaned & Grouped)
   ========================================================================== */
.wc-question-text {
    margin: 30px 0;
    font-size: 18px;
    font-weight: 600;
    color: #007bff;
    text-align: left;
    font-family: 'Inter', sans-serif;
    line-height: 1.8;
}

#wc-test-area h4, #wc-result-area h4 {
    margin: 30px 0 20px;
    font-size: 18px;
    font-weight: 600;
    color: #FF4500;
    font-family: 'Inter', sans-serif;
}

#wc-test-area h5, #wc-result-area h5 {
    margin: 30px 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #FF00FF;
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}

.wc-question-text p, .wc-review-question p {
    margin: 30px 0;
    font-size: 17px;
    font-weight: 500;
    color: #000;
    line-height: 2;
    font-family: 'Inter', sans-serif;
}

/* Unified Lists Setup */
.wc-question-text ul, .wc-explanation ul, .wc-review-question ul, .wc-review-explanation ul {
    margin: 10px 0 14px 22px;
    padding: 0;
}

.wc-question-text ul li, .wc-explanation ul li, .wc-review-question ul li, .wc-review-explanation ul li {
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 500;
    color: #E34234;
    line-height: 1.6;
}

.wc-question-text ol, .wc-explanation ol, .wc-review-question ol, .wc-review-explanation ol {
    margin: 10px 0 14px 24px;
    padding: 0;
}

.wc-question-text ol li, .wc-explanation ol li, .wc-review-question ol li, .wc-review-explanation ol li {
    margin: 20px;
    padding: 5px;
    font-size: 16px;
    font-weight: 550;
    color: #000;
    line-height: 1.6;
    font-family: 'Inter', sans-serif;
}

.wc-question-text ol[type="A"], .wc-question-text ol[type="a"],
.wc-explanation ol[type="A"], .wc-explanation ol[type="a"],
.wc-review-question ol[type="A"], .wc-review-question ol[type="a"],
.wc-review-explanation ol[type="A"], .wc-review-explanation ol[type="a"] {
    list-style-type: upper-alpha;
}

/* Inline Styles & Components */
.wc-question-text em, .wc-explanation em, .wc-review-question em, .wc-review-explanation em {
    font-style: italic;
    color: #7D6608;
}

.wc-question-text strong, .wc-explanation strong, .wc-review-question strong, .wc-review-explanation strong {
    font-weight: 700;
    color: #000;
}

.wc-question-text code, .wc-explanation code, .wc-review-question code, .wc-review-explanation code {
    background: #f4f6f8;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 90%;
}

/* Match & Matrix Rows layouts */
.match-header, .match-row, .match-list li {
    display: grid;
    grid-template-columns: 250px auto;
    column-gap: 40px;
    align-items: center;
    font-family: 'Inter', sans-serif;
}

.match-header {
    margin: 30px 0 20px;
    font-size: 18px;
    font-weight: 600;
    color: #FF4500;
}

.match-header .part-left { line-height: 1.3; }
.match-header .part-right { color: #800080; text-align: left; }

.match-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.match-row {
    font-size: 16px;
    font-weight: 550;
    color: #000;
}

.match-row .right, .match-list .left, .match-list .right {
    white-space: nowrap;
}

/* ==========================================================================
   4. ACTIVE PRACTICE OPTIONS (Text and Option Images Integration)
   ========================================================================== */
.wc-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    padding: 14px 18px;
    background-color: #ffffff;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-sizing: border-box;
    font-size: 17px;
    font-family: 'Inter', sans-serif;
    color: #000;
    font-weight: 600;
    line-height: 1.65; /* Helps complex typography layout natively */
}

.wc-option:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
}

/* Option content structural node */
.wc-option-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

/* Standardizing option internal images layout */
.wc-option-content img {
    display: block;
    max-width: 100%;
    height: auto;
    max-height: 140px; 
    object-fit: contain;
    border-radius: 6px;
    margin-top: 4px;
}

/* State validation layout engines */
.wc-option.wc-correct {
    border-color: #28a745 !important;
    background: #e9f7ef !important;
}

.wc-option.wc-wrong {
    border-color: #dc3545 !important;
    background: #fdecea !important;
}

.wc-option-indicator {
    font-size: 18px;
    margin-left: 12px;
    flex-shrink: 0;
}

/* Historical verification vectors for tracking checks */
.wc-icon {
    width: 30px;
    height: 30px;
    margin-left: 10px;
    flex-shrink: 0;
    fill: none;
    stroke-width: 3;
}
.wc-tick { stroke: #0a8f08; }
.wc-cross { stroke: #d10000; }

/* ==========================================================================
   5. FEATURE EXPLANATIONS BLOCK
   ========================================================================== */
.wc-explanation, .wc-review-explanation {
    margin-top: 12px;
    padding: 10px 10px 10px 15px;
    background: #f1f5ff;
    border-left: 4px solid #007bff;
    border-radius: 6px;
    font-size: 17px;
    font-family: 'Inter', sans-serif;
    text-align: left;
    color: #000;
    font-weight: 500;
    line-height: 1.8;
}

.wc-review-explanation p {
    margin-top: 10px;
    background: transparent;
    padding: 0;
}

/* ==========================================================================
   6. PRIMARY NAVIGATION INTERFACES (Next / Finish Actions)
   ========================================================================== */
#wc-next-btn {
    float: right;
    margin: 24px auto 20px;
    padding: 12px 26px;
    background-color: #1e6fe3;
    font-family: sans-serif;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.2px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(30, 111, 227, 0.25);
    transition: background-color 0.25s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

#wc-next-btn:disabled {
    background-color: #b6c6e3;
    box-shadow: none;
    cursor: not-allowed;
}

#wc-next-btn:hover:not(:disabled) {
    background-color: #155ac0;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(30, 111, 227, 0.35);
}

.wc-test-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    max-width: 400px;
}
.wc-test-nav a {
    padding: 10px 16px;
    background: #007bff;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
}
.wc-test-nav a:hover { background: #0056b3; }
.wc-test-nav .disabled { opacity: 0.5; pointer-events: none; }

/* ==========================================================================
   7. CORE TEST RESULTS CARD & METRICS ARCHITECTURE
   ========================================================================== */
#wc-result-area {
    max-width: 900px;
    margin: 20px auto;
    box-sizing: border-box;
}

.wc-result-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 25px;
    box-shadow: 0 12px 35px rgba(0,0,0,0.08);
}

.wc-result-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 25px;
}

.wc-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.wc-result-box {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    transition: transform 0.3s ease;
}

.wc-result-box:hover { transform: translateY(-3px); }
.wc-result-box span { display: block; font-size: 28px; margin-bottom: 5px; }
.wc-result-box strong { font-size: 18px; }

.wc-correct-box { color: #28a745; }
.wc-wrong-box { color: #dc3545; }
.wc-score-box { color: #007bff; }

/* Results Action Button Row */
.wc-test-nav-result {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 25px;
}

#wc-retry-btn, .wc-prev-test-btn, .wc-next-test-btn {
    display: inline-block;
    font-size: 18px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    font-weight: 500;
    border-radius: 25px;
    box-sizing: border-box;
}

#wc-retry-btn {
    padding: 12px 35px;
    background: #007bff;
    color: #fff;
    border: none;
    cursor: pointer;
    flex: 0 0 100%;
    max-width: 250px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    border-radius: 30px;
}
#wc-retry-btn:hover { background: #0056b3; transform: translateY(-2px); }

.wc-prev-test-btn { background: #f7630c; color: #fff; padding: 10px 15px; flex: 1; max-width: 180px; }
.wc-prev-test-btn:hover { background: #d15500; transform: translateY(-2px); }

.wc-next-test-btn { background: #28a745; color: #fff; padding: 10px 20px; flex: 1; max-width: 180px; }
.wc-next-test-btn:hover { background: #1e7e34; transform: translateY(-2px); }

.wc-prev-test-btn.disabled, .wc-next-test-btn.disabled { background: #ccc; color: #666; cursor: not-allowed; pointer-events: none; }

/* ==========================================================================
   8. REVIEW SUBSECTION RENDERING ENGINE
   ========================================================================== */
.wc-review {
    margin-top: 30px;
    text-align: left;
}

.wc-review-question {
    background: #ffffff;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 5px solid #ccc;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #007bff;
}

.wc-review-question.correct { border-color: #28a745; }
.wc-review-question.wrong { border-color: #dc3545; }

.wc-review-question h4 {
    margin-bottom: 12px;
    font-size: 20px;
    color: #007bff;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

.wc-review-option {
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 17px;
    color: #000;
    font-family: 'Inter', sans-serif;
    font-weight: 550;
}

.wc-review-option.wc-correct-opt { background: #e9f7ef; color: #28a745; }
.wc-review-option.wc-wrong-opt { background: #fdecea; color: #dc3545; }

/* ==========================================================================
   9. BRAND COMPONENT PRIMARY IMAGES FRAMEWORK (Question Images)
   ========================================================================== */
.wc-question-image, .wc-review-image {
    margin: 24px auto;
    text-align: center;
    display: flex;
    justify-content: center;
    background: #fdfdfd;
    padding: 10px;
    border-radius: 16px;
}

.wc-question-image img, .wc-review-image img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    max-height: 320px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    background-color: #fff;
    object-fit: contain;
}

.wc-question-image:empty, .wc-review-image:empty {
    display: none !important;
}

/* ==========================================================================
  /* ==========================================================================
   10. DESKTOP MEDIA QUERY ADJUSTMENTS (769px and up)
   ========================================================================== */
@media (min-width: 769px) {
    /* 🔑 TARGET ONLY THE OPTIONS CONTAINER (Removed .wc-question from here) */
    #wc-options-container:has(.wc-option img) { 
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }

    /* Adjust option elements inside the image grid to stay clean and balanced */
    #wc-options-container:has(.wc-option img) .wc-option {
        margin-bottom: 0 !important;
        height: 100% !important; /* Makes side-by-side options equal height */
    }
    
    /* Main question/review banner image hover effects */
    .wc-question-image img:hover, .wc-review-image img:hover {
        transform: translateY(-5px) scale(1.02);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    }
    
    /* Keep column stacking inside the grid boxes so image options look beautiful */
    .wc-option-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-width: 768px) {
    #wc-test-wrapper { padding: 0 10px; }
    .wc-question-text { font-size: 18px; margin: 20px 0; }
    .wc-question-text p { font-size: 20px; }
    
    .wc-question-text ul li, .wc-question-text ol li, .wc-explanation ul li,
    .wc-review-question ul li, .wc-review-explanation ul li, .wc-explanation ul li {
        font-size: 18px;
    }

    .wc-question-text ul, .wc-question-text ol { margin-left: 10px; }
    .wc-option { font-size: 17px; padding: 12px 14px; }
    #wc-next-btn { font-size: 18px; padding: 12px 20px; font-family: sans-serif; }
    
    .wc-status-timer-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        gap: 10px;
    }

    .wc-status { gap: 8px; }
    #wc-timer { white-space: nowrap; }
    
    /* System results mapping adjustments */
    .wc-test-nav-result { flex-direction: column; gap: 15px; align-items: center; }
    #wc-retry-btn, .wc-prev-test-btn, .wc-next-test-btn { flex: 0 0 auto; max-width: 250px; width: 100%; }
    
    .wc-result-title { text-align: left; }
    .wc-question-image img, .wc-review-image img { max-height: 220px; width: auto; margin: 0 auto; }
}

/* ==========================================================================
   11. SMARTPHONE DISPLAY ADJUSTMENTS (480px Breakpoint)
   ========================================================================== */
@media (max-width: 480px) {
    #wc-test-wrapper { margin: 0; padding: 15px; width: 100%; }
    .wc-question-text { font-size: 18px; line-height: 1.7; }
    
    #wc-next-btn {
        float: none;
        display: block;
        margin: 24px auto 20px;
        padding: 12px 25px;
        font-size: 18px;
        text-align: center;
        border-radius: 12px;
    }

    #wc-next-btn:hover:not(:disabled) {
        transform: none;
        box-shadow: 0 6px 18px rgba(30, 111, 227, 0.25);
    }
    
    #wc-result-area { width: 100%; }
    .wc-result-card { padding: 12px; }
    .wc-result-grid { grid-template-columns: 1fr 1fr; }
    .wc-status-item { font-size: 13px; padding: 5px 8px; }

    .wc-option { font-size: 16px; padding: 12px; }
    .wc-option-content img { max-height: 110px; } /* Clean, compact sizing on phones */
    
    .wc-icon { width: 32px; height: 32px; }
    .wc-test-nav { flex-direction: column; gap: 10px; }
    
    .match-header, .match-row {
        grid-template-columns: 1fr 1fr;
        column-gap: 16px;
        font-size: 16px;
    }
}