* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Navigation Bar Styles */
.site-navigation {
    background: #fff;
    border-bottom: 2px solid #e9ecef;
    padding: 0.8rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 2rem;
}

.nav-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #005fa3;
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-btn:hover {
    background: #004080;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 95, 163, 0.3);
}

/* Base Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.quiz-container {
    max-width: 900px;
    margin: 20px auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    min-height: 600px;
}

/* Screen Management */
.screen {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Start Screen */
.quiz-header {
    margin-bottom: 40px;
}

.quiz-header h1 {
    color: #dc3545;
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.quiz-header p {
    color: #dc3545;
    font-size: 1.2rem;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Header with Home Icon Layout */
.header-with-home {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    gap: 1rem;
}

.home-icon {
    font-size: 2rem;
    padding: 0.7rem 1.3rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: inline-block;
    background: rgba(0, 95, 163, 0.1);
    color: #005fa3;
    text-decoration: none;
    border: 2px solid rgba(0, 95, 163, 0.2);
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.home-icon:hover {
    background: rgba(0, 95, 163, 0.2);
    transform: translateY(-50%) scale(1.1);
    border-color: rgba(0, 95, 163, 0.4);
}

.header-content {
    text-align: center;
    flex: 1;
}

.quiz-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.info-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    border-left: 5px solid #005fa3;
}

.info-card h3 {
    color: #005fa3;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.info-card ul {
    list-style: none;
    padding: 0;
}

.info-card li {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.info-card li:last-child {
    border-bottom: none;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(45deg, #005fa3, #007bff);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 95, 163, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

.btn.large {
    font-size: 1.2rem;
    padding: 15px 40px;
    display: block;
    margin: 0 auto;
    max-width: 300px;
}

/* Quiz Progress */
.quiz-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
}

.progress-bar {
    flex: 1;
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    margin-right: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #005fa3, #007bff);
    border-radius: 5px;
    transition: width 0.3s ease;
    width: 10%;
}

#questionCounter {
    font-weight: 600;
    color: #005fa3;
    white-space: nowrap;
}

/* Quiz Text-to-Speech Controls */
.quiz-tts-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 0 auto 20px auto;
    padding: 12px 20px;
    background: #e3f2fd;
    border-radius: 12px;
    border: 1px solid #bbdefb;
    flex-wrap: wrap;
    max-width: 600px;
    width: fit-content;
}

.quiz-tts-controls .tts-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #1565c0;
}

.quiz-tts-controls .tts-group label {
    font-weight: 500;
    cursor: pointer;
}

.quiz-tts-controls input[type="checkbox"] {
    transform: scale(1.1);
    cursor: pointer;
}

.quiz-tts-controls .tts-select {
    padding: 4px 8px;
    border: 1px solid #90caf9;
    border-radius: 4px;
    background: white;
    font-size: 0.85rem;
    cursor: pointer;
}

.quiz-tts-controls .tts-range {
    width: 70px;
    cursor: pointer;
}

.quiz-tts-controls #quizSpeedValue {
    font-weight: 600;
    color: #1565c0;
    min-width: 25px;
    text-align: center;
    font-size: 0.8rem;
}

/* Question Header with Speaker Button */
.question-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.quiz-speak-btn {
    background: #2196f3;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quiz-speak-btn:hover {
    background: #1976d2;
    transform: scale(1.1);
}

.quiz-speak-btn:active {
    transform: scale(0.95);
}

.quiz-speak-btn:disabled {
    background: #90caf9;
    cursor: not-allowed;
    transform: none;
}

/* Question Container */
.question-container {
    text-align: center;
}

.question-number {
    color: #005fa3;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.question-text {
    color: #333;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 30px;
    line-height: 1.5;
}

/* Answer Options */
.answer-options {
    display: grid;
    gap: 15px;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.answer-option-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.answer-option {
    width: 100%;
    padding: 15px 20px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 1rem;
    position: relative;
}

.answer-option:hover {
    background: #e3f2fd;
    border-color: #005fa3;
    transform: translateY(-2px);
}

.answer-option.selected {
    background: #005fa3;
    color: white;
    border-color: #005fa3;
    box-shadow: 0 4px 12px rgba(0, 95, 163, 0.3);
    transform: translateY(-2px);
}

.answer-option.correct {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.answer-option.incorrect {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.answer-option::before {
    content: "★ " attr(data-letter);
    display: inline-block;
    width: auto;
    height: auto;
    background: none;
    color: #005fa3;
    border-radius: 0;
    text-align: left;
    line-height: normal;
    font-weight: 600;
    margin-right: 10px;
    font-size: 1.1rem;
}

.answer-option.selected::before,
.answer-option.correct::before,
.answer-option.incorrect::before {
    color: white;
}

/* Answer Speaker Buttons */
.answer-speak-btn {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    width: auto;
    height: 35px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    align-self: flex-start;
    margin-left: 10px;
}

.answer-speak-btn:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

/* Quiz Controls */

.answer-speak-btn:active {
    transform: scale(0.95);
}

.answer-speak-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Quiz Controls */
.quiz-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Results Screen */
.results-container {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.result-title {
    color: #005fa3;
    font-size: 2rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.score-display {
    font-size: 3rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.percentage-score {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 20px;
}

.result-message {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Results Screen Home Icon */
.results-header-with-home {
    position: relative;
    padding: 20px 0 10px 0;
}

.results-home-icon {
    font-size: 1.8rem;
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: inline-block;
    background: rgba(0, 95, 163, 0.1);
    color: #005fa3;
    text-decoration: none;
    border: 2px solid rgba(0, 95, 163, 0.2);
    position: absolute;
    left: 0;
    top: 20px;
}

.results-home-icon:hover {
    background: rgba(0, 95, 163, 0.2);
    transform: scale(1.1);
    border-color: rgba(0, 95, 163, 0.4);
}

/* Review Screen */
.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.review-header h2 {
    color: #005fa3;
    font-size: 1.8rem;
}

.review-item {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    border-left: 5px solid #e9ecef;
}

.review-item.correct {
    border-left-color: #28a745;
}

.review-item.incorrect {
    border-left-color: #dc3545;
}

.review-question {
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.review-answers {
    margin-bottom: 15px;
}

.review-answer {
    padding: 8px 15px;
    margin: 5px 0;
    border-radius: 8px;
    font-size: 0.95rem;
}

.review-answer.user-answer {
    background: #e3f2fd;
    border-left: 3px solid #005fa3;
}

.review-answer.correct-answer {
    background: #d4edda;
    border-left: 3px solid #28a745;
}

.review-answer.incorrect-user {
    background: #f8d7da;
    border-left: 3px solid #dc3545;
}

.review-status {
    font-weight: 600;
    font-size: 0.9rem;
}

.review-status.correct {
    color: #28a745;
}

.review-status.incorrect {
    color: #dc3545;
}

/* Review Header Actions */

/* Two-Answer Question Styles */
.two-answer-instruction {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 10px 0;
    color: #856404;
    font-weight: bold;
    text-align: center;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .quiz-container {
        margin: 10px;
        padding: 20px;
    }
    
    .quiz-info {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .quiz-header h1 {
        font-size: 2rem;
    }
    
    /* Mobile header layout adjustments */
    .header-with-home {
        flex-direction: column !important;
        position: static !important;
        gap: 3rem !important;
    }
    
    .home-icon {
        position: static;
        transform: none;
        align-self: center;
    }
    
    .home-icon:hover {
        transform: scale(1.1);
    }
    
    .header-content {
        order: -1;
    }
    
    .quiz-tts-controls {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: 15px;
    }
    
    .quiz-tts-controls .tts-group {
        justify-content: center;
    }
    
    .question-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .answer-option-container {
        flex-direction: column;
        gap: 6px;
        margin-bottom: 12px;
    }
    
    .answer-speak-btn {
        width: auto;
        height: 30px;
        font-size: 0.8rem;
        padding: 6px 10px;
        align-self: flex-start;
        margin-left: 5px;
    }
    
    .question-text {
        font-size: 1.2rem;
    }
    
    .quiz-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .result-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .review-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    /* Mobile results home icon adjustments */
    .results-header-with-home {
        text-align: center;
        padding: 10px 0;
    }
    
    .results-home-icon {
        position: static;
        transform: none;
        margin-bottom: 10px;
    }
    
    .results-home-icon:hover {
        transform: scale(1.1);
    }
}

@media (max-width: 480px) {
    .nav-links {
        justify-content: center;
    }
    
    .nav-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .quiz-progress {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .progress-bar {
        margin-right: 0;
        margin-bottom: 10px;
    }
}
