.questions-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.question-main {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.question-sidebar {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.question-modes {
    display: flex;
    gap: 1rem;
}

.mode-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #3182ce;
    background: transparent;
    color: #3182ce;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn.active {
    background: #3182ce;
    color: white;
}

.mode-btn:hover {
    background: #3182ce;
    color: white;
}

.question-progress {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}

.question-extract {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #3182ce;
}

.question-text {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.question-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.choices-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.choice-item {
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.choice-item:hover {
    border-color: #3182ce;
    background: #f0f9ff;
}

.choice-item.selected {
    border-color: #3182ce;
    background: #3182ce;
    color: white;
}

.choice-label {
    font-weight: 600;
    margin-right: 0.5rem;
}

.rationale-section {
    background: #f0fdf4;
    border: 2px solid #22c55e;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.rationale-title {
    color: #166534;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rationale-text {
    color: #166534;
    line-height: 1.6;
}

.question-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e2e8f0;
}

.nav-btn {
    padding: 0.75rem 1.5rem;
    background: #3182ce;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn:hover {
    background: #2c5aa0;
}

.nav-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.related-questions {
    list-style: none;
    padding: 0;
}

.related-question-item {
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.related-question-item:hover {
    border-color: #3182ce;
    background: #f0f9ff;
}

.related-question-link {
    color: #374151;
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.4;
}

.related-question-link:hover {
    color: #3182ce;
}

.exam-info {
    background: #f0f9ff;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .questions-container {
        grid-template-columns: 1fr;
    }

    .question-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .question-modes {
        width: 100%;
        justify-content: center;
    }

    .question-navigation {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .nav-btn {
        width: 100%;
        justify-content: center;
    }
}

.choices-list input[type="radio"] {
    display: none;
}

.choices-list label {
    display: block;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.choices-list label:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

.choices-list input[type="radio"]:checked + label {
    border-color: #2563eb;
    background-color: #eff6ff;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.choice-item.correct label {
    border-color: #166534;
    background-color: #f0fdf4;
    color: #166534;
    font-weight: 600;
}

.choice-item.incorrect label {
    border-color: #b91c1c;
    background-color: #fef2f2;
    color: #b91c1c;
    font-weight: 600;
}

.choice-item.correct {
    border-color: #166534;
    background-color: #f0fdf4;
    color: #166534;
    font-weight: 600;
}

/* Practice mode message */
.practice-result-message {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    font-weight: 500;
}
.practice-correct {
    color: #15803d;
    background: #f0fdf4;
    display: block;
    padding: 1rem;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
}
.practice-incorrect {
    color: #b91c1c;
    background: #fef2f2;
    display: block;
    padding: 1rem;
    border: 1px solid #fecaca;
    border-radius: 6px;
}

/* --- EXAM MODE --- */
.btn-finish-exam,
.btn-finish-exam-sidebar {
    background-color: #166534;
    color: #fff;
    text-align: center;
}
.btn-finish-exam:hover,
.btn-finish-exam-sidebar:hover {
    background-color: #14532d;
}

.btn-finish-exam-sidebar {
    margin-bottom: 1.5rem;
    padding: 0.75rem;
}

.questions-container.mode-exam .choice-item:has(input[type="radio"]:checked) {
    background-color: #eff6ff;
    border-color: #2563eb;
    color: #1e40af;
    font-weight: 500;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.06);
}

.questions-container.mode-exam
    .choice-item:has(input[type="radio"]:checked)
    label {
    background: transparent;
    color: inherit;
}

.questions-container.mode-exam
    .choice-item:has(input[type="radio"]:checked):hover {
    border-color: #1e40af;
}
/* --- START: Mobile Optimization Rules --- */

@media (max-width: 992px) {
    .questions-container {
        grid-template-columns: 1fr;
    }

    .question-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .question-modes {
        width: 100%;
        justify-content: center;
    }

    .question-navigation {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .nav-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .question-main {
        padding: 1rem; 
    }

    .question-sidebar {
        padding: 1rem; 
    }

   
    .mode-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.9rem;
    }
    
    
    .subscription-prompt {
        padding: 1.5rem; 
    }

    .subscription-prompt h3 {
        font-size: 1.5rem; 
    }

    .subscription-prompt-footer {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        align-items: stretch;
    }

    .subscription-prompt-footer .prompt-text {
        text-align: center;
    }

    .subscription-prompt-footer .prompt-actions {
        margin-left: 0;
        text-align: center;
    }
}

/* --- END: Mobile Optimization Rules --- */