* {
    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;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #667eea;
}

header h1 {
    color: #667eea;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
}

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.5s;
}

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

/* Buttons */
.btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-back {
    background: #e0e0e0;
    color: #333;
    margin-top: 20px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 400px;
    margin: 0 auto;
}

.menu-buttons .btn {
    width: 100%;
    font-size: 1.3rem;
    padding: 20px;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    width: 0%;
}

/* Flashcards */
.card-counter {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: #666;
}

.flashcard-container {
    perspective: 1000px;
    margin: 40px 0;
}

.flashcard {
    width: 100%;
    height: 300px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: pointer;
}

.flashcard.flipped {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

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

.flashcard-back {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    transform: rotateY(180deg);
}

.flashcard-front p,
.flashcard-back p {
    font-size: 1.5rem;
    text-align: center;
    line-height: 1.6;
}

/* Quiz */
.score-display {
    text-align: center;
    font-size: 1.3rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 30px;
}

.question-container {
    margin: 30px 0;
}

#questionText {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.question-points {
    color: #667eea;
    font-weight: bold;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.answers {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.answer-option {
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.answer-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.answer-option.selected {
    border-color: #667eea;
    background: #f0f3ff;
    font-weight: 600;
}

.answer-option.correct {
    border-color: #4caf50;
    background: #e8f5e9;
}

.answer-option.incorrect {
    border-color: #f44336;
    background: #ffebee;
}

.answer-option.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Results */
.results-container {
    margin: 30px 0;
}

.score-summary {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
}

.final-score {
    font-size: 3rem;
    font-weight: bold;
    margin: 20px 0;
}

.grade {
    font-size: 1.5rem;
    margin-top: 10px;
}

.feedback-container {
    margin-bottom: 30px;
}

.feedback-container h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.question-feedback {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 10px;
    border-left: 4px solid;
}

.question-feedback.correct {
    background: #e8f5e9;
    border-color: #4caf50;
}

.question-feedback.incorrect {
    background: #ffebee;
    border-color: #f44336;
}

.question-feedback-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.question-feedback-text {
    color: #666;
    font-size: 0.95rem;
}

.ai-feedback {
    background: #f8f9ff;
    padding: 25px;
    border-radius: 15px;
    border: 2px solid #667eea;
}

.ai-feedback h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.ai-feedback-text {
    line-height: 1.8;
    color: #333;
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 2rem;
    }

    .flashcard {
        height: 250px;
    }

    .flashcard-front p,
    .flashcard-back p {
        font-size: 1.2rem;
    }

    #questionText {
        font-size: 1.2rem;
    }

    .final-score {
        font-size: 2rem;
    }
}
