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

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

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
}

header h1 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 2.2em;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e0e6ed;
    border-radius: 4px;
    margin-bottom: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 10%;
}

.quiz-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #666;
    font-weight: 500;
}

.quiz-container, .results-container, .review-container, .quiz-selection {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.selection-card {
    text-align: center;
}

.selection-card h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 2.2em;
}

.selection-subtitle {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 30px;
}

.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.quiz-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e3f2fd 100%);
    border: 2px solid #e0e6ed;
    border-radius: 15px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.quiz-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: #2196F3;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.quiz-number {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

.quiz-title {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3em;
    font-weight: 600;
    line-height: 1.3;
    padding-right: 60px;
}

.quiz-description {
    color: #666;
    margin-bottom: 15px;
    font-weight: 500;
}

.quiz-topics {
    color: #555;
    font-size: 0.9em;
    line-height: 1.4;
    background: rgba(255, 255, 255, 0.7);
    padding: 10px;
    border-radius: 8px;
    border-left: 4px solid #2196F3;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e6ed;
}

.quiz-header h3 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.2em;
}

.btn-back {
    background-color: #6c757d;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

.question-card h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    line-height: 1.4;
    font-size: 1.3em;
}

.options-container {
    margin-bottom: 20px;
}

.option {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 12px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option:hover {
    background: #e3f2fd;
    border-color: #2196F3;
    transform: translateY(-2px);
}

.option input[type="radio"],
.option input[type="checkbox"] {
    margin-right: 12px;
    transform: scale(1.2);
    cursor: pointer;
}

.option label {
    cursor: pointer;
    flex: 1;
    font-weight: 500;
    color: #444;
}

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

.option.wrong-answer {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.multi-select-note {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

.explanation {
    margin-top: 25px;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #17a2b8;
}

.explanation.correct {
    background: #d4edda;
    border-left-color: #28a745;
}

.explanation.incorrect {
    background: #f8d7da;
    border-left-color: #dc3545;
}

.explanation h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    gap: 15px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

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

.results-card {
    text-align: center;
}

.results-card h2 {
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.5em;
}

.final-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.final-score span:first-child {
    font-size: 3em;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
}

.final-score span:last-child {
    font-size: 1.5em;
    color: #666;
    font-weight: 600;
}

.score-breakdown {
    margin-bottom: 30px;
}

.score-breakdown h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.performance-indicator {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.performance-indicator.excellent {
    background: #d4edda;
    color: #155724;
    border: 2px solid #28a745;
}

.performance-indicator.good {
    background: #cce5ff;
    color: #004085;
    border: 2px solid #007bff;
}

.performance-indicator.fair {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffc107;
}

.performance-indicator.needs-improvement {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #dc3545;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.stat-label {
    font-weight: 600;
    color: #666;
}

.stat-value {
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.1em;
}

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

.review-question {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
    background: #fff;
}

.review-question.correct {
    border-color: #28a745;
    background: #f8fff9;
}

.review-question.incorrect {
    border-color: #dc3545;
    background: #fffafa;
}

.review-question h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.question-text {
    margin-bottom: 15px;
    line-height: 1.5;
    color: #444;
}

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

.review-option {
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 5px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.review-option.correct-answer {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
    font-weight: 600;
}

.review-option.wrong-answer {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
    font-weight: 600;
}

.review-explanation {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #2196F3;
    line-height: 1.5;
}

footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    padding: 20px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.8em;
    }
    
    .quiz-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .quiz-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .quiz-card {
        padding: 20px;
    }
    
    .quiz-title {
        font-size: 1.1em;
        padding-right: 50px;
    }
    
    .quiz-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        max-width: 250px;
    }
    
    .results-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .final-score span:first-child {
        font-size: 2.5em;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
}