/* ===========================
   RESET AND BASE STYLES
   =========================== */
* {
    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;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* ===========================
   CONTAINER
   =========================== */
.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 100%;
    padding: 40px;
    animation: fadeIn 0.5s ease-in;
}

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

/* ===========================
   HEADER
   =========================== */
h1 {
    color: #667eea;
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
    color: #667eea;
    text-align: center;
    font-size: 2em;
    margin-bottom: 20px;
}

/* ===========================
   LANGUAGE SELECTION
   =========================== */
.language-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.lang-btn {
    padding: 20px;
    border: 3px solid #667eea;
    background: white;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1em;
    font-weight: bold;
    color: #667eea;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.lang-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.lang-btn:active {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(102, 126, 234, 0.2);
}

/* ===========================
   QUIZ SECTION
   =========================== */
.quiz-section {
    display: none;
    animation: slideIn 0.4s ease-out;
}

.quiz-section.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===========================
   QUIZ HEADER
   =========================== */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.timer {
    font-size: 1.5em;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

.progress {
    font-size: 1.2em;
    font-weight: 500;
}

/* ===========================
   QUESTION CARD
   =========================== */
.question-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.question-text {
    font-size: 1.3em;
    margin-bottom: 20px;
    color: #333;
    font-weight: 600;
    line-height: 1.6;
}

/* ===========================
   OPTIONS
   =========================== */
.options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option {
    padding: 15px 20px;
    border: 2px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    font-size: 1.1em;
    position: relative;
    overflow: hidden;
}

.option::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: rgba(102, 126, 234, 0.1);
    transition: width 0.3s ease;
    z-index: 0;
}

.option:hover::before {
    width: 100%;
}

.option:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.2);
}

.option.selected {
    border-color: #667eea;
    background: #667eea;
    color: white;
    transform: translateX(5px);
}

.option.correct {
    border-color: #28a745;
    background: #28a745;
    color: white;
    animation: correctPulse 0.5s ease;
}

.option.incorrect {
    border-color: #dc3545;
    background: #dc3545;
    color: white;
    animation: shake 0.5s ease;
}

@keyframes correctPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

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

/* ===========================
   FEEDBACK
   =========================== */
.feedback {
    margin-top: 15px;
    padding: 15px;
    border-radius: 10px;
    display: none;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

.feedback.show {
    display: block;
}

.feedback.correct {
    background: #d4edda;
    color: #155724;
    border: 2px solid #28a745;
}

.feedback.incorrect {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #dc3545;
}

/* ===========================
   BUTTONS
   =========================== */
.btn-group {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(108, 117, 125, 0.3);
}

/* ===========================
   RESULTS SECTION
   =========================== */
.results {
    display: none;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.results.active {
    display: block;
}

.score-display {
    font-size: 4em;
    color: #667eea;
    margin: 30px 0;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    animation: scaleIn 0.6s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.score-message {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #333;
    font-weight: 500;
}

/* ===========================
   STATISTICS
   =========================== */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 2px solid #667eea;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.stat-value {
    font-size: 2em;
    color: #667eea;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    margin-top: 5px;
    font-size: 0.95em;
    font-weight: 500;
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */
@media (max-width: 768px) {
    .container {
        padding: 30px 20px;
    }

    h1 {
        font-size: 2em;
    }

    .quiz-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .timer {
        font-size: 1.3em;
    }

    .progress {
        font-size: 1.1em;
    }

    .question-text {
        font-size: 1.2em;
    }

    .option {
        font-size: 1em;
        padding: 12px 15px;
    }

    .btn {
        font-size: 1em;
        padding: 12px;
    }

    .score-display {
        font-size: 3em;
    }

    .score-message {
        font-size: 1.2em;
    }

    .stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 20px 15px;
    }

    h1 {
        font-size: 1.8em;
        margin-bottom: 20px;
    }

    .language-selection {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .lang-btn {
        padding: 15px;
        font-size: 1em;
    }

    .question-text {
        font-size: 1.1em;
    }

    .score-display {
        font-size: 2.5em;
    }

    .stat-value {
        font-size: 1.8em;
    }
}

/* ===========================
   ACCESSIBILITY
   =========================== */
.btn:focus,
.lang-btn:focus,
.option:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* ===========================
   UTILITY CLASSES
   =========================== */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}