/* ================================================================
   KORARIMWE EXAM STYLES - Ibizamini bya Amategeko y'umuhanda
   Mobile-First Responsive Design
   ================================================================ */

/* ================================================================
   HERO SECTION
   ================================================================ */

.exam-hero-section {
    background: linear-gradient(135deg, #54D3C2 0%, #3FBEAE 100%);
    padding: 100px 0 60px;
    margin-top: 80px;
}

@media (max-width: 768px) {
    .exam-hero-section {
        padding: 80px 0 40px;
        margin-top: 70px;
    }

    .exam-hero-section h1 {
        font-size: 28px !important;
        line-height: 1.3 !important;
    }

    .exam-hero-section p {
        font-size: 16px !important;
    }
}

/* ================================================================
   EXAM SECTION
   ================================================================ */

.exam-section {
    padding: 60px 0;
    min-height: 60vh;
}

#quiz-screen {
    max-height: 100vh;
    overflow-y: auto;
    padding-top: 120px;
    padding-bottom: 100px;
}

@media (max-width: 768px) {
    .exam-section {
        padding: 40px 0;
    }
}

/* ================================================================
   EXAM CARDS (Selection Screen)
   ================================================================ */

.exam-card {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
}

.exam-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.exam-card-header {
    padding: 25px;
    text-align: center;
}

.exam-card-body {
    padding: 25px;
}

.exam-card-body p {
    margin-bottom: 12px;
    font-size: 16px;
    color: #666;
}

.exam-status {
    margin: 20px 0;
    font-size: 15px;
    font-weight: 600;
}

.exam-status .not-taken {
    color: #999;
}

.exam-status .completed {
    color: #54D3C2;
}

.btn-start-exam {
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(135deg, #54D3C2 0%, #3FBEAE 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-start-exam:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(84, 211, 194, 0.4);
}

.btn-back-home {
    display: inline-block;
    padding: 15px 40px;
    background: #666;
    color: #fff;
    text-decoration: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-back-home:hover {
    background: #54D3C2;
    color: #fff;
    text-decoration: none;
}

/* ================================================================
   QUIZ SCREEN
   ================================================================ */

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 20px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.quiz-progress {
    flex: 1;
    margin-right: 30px;
}

#question-counter {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    display: block;
    margin-bottom: 10px;
}

.progress-bar-container {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #54D3C2 0%, #3FBEAE 100%);
    transition: width 0.3s ease;
}

.quiz-timer {
    font-size: 36px;
    font-weight: 700;
    color: #54D3C2;
    min-width: 120px;
    text-align: right;
}

.quiz-timer.timer-warning {
    color: #FF6B6B;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@media (max-width: 768px) {
    .quiz-header {
        flex-direction: column;
        align-items: stretch;
    }

    .quiz-progress {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .quiz-timer {
        font-size: 28px;
        text-align: center;
    }
}

/* ================================================================
   QUESTION CARD
   ================================================================ */

.question-card {
    background: linear-gradient(135deg, #FF6B6B 0%, #EE5A6F 100%);
    color: #fff;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 25px rgba(255, 107, 107, 0.3);
}

.question-text {
    font-size: 20px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.question-image-container {
    position: relative;
    margin-top: 20px;
    text-align: center;
}

.question-image-container img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
    cursor: zoom-in;
    transition: transform 0.3s;
}

.question-image-container img:hover {
    transform: scale(1.05);
}

.zoom-icon {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 18px;
}

@media (max-width: 768px) {
    .question-card {
        padding: 20px;
    }

    .question-text {
        font-size: 18px;
    }
}

/* ================================================================
   ANSWER OPTIONS
   ================================================================ */

.answer-options {
    margin-bottom: 30px;
}

.answer-option {
    background: #fff;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.3s;
}

.answer-option:hover {
    border-color: #54D3C2;
    transform: translateX(5px);
}

.answer-option.selected {
    border-color: #54D3C2;
    background: rgba(84, 211, 194, 0.1);
}

.answer-option.correct {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.answer-option.wrong {
    border-color: #FF6B6B;
    background: rgba(255, 107, 107, 0.1);
}

.option-text {
    font-size: 16px;
    color: #333;
}

.answer-option.correct .option-text::after {
    content: ' ✅';
}

.answer-option.wrong .option-text::after {
    content: ' ❌';
}

@media (max-width: 768px) {
    .answer-option {
        padding: 15px;
    }

    .option-text {
        font-size: 15px;
    }
}

/* ================================================================
   NAVIGATION BUTTONS
   ================================================================ */

.quiz-navigation {
    text-align: center;
}

.btn-next,
.btn-finish {
    padding: 15px 50px;
    background: linear-gradient(135deg, #54D3C2 0%, #3FBEAE 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-next:hover:not(:disabled),
.btn-finish:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(84, 211, 194, 0.4);
}

.btn-next:disabled,
.btn-finish:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .btn-next,
    .btn-finish {
        width: 100%;
        padding: 15px 20px;
    }
}

/* ================================================================
   RESULTS SCREEN
   ================================================================ */

.results-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.results-header {
    background: linear-gradient(135deg, #54D3C2 0%, #3FBEAE 100%);
    color: #fff;
    padding: 30px;
    text-align: center;
}

.results-header h2 {
    margin: 0;
    font-size: 32px;
}

.results-body {
    padding: 40px;
}

.score-display {
    text-align: center;
    margin-bottom: 40px;
}

.score-circle {
    display: inline-block;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, #54D3C2 0%, #3FBEAE 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    margin-bottom: 20px;
}

#final-score {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
}

.score-total {
    font-size: 24px;
}

.score-message {
    font-size: 20px;
    color: #666;
    margin-top: 20px;
}

.results-details {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 30px;
    padding-right: 10px;
}

.result-item {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 10px;
    border-left: 4px solid;
}

.result-item.correct {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.05);
}

.result-item.wrong {
    border-color: #FF6B6B;
    background: rgba(255, 107, 107, 0.05);
}

.result-question {
    margin-bottom: 10px;
    font-size: 15px;
}

.result-answer {
    font-size: 14px;
}

.correct-answer {
    color: #4CAF50;
    font-weight: 600;
}

.wrong-answer {
    color: #FF6B6B;
    font-weight: 600;
}

.results-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-review,
.btn-retake,
.btn-back {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-review {
    background: #9B59B6;
    color: #fff;
}

.btn-retake {
    background: #54D3C2;
    color: #fff;
}

.btn-back {
    background: #666;
    color: #fff;
}

.btn-review:hover,
.btn-retake:hover,
.btn-back:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .results-body {
        padding: 20px;
    }

    .results-header h2 {
        font-size: 24px;
    }

    .score-circle {
        width: 120px;
        height: 120px;
    }

    #final-score {
        font-size: 36px;
    }

    .score-total {
        font-size: 20px;
    }

    .score-message {
        font-size: 16px;
    }

    .results-actions {
        flex-direction: column;
    }

    .btn-review,
    .btn-retake,
    .btn-back {
        width: 100%;
    }
}

/* ================================================================
   MODALS
   ================================================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: #fff;
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading Spinner */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #54D3C2;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Fullscreen Image Modal */
#fullscreen-modal {
    cursor: zoom-out;
}

#fullscreen-image {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 10px;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 40px;
    font-size: 50px;
    color: #fff;
    cursor: pointer;
    z-index: 10000;
}

@media (max-width: 768px) {
    .modal-content {
        padding: 30px 20px;
    }

    .modal-content h2 {
        font-size: 24px !important;
    }

    .modal-content p {
        font-size: 16px !important;
    }

    .close-modal {
        right: 20px;
        font-size: 40px;
    }
}

/* ================================================================
   SCROLLBAR CUSTOMIZATION
   ================================================================ */

.results-details::-webkit-scrollbar {
    width: 8px;
}

.results-details::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.results-details::-webkit-scrollbar-thumb {
    background: #54D3C2;
    border-radius: 10px;
}

.results-details::-webkit-scrollbar-thumb:hover {
    background: #3FBEAE;
}
