/* Language Quiz App - CSS */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --bg: #f9fafb;
    --white: #ffffff;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    background: var(--white);
    margin-bottom: 40px;
}

.logo h1 {
    font-size: 24px;
    color: var(--primary);
}

.nav {
    display: flex;
    gap: 15px;
    align-items: center;
}

.user-greeting {
    color: var(--text-light);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

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

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-large {
    padding: 15px 30px;
    font-size: 16px;
}

/* Hero */
.hero {
    text-align: center;
    padding: 60px 20px;
}

.hero h2 {
    font-size: 42px;
    margin-bottom: 15px;
}

.subtitle {
    font-size: 18px;
    color: var(--text-light);
}

/* Upload Section */
.upload-section {
    max-width: 900px;
    margin: 0 auto 60px;
}

.upload-card {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
}

.upload-card h3 {
    margin-bottom: 10px;
}

.upload-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.upload-method {
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s;
}

.upload-method:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.method-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.upload-method h4 {
    margin-bottom: 10px;
}

.upload-method p {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 20px;
}

/* Forms */
.input-form {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.input-form h3 {
    margin-bottom: 10px;
}

.info-text {
    background: #e0f2fe;
    border-left: 4px solid #0284c7;
    padding: 12px 15px;
    margin: 15px 0;
    border-radius: 4px;
    color: #075985;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}

.form-group textarea {
    font-family: 'Courier New', monospace;
    resize: vertical;
}

.form-group small {
    color: var(--text-light);
    font-size: 12px;
}

.hidden {
    display: none !important;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Features */
.features {
    padding: 60px 20px;
    background: var(--white);
    border-radius: 12px;
    margin-bottom: 60px;
}

.features h3 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 40px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature {
    text-align: center;
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.feature h4 {
    margin-bottom: 10px;
}

.feature p {
    color: var(--text-light);
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-light);
    font-size: 14px;
}

/* Quiz */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

.quiz-header {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.quiz-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
}

.quiz-question {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
}

.question-word {
    font-size: 36px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary);
}

.answer-input {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    border: 2px solid var(--border);
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
}

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

/* Results */
.results-container {
    max-width: 800px;
    margin: 0 auto;
}

.results-card {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.score-display {
    font-size: 72px;
    font-weight: bold;
    color: var(--primary);
    margin: 30px 0;
}

.score-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.score-item {
    padding: 20px;
    border-radius: 8px;
    background: var(--bg);
}

.score-item-value {
    font-size: 32px;
    font-weight: bold;
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 20px;
    }
    
    .hero h2 {
        font-size: 32px;
    }
    
    .upload-methods {
        grid-template-columns: 1fr;
    }
    
    .score-details {
        grid-template-columns: 1fr;
    }
    
    .quiz-question {
        padding: 20px;
    }
    
    .question-word {
        font-size: 28px;
    }
}

/* Additional Quiz Styles */
.quiz-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: var(--primary);
}

.question-number {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.answer-section {
    margin: 30px 0;
}

.feedback {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
}

.feedback-correct {
    background: #d1fae5;
    color: #065f46;
    border: 2px solid #10b981;
}

.feedback-incorrect {
    background: #fee2e2;
    color: #991b1b;
    border: 2px solid #ef4444;
}

.input-correct {
    border-color: var(--secondary) !important;
    background: #f0fdf4;
}

.input-incorrect {
    border-color: var(--danger) !important;
    background: #fef2f2;
}

/* Results Breakdown */
.score-breakdown {
    margin-top: 40px;
    text-align: left;
}

.score-breakdown h3 {
    margin-bottom: 20px;
    text-align: center;
}

.answer-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
}

.answer-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    background: var(--bg);
}

.answer-item.correct {
    border-left: 4px solid var(--secondary);
}

.answer-item.incorrect {
    border-left: 4px solid var(--danger);
}

.answer-number {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-light);
    min-width: 30px;
}

.answer-content {
    flex: 1;
}

.answer-question {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
}

.answer-user {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 5px;
}

.answer-correct {
    font-size: 14px;
    color: var(--secondary);
    margin-bottom: 5px;
}

.answer-score {
    font-size: 12px;
    color: var(--text-light);
}

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

.score-item-label {
    display: block;
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 5px;
}

.score-item-sublabel {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 5px;
}

.quiz-info {
    color: var(--text-light);
    margin-bottom: 20px;
}

/* Alert messages */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #3b82f6;
}
