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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    min-height: 100vh;
    background-color: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    text-align: center;
}

header h1 {
    font-size: 24px;
    margin-bottom: 10px;
}

.progress-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 14px;
}

main {
    padding: 20px;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

.menu-buttons {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.menu-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 15px 20px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.menu-btn:hover {
    background-color: #2980b9;
}

.category-filter {
    margin-top: 30px;
}

.category-filter h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

#category-list {
    display: grid;
    gap: 10px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background-color: #ecf0f1;
    border-radius: 5px;
}

.category-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.quiz-info {
    display: flex;
    gap: 20px;
}

.question-type {
    background-color: #e74c3c;
    color: white;
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 14px;
}

.question-type.single {
    background-color: #3498db;
}

.question-type.multiple {
    background-color: #e74c3c;
}

.question-type.fill {
    background-color: #27ae60;
}

.back-btn {
    background-color: #95a5a6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.back-btn:hover {
    background-color: #7f8c8d;
}

.question-container {
    background-color: #ecf0f1;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

#question-text {
    font-size: 18px;
    margin-bottom: 20px;
    line-height: 1.8;
}

.options {
    display: grid;
    gap: 10px;
}

.option {
    background-color: white;
    padding: 15px;
    border: 2px solid #bdc3c7;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.option:hover {
    background-color: #f8f9fa;
    border-color: #3498db;
}

.option.selected {
    background-color: #e3f2fd;
    border-color: #3498db;
}

.option.correct {
    background-color: #d4edda;
    border-color: #27ae60;
}

.option.incorrect {
    background-color: #f8d7da;
    border-color: #e74c3c;
}

.option input[type="checkbox"],
.option input[type="radio"] {
    width: 18px;
    height: 18px;
}

.fill-blank-container {
    margin-top: 20px;
}

#fill-blank-input {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    border: 2px solid #bdc3c7;
    border-radius: 5px;
}

.quiz-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.submit-btn, .next-btn {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.submit-btn:hover, .next-btn:hover {
    background-color: #229954;
}

.submit-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.result-container {
    margin-top: 20px;
    padding: 20px;
    border-radius: 10px;
}

#result-message {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
}

#result-message.correct {
    color: #27ae60;
}

#result-message.incorrect {
    color: #e74c3c;
}

#explanation {
    margin-top: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    line-height: 1.8;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#history-content {
    display: grid;
    gap: 15px;
}

.history-item {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #3498db;
}

.history-date {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.history-stats {
    display: flex;
    gap: 20px;
    font-size: 16px;
}

#final-result {
    background-color: #ecf0f1;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
}

#final-result h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #2c3e50;
}

.result-stats {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}

.stat-item {
    background-color: white;
    padding: 15px;
    border-radius: 5px;
}

@media (max-width: 768px) {
    .container {
        box-shadow: none;
    }

    header h1 {
        font-size: 20px;
    }

    .progress-info {
        font-size: 12px;
        gap: 15px;
    }

    #question-text {
        font-size: 16px;
    }

    .option {
        padding: 12px;
        font-size: 14px;
    }

    .quiz-info {
        flex-direction: column;
        gap: 5px;
    }

    .quiz-header {
        flex-direction: column;
        gap: 10px;
    }

    .back-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    main {
        padding: 15px;
    }

    .menu-btn {
        font-size: 14px;
        padding: 12px 15px;
    }

    .question-container {
        padding: 15px;
    }

    .submit-btn, .next-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}