* {
    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;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header p {
    opacity: 0.9;
    font-size: 1.1em;
}

.mode-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 30px;
    background: #f8f9fa;
}

.mode-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-card:hover {
    transform: translateY(-5px);
    border-color: #667eea;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.mode-card h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.mode-card p {
    color: #666;
    font-size: 0.95em;
}

.quiz-container, .flashcard-container, .test-container {
    padding: 40px;
    display: none;
}

.active {
    display: block;
}

.question-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
}

.question-text {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 20px;
    font-weight: 500;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
}

.option:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.option.correct {
    background: #d4edda;
    border-color: #28a745;
}

.option.wrong {
    background: #f8d7da;
    border-color: #dc3545;
}

.flashcard {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    padding: 60px 40px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    position: relative;
}

.flashcard.flipped {
    transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
    backface-visibility: hidden;
    position: absolute;
    width: 100%;
    font-size: 1.4em;
    line-height: 1.6;
}

.flashcard-back {
    transform: rotateY(180deg);
}

.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: #6c757d;
}

.progress {
    background: #e0e0e0;
    height: 8px;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    transition: width 0.3s ease;
}

.score-display {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 15px;
    margin-top: 20px;
}

.score-display h2 {
    color: #333;
    font-size: 2em;
    margin-bottom: 15px;
}

.score-display p {
    font-size: 1.2em;
    color: #666;
}

.back-btn {
    background: #6c757d;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8em;
    }
    
    .mode-selector {
        grid-template-columns: 1fr;
    }
    
    .quiz-container, .flashcard-container, .test-container {
        padding: 20px;
    }
}