* {
    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;
    color: #333;
}

.container {
    max-width: 1200px;
    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;
    font-weight: 700;
}

/* Mode Selection */
.mode-selection {
    padding: 50px;
    text-align: center;
}

.mode-selection h2 {
    font-size: 2em;
    margin-bottom: 40px;
    color: #333;
}

.mode-buttons {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.mode-btn {
    background: white;
    border: 3px solid #667eea;
    border-radius: 15px;
    padding: 40px;
    width: 300px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.mode-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    background: #f8f9ff;
}

.mode-btn .icon {
    font-size: 3em;
    color: #667eea;
}

.mode-btn .title {
    font-size: 1.5em;
    font-weight: 700;
    color: #333;
}

.mode-btn .desc {
    font-size: 1em;
    color: #666;
}

/* Config Screen */
.config-screen {
    padding: 50px;
    text-align: center;
}

.config-screen h2 {
    font-size: 2em;
    margin-bottom: 30px;
    color: #333;
}

.config-form {
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.config-form label {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    text-align: left;
}

.config-form input {
    padding: 15px;
    font-size: 1.1em;
    border: 2px solid #ddd;
    border-radius: 10px;
    transition: border-color 0.3s;
}

.config-form input:focus {
    outline: none;
    border-color: #667eea;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 15px 30px;
    font-size: 1.1em;
    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-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

/* Quiz Screen */
.quiz-screen {
    padding: 30px;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.quiz-header h2 {
    font-size: 1.8em;
    color: #333;
}

.progress-info {
    font-size: 1.2em;
    font-weight: 600;
    color: #667eea;
}

.questions-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 30px;
}

.question-item {
    background: #f8f9ff;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 25px;
    transition: all 0.3s ease;
}

.question-item:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.1);
}

.question-number {
    font-size: 1.1em;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 15px;
}

.question-text {
    font-size: 1.2em;
    margin-bottom: 20px;
    color: #333;
    line-height: 1.6;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-item:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.option-item input[type="radio"] {
    margin-right: 15px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.option-item label {
    cursor: pointer;
    flex: 1;
    font-size: 1.1em;
    color: #333;
}

/* Result Styles */
.option-item.correct-answer {
    background: #d4edda;
    border-color: #28a745;
}

.option-item.wrong-answer {
    background: #f8d7da;
    border-color: #dc3545;
}

.option-item.user-correct {
    background: #d4edda;
    border-color: #28a745;
}

/* Short Answer Styles */
.short-answer-input {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.3s;
}

.short-answer-input:focus {
    outline: none;
    border-color: #667eea;
}

.short-answer-input.user-answer {
    background: #fff3cd;
    border-color: #ffc107;
}

.short-answer-display {
    margin-top: 15px;
    padding: 15px;
    border-radius: 10px;
    background: #e7f3ff;
    border-left: 4px solid #2196F3;
}

.short-answer-display strong {
    color: #1976D2;
    display: block;
    margin-bottom: 10px;
}

/* Quiz Footer */
.quiz-footer {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

/* Result Screen */
.result-screen {
    padding: 40px;
}

.result-screen h2 {
    font-size: 2em;
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.result-summary {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.stat-box {
    background: white;
    border-radius: 15px;
    padding: 30px;
    min-width: 150px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-box.correct {
    border-top: 5px solid #28a745;
}

.stat-box.wrong {
    border-top: 5px solid #dc3545;
}

.stat-box.total {
    border-top: 5px solid #667eea;
}

.stat-label {
    display: block;
    font-size: 1.1em;
    color: #666;
    margin-bottom: 10px;
}

.stat-value {
    display: block;
    font-size: 2.5em;
    font-weight: 700;
    color: #333;
}

.review-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-item {
    background: #f8f9ff;
    border-radius: 15px;
    padding: 25px;
    border: 2px solid #e0e0e0;
}

.review-item .question-text {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.result-footer {
    text-align: center;
    margin-top: 30px;
}

/* Responsive */
@media (max-width: 768px) {
    .mode-buttons {
        flex-direction: column;
        align-items: center;
    }

    .mode-btn {
        width: 100%;
        max-width: 300px;
    }

    .quiz-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .result-summary {
        flex-direction: column;
        align-items: center;
    }
}
