/* Quiz Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&family=Roboto:wght@400;700&display=swap');

:root {
    --primary: #ffd500;
    --primary-dark: #e6b400;
    --secondary: #ff9a00;
    --accent: #5ce3ba;
    --text-dark: #333333;
    --text-light: #ffffff;
    --bg-light: #f9f9f9;
    --bg-dark: #222222;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --transition: all 0.3s ease;
}

 .question-image {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.quiz-saved-message {
    background-color: #dff0d8;
    color: #3c763d;
    padding: 10px;
    margin: 15px 0;
    border-radius: 4px;
    border-left: 4px solid #5cb85c;
    font-weight: bold;
    text-align: center;
}

body.quiz-page {


    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

body.content-page-main {

    padding: 0;

}

button#next-question {
    font-weight: bold;
}

/* Style for back button */
.quiz-page-back-button {
    display: inline-block;
    background-color: var(--primary);
    color: var(--text-dark) !important;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    text-decoration: none;
    text-align: center;
    margin-bottom: 1.5rem;
    transition: background-color 0.3s ease;
    font-weight: bold;
    font-family: 'Poppins', sans-serif;
    border: none;
}

.quiz-page-back-button:hover {
    background-color: var(--primary-dark);
    text-decoration: none;
    color: var(--text-dark) !important;
}

.quiz-container {

    max-width: 1000px;
    margin: 0 auto 2rem auto; /* Changed from margin: 2rem auto; */
    background-color: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--text-dark);
    border: 1px solid #dee2e6;
    margin: 20px auto;
}

.quiz-container h1 {
    font-family: 'Poppins', sans-serif;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2.2rem;
    border-bottom: 2px solid var(--secondary);
    padding-bottom: 0.3em;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: var(--radius);
    margin: 1.5rem 0;
    overflow: hidden;
    height: 20px;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    text-align: center;
    line-height: 20px;
    color: var(--text-dark);
    font-weight: bold;
    font-size: 0.8em;
    transition: width 0.4s ease;
    white-space: nowrap;
    overflow: hidden;
}

/* Question Area */
.question-area {
    margin-bottom: 1.5rem;
}

.question-text {
    font-size: 1.4em;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    line-height: 1.4;
}

/* Answer Options */
.answer-options {
    list-style: none;
    padding: 0;
    margin: 0;
}

.answer-options li {
    margin-bottom: 0.75rem;
}

.answer-options button {
    display: block;
    width: 100%;
    padding: 0.8rem 1rem;
    font-family: 'Roboto', sans-serif;
    font-size: 1em;
    text-align: left;
    background-color: #f8f9fa;
    border: 1px solid #ccc;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.answer-options button:hover:not(:disabled) {
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.answer-options button:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

/* Feedback Styles */
.answer-options button.correct {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
    font-weight: bold;
}

.answer-options button.incorrect {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
    font-weight: bold;
}

.feedback-area {
    margin-top: 1rem;
    padding: 0.8rem;
    border-radius: var(--radius);
    font-weight: bold;
    text-align: center;
}

.feedback-area.correct {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #28a745;
}

.feedback-area.incorrect {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #dc3545;
}

/* Navigation/Control Buttons */
.quiz-controls {
    text-align: center;
    margin-top: 1.5rem;
}

.quiz-controls button {
    padding: 0.8rem 1.5rem;
    font-family: 'Poppins', sans-serif;
    font-size: 1em;
    background-color: var(--primary);
    color: var(--text-dark);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 0.5rem;
}

.quiz-controls button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Results Area */
.results-area {
    text-align: center;
    padding: 2rem;
    border: 1px solid #ccc;
    border-radius: var(--radius);
    background-color: #f8f9fa;
    display: none;
}

.results-area h2 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-family: 'Poppins', sans-serif;
}

.results-area p {
    font-size: 1.2em;
    margin-bottom: 1.5rem;
}

.correct-answers-section {
    margin-top: 2rem;
    text-align: left;
    border-top: 1px solid #ccc;
    padding-top: 1.5rem;
}

.correct-answers-section h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    text-align: center;
    font-family: 'Poppins', sans-serif;
}

#correct-answers-list {
    list-style: none;
    padding: 0;
}

#correct-answers-list li {
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border: 1px solid #eee;
    border-radius: var(--radius);
}

#correct-answers-list li strong {
    display: block;
    margin-bottom: 0.5rem;
}

.correct-review {
    color: #28a745;
    font-weight: 600;
}

.incorrect-review {
    color: #dc3545;
    font-weight: 600;
}

/* --- Confetti --- */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1000;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 20px;
    background-color: red;
    opacity: 0.7;
    animation: fall 3s linear forwards;
}

@keyframes fall {
    0% {
        transform: translateY(-10vh) rotateZ(0deg);
        opacity: 0.7;
    }
    100% {
        transform: translateY(110vh) rotateZ(720deg);
        opacity: 0;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .quiz-container {
        padding: 1.5rem;
        width: 95%;
    }
    
    .quiz-container h1 {
        font-size: 1.8rem;
    }
    
    .question-text {
        font-size: 1.2em;
    }
}

@media (max-width: 480px) {
    .quiz-container {
        padding: 1rem;
    }
    
    .quiz-controls button {
        padding: 0.7rem 1.2rem;
        font-size: 0.9em;
    }
}