/* General Resets and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

/* Screen Styles */
.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.screen.active {
    display: flex;
}

/* Start Screen */
#start-screen h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
    text-align: center;
}

#start-screen h2 {
    font-size: 1.8rem;
    color: #3498db;
    margin-bottom: 30px;
    text-align: center;
}

#start-screen p {
    font-size: 1.2rem;
    margin-bottom: 20px;
    text-align: center;
}

.subtopics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    width: 100%;
    margin-bottom: 20px;
}

.subtopic-btn {
    padding: 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s, transform 0.2s;
    text-align: center;
}

.subtopic-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.subtopic-btn.all-topics {
    grid-column: 1 / -1;
    background-color: #2c3e50;
}

.subtopic-btn.all-topics:hover {
    background-color: #1a252f;
}

/* Quiz Screen */
.quiz-header {
    width: 100%;
    margin-bottom: 20px;
}

.quiz-header h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
}

.progress-container {
    width: 100%;
    height: 10px;
    background-color: #ecf0f1;
    border-radius: 5px;
    margin-bottom: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #3498db;
    width: 10%;
    transition: width 0.3s ease;
}

.quiz-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: #7f8c8d;
}

#question-container {
    width: 100%;
    margin-bottom: 20px;
}

#question-text {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #2c3e50;
}

.btn-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.answer-btn {
    padding: 15px;
    background-color: #ecf0f1;
    border: 2px solid #bdc3c7;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
    text-align: left;
}

.answer-btn:hover:not([disabled]) {
    background-color: #d5dbdb;
}

.answer-btn.correct {
    background-color: #2ecc71;
    color: white;
    border-color: #27ae60;
}

.answer-btn.incorrect {
    background-color: #e74c3c;
    color: white;
    border-color: #c0392b;
}

.quiz-footer {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.control-btn {
    padding: 12px 25px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

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

.control-btn.secondary {
    background-color: #95a5a6;
}

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

#next-btn {
    display: none;
}

/* Results Screen */
#results-screen h2 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
}

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

.result-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background-color: #3498db;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    color: white;
}

.result-score {
    font-size: 3rem;
    font-weight: bold;
}

.result-label {
    font-size: 1.2rem;
}

.result-message {
    font-size: 1.3rem;
    text-align: center;
    color: #2c3e50;
}

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

.control-btn.share {
    background-color: #2ecc71;
}

.control-btn.share:hover {
    background-color: #27ae60;
}

/* Responsive Adjustments */
@media (max-width: 600px) {
    .container {
        padding: 15px;
        border-radius: 0;
        box-shadow: none;
    }
    
    #start-screen h1 {
        font-size: 2rem;
    }
    
    #start-screen h2 {
        font-size: 1.5rem;
    }
    
    .subtopics-grid {
        grid-template-columns: 1fr;
    }
    
    .quiz-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .control-btn {
        width: 100%;
    }
    
    .results-actions {
        flex-direction: column;
    }
}
