/* Dutch NT2 Practice - Styles */

:root {
    /* Dutch flag colors */
    --red: #AE1C28;
    --white: #FFFFFF;
    --blue: #21468B;
    
    /* UI colors */
    --primary: #21468B;
    --secondary: #AE1C28;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --light: #f8f9fa;
    --dark: #343a40;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: var(--dark);
}

.app {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

/* Header */
.header {
    text-align: center;
    padding: var(--spacing-xl) 0;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-lg);
}

.header h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: var(--spacing-xs);
}

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

/* Navigation */
.nav {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
    justify-content: center;
}

.nav-btn {
    padding: var(--spacing-md) var(--spacing-lg);
    border: 2px solid var(--primary);
    background: white;
    color: var(--primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.nav-btn.active {
    background: var(--primary);
    color: white;
}

/* Main Content */
.main {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-xl);
    min-height: 500px;
}

/* Module */
.module {
    display: none;
}

.module.active {
    display: block;
}

.module-header {
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--light);
}

.module-header h2 {
    color: var(--primary);
    margin-bottom: var(--spacing-md);
}

.module-controls {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.module-controls select {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--light);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    cursor: pointer;
}

/* Practice Area */
.practice-area {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.placeholder {
    text-align: center;
    padding: var(--spacing-xl);
}

.placeholder p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: var(--spacing-lg);
}

/* Buttons */
.btn {
    padding: var(--spacing-md) var(--spacing-xl);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #1a3a70;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--light);
    color: var(--dark);
}

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

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

/* Flashcard */
.flashcard {
    width: 100%;
    max-width: 500px;
    height: 300px;
    perspective: 1000px;
    cursor: pointer;
    margin-bottom: var(--spacing-lg);
}

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

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

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-xl);
}

.flashcard-front {
    background: linear-gradient(135deg, var(--primary) 0%, #1a3a70 100%);
    color: white;
}

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

.flashcard-word {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.flashcard-translation {
    font-size: 1.5rem;
    opacity: 0.9;
}

.flashcard-example {
    font-size: 1rem;
    opacity: 0.8;
    margin-top: var(--spacing-md);
    font-style: italic;
}

/* Quiz */
.quiz-container {
    width: 100%;
    max-width: 600px;
}

.quiz-question {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.quiz-option {
    padding: var(--spacing-md) var(--spacing-lg);
    border: 2px solid var(--light);
    border-radius: var(--radius-md);
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.quiz-option:hover {
    border-color: var(--primary);
    background: var(--light);
}

.quiz-option.correct {
    border-color: var(--success);
    background: #d4edda;
}

.quiz-option.incorrect {
    border-color: var(--danger);
    background: #f8d7da;
}

.quiz-feedback {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 600;
}

.quiz-feedback.correct {
    background: #d4edda;
    color: var(--success);
}

.quiz-feedback.incorrect {
    background: #f8d7da;
    color: var(--danger);
}

/* Progress */
.progress-area {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
}

.stats-card {
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    background: var(--light);
    box-shadow: var(--shadow-sm);
}

.stats-card h3 {
    color: var(--primary);
    margin-bottom: var(--spacing-md);
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e2e6ea;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), var(--primary));
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: #666;
}

/* Test Config */
.test-config {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    align-items: center;
}

.test-config label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.test-config input[type="number"] {
    width: 80px;
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 2px solid var(--light);
    border-radius: var(--radius-sm);
}

.test-config input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

/* Footer */
.footer {
    text-align: center;
    padding: var(--spacing-lg) 0;
    color: #666;
    font-size: 0.9rem;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .app {
        padding: var(--spacing-md);
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .nav {
        flex-direction: column;
    }
    
    .nav-btn {
        width: 100%;
    }
    
    .module-controls {
        flex-direction: column;
    }
    
    .module-controls select {
        width: 100%;
    }
    
    .flashcard-word {
        font-size: 2rem;
    }
    
    .flashcard-translation {
        font-size: 1.2rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.module.active {
    animation: fadeIn 0.3s ease;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

.mt-md {
    margin-top: var(--spacing-md);
}

.mb-md {
    margin-bottom: var(--spacing-md);
}

/* Vocabulary Manager */
.vocab-manager {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.vocab-manager h3 {
    color: var(--primary);
    margin-bottom: var(--spacing-lg);
}

.manager-tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    border-bottom: 2px solid var(--light);
    padding-bottom: var(--spacing-md);
}

.tab-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--light);
    border-radius: var(--radius-sm);
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.vocab-list-controls {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.vocab-list-controls select,
.vocab-list-controls input {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--light);
    border-radius: var(--radius-sm);
    font-size: 1rem;
}

.vocab-list {
    max-height: 400px;
    overflow-y: auto;
}

.vocab-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--light);
}

.vocab-item:hover {
    background: var(--light);
}

.vocab-info {
    flex: 1;
}

.vocab-actions {
    margin-left: var(--spacing-md);
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.9rem;
}

textarea {
    width: 100%;
    min-height: 200px;
    padding: var(--spacing-md);
    border: 2px solid var(--light);
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.9rem;
    resize: vertical;
}

.flashcard-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 500px;
    margin-top: var(--spacing-lg);
}

.progress-indicator {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
}

/* Grammar Game */
.grammar-game {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.game-header {
    display: flex;
    justify-content: space-around;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, var(--primary) 0%, #1a3a70 100%);
    border-radius: var(--radius-lg);
    color: white;
}

.game-stat {
    text-align: center;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: var(--spacing-xs);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.game-question-area {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.game-question-card {
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
}

.question-topic {
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: var(--spacing-md);
    font-weight: 600;
}

.question-text {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.game-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.game-option {
    padding: var(--spacing-md) var(--spacing-lg);
    border: 3px solid var(--light);
    border-radius: var(--radius-md);
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-weight: 600;
}

.game-option:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.game-option.correct {
    border-color: var(--success);
    background: #d4edda;
    animation: pulse 0.5s ease;
}

.game-option.incorrect {
    border-color: var(--danger);
    background: #f8d7da;
    animation: shake 0.5s ease;
}

.game-timer {
    width: 100%;
    max-width: 600px;
    margin-top: var(--spacing-lg);
}

.timer-bar {
    height: 10px;
    background: var(--success);
    border-radius: var(--radius-sm);
    transition: width 0.1s linear;
}

.game-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: var(--spacing-lg) var(--spacing-xl);
    border-radius: var(--radius-lg);
    font-size: 1.5rem;
    font-weight: 700;
    z-index: 1000;
    animation: fadeInOut 1.5s ease;
}

.game-feedback.correct {
    background: #d4edda;
    color: var(--success);
}

.game-feedback.incorrect {
    background: #f8d7da;
    color: var(--danger);
}

.game-controls {
    margin-top: var(--spacing-lg);
    text-align: center;
}

.game-over {
    text-align: center;
    padding: var(--spacing-xl);
}

.game-over h2 {
    color: var(--primary);
    margin-bottom: var(--spacing-lg);
}

.final-score {
    margin-bottom: var(--spacing-xl);
}

.final-score p {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-md);
}

.final-score strong {
    color: var(--primary);
    font-size: 1.5rem;
}

.game-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
}

/* Animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}