.quiz-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 60px;
    font-family: 'Roboto', sans-serif; /* Stylish Google Font - add @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap'); to your theme or enqueue */
    border: 2px solid #007bff; /* Bold, modern blue border */
    border-radius: 20px; /* Smooth rounded corners */
    background: #ffffff; /* Clean white background */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); /* Soft shadow for depth */
    transition: box-shadow 0.3s ease, border-color 0.3s ease; /* Smooth hover and color transitions */
    position: relative;
    min-height: 450px; /* Increased for consistent spacing */
    overflow: hidden; /* Prevent content overflow */
}

.quiz-container:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15); /* Enhanced shadow on hover */
}

.quiz-container.completed {
    min-height: 450px; /* Consistent height for results screen */
}

.quiz-container.perfect-score {
    border-color: #28a745; /* Green border for 100% score */
}

.quiz-title { 
    font-size: 32px;
    font-weight: bold; 
    text-align: center; 
    margin-bottom: 30px;
    color: #333;
    font-family: 'Playfair Display', serif; /* Add @import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&display=swap'); */
}

.quiz-progress {
    font-size: 14px;
    color: #666;
    text-align: center;
    margin-bottom: 10px;
    padding-top: 10px; /* Added padding to separate from top */
}

.quiz-questions {
    padding-top: 20px; /* Extra padding to prevent overlap with progress bar */
}

.quiz-question { 
    font-size: 24px; 
    font-weight: bold; 
    margin-top: 40px; /* Increased to avoid smooshing */
    margin-bottom: 30px;
    color: #222;
    padding: 0 20px;
    background: transparent;
}

.quiz-options {
    margin-top: 20px;
    padding: 0 20px;
}

.quiz-option {
    background: #f0f8ff;
    border: 1px solid #d0e0ff;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    cursor: pointer;
    transition: background 0.3s, box-shadow 0.3s;
    position: relative;
}

.quiz-option:hover {
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.quiz-option.selected {
    background: #a0c0ff;
    border-color: #007bff;
}

.quiz-option.correct {
    background: #e0ffe0;
    border-color: #00cc00;
}

.quiz-option.correct::before {
    content: '✔ ';
    color: #00cc00;
}

.quiz-option.incorrect {
    background: #ffe0e0;
    border-color: #cc0000;
}

.quiz-option.incorrect::before {
    content: '✘ ';
    color: #cc0000;
}

.quiz-option .option-feedback {
    display: none; /* Hide per-option feedback to prevent duplication */
}

.quiz-explanation {
    color: #008800;
    font-size: 14px;
    margin-top: 10px;
    padding: 0 20px;
}

.quiz-feedback {
    font-size: 18px;
    margin-top: 10px;
    padding: 0 20px;
}

.quiz-next {
    background: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    margin: 20px auto 20px; /* Centered with bottom margin */
    display: block;
    cursor: pointer;
    transition: background 0.3s;
}

.quiz-next:hover {
    background: #0056b3;
}

.quiz-question-wrapper {
    position: relative; /* Changed from absolute to prevent overlap */
    width: 100%;
    opacity: 0;
    transform: translateY(20px); /* Subtle vertical transition */
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.quiz-question-wrapper.slide-out {
    opacity: 0;
    transform: translateY(-20px);
}

.quiz-question-wrapper.slide-in {
    opacity: 1;
    transform: translateY(0);
}

.matching-pair {
    margin: 10px 0;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.matching-pair span {
    display: inline-block;
    width: 200px;
}

.matching-pair select.correct {
    border-color: #00cc00;
    background: #e0ffe0;
}

.matching-pair select.incorrect {
    border-color: #cc0000;
    background: #ffe0e0;
}

.quiz-results {
    text-align: center;
    padding: 20px;
}

.quiz-results h1 {
    font-size: 48px;
}

.quiz-results .score {
    font-size: 36px;
}

.quiz-results .passed {
    background: #e0ffe0;
    color: #008800;
    padding: 10px 20px;
    border-radius: 20px;
    display: inline-block;
}

.quiz-results .failed {
    background: #ffe0e0;
    color: #cc0000;
    padding: 10px 20px;
    border-radius: 20px;
    display: inline-block;
}

.quiz-results button {
    background: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    margin: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.quiz-results button:hover {
    background: #0056b3;
}

.quiz-review {
    margin-top: 20px;
}

.quiz-review ul {
    list-style: none;
}

.quiz-review li .correct {
    color: #00cc00;
}

.quiz-review li .incorrect {
    color: #cc0000;
}

.quiz-retake {
    background: #ffcc00;
    color: black;
    margin-top: 10px;
}

/* Loading */
.quiz-next.loading, .quiz-certificate.loading {
    background: #ccc;
    cursor: not-allowed;
}

/* Progress Bar */
.quiz-progress-bar {
    background: #e0e0e0;
    height: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.quiz-progress-fill {
    background: #007bff;
    height: 100%;
    width: 0;
    border-radius: 5px;
    transition: width 0.3s ease;
}

/* Quiz Progress Text */
.quiz-progress-text {
    text-align: center;
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
}