/* Основные стили викторины */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Заголовок и описание */
.quiz-header {
    text-align: center;
    margin-bottom: 30px;
}

.quiz-title {
    font-size: 24px;
    margin-bottom: 15px;
    color: #333;
}

.quiz-description {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.quiz-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 15px 0;
    color: #666;
}

.quiz-meta > div {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Кнопки */
.quiz-btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
}

.quiz-btn:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.quiz-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Прогресс */
.quiz-progress {
    margin: 20px 0;
    text-align: center;
    font-size: 18px;
    color: #444;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

/* Вопросы */
.quiz-question {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.quiz-question h3 {
    margin-bottom: 20px;
    font-size: 20px;
    color: #333;
    line-height: 1.4;
}

/* Ответы */
.answers-container {
    margin: 20px 0;
}

.quiz-answer {
    margin: 12px 0;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.quiz-answer:hover {
    background-color: #f8f9fa;
    border-color: #007bff;
}

.quiz-answer input[type="radio"],
.quiz-answer input[type="checkbox"] {
    margin-right: 12px;
    cursor: pointer;
}

.quiz-answer label {
    cursor: pointer;
    flex: 1;
    margin: 0;
    font-size: 16px;
    color: #444;
}

.quiz-text-answer {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.quiz-text-answer:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.25);
}

/* Навигация */
.quiz-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.prev-btn {
    background-color: #6c757d;
}

.submit-btn {
    background-color: #28a745;
}

/* Результаты */
.quiz-results {
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.results-summary {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.total-score {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
}

.correct-answers {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
}

.score-percentage {
    position: relative;
    height: 40px;
    background: #f0f0f0;
    border-radius: 20px;
    margin: 30px 0;
    overflow: hidden;
}

.percentage-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    transition: width 1.5s ease-in-out;
}

.percentage-bar + span {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    z-index: 1;
}

.question-result {
    margin: 20px 0;
    padding: 20px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.question-result.correct {
    border-left: 4px solid #4CAF50;
}

.question-result.incorrect {
    border-left: 4px solid #f44336;
}

.question-result h4 {
    color: #333;
    margin-bottom: 10px;
}

.question-text {
    font-weight: 500;
    color: #444;
    margin-bottom: 15px;
}

.user-answer, .correct-answer {
    margin: 8px 0;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
}

.score {
    font-weight: bold;
    color: #666;
    margin-top: 10px;
}

/* Загрузчик */
.quiz-loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1000;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    z-index: 999;
}

/* Сообщения об ошибках */
.quiz-error {
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 4px;
    color: #856404;
    margin: 20px 0;
    text-align: center;
}

/* Таймер */
.quiz-timer {
    text-align: center;
    font-size: 24px;
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.time-left {
    font-weight: bold;
    color: #dc3545;
}

/* Действия с результатами */
.results-actions {
    margin-top: 30px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* Адаптивная верстка */
@media (max-width: 768px) {
    .quiz-container {
        padding: 15px;
        margin: 10px;
    }

    .quiz-title {
        font-size: 20px;
    }

    .quiz-meta {
        flex-direction: column;
        gap: 10px;
    }

    .quiz-navigation {
        flex-direction: column;
        gap: 15px;
    }

    .quiz-btn {
        width: 100%;
        padding: 12px;
        margin: 5px 0;
    }

    .results-actions {
        flex-direction: column;
    }

    .question-result {
        padding: 15px;
    }

    .score-percentage {
        height: 30px;
    }
}

/* Дополнительные анимации */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.quiz-question, .question-result {
    animation: fadeIn 0.5s ease-in-out;
}

/* Состояния кнопок */
.quiz-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Улучшенные стили для правильных/неправильных ответов */
.answer-status {
    display: inline-block;
    margin-left: 10px;
    font-weight: bold;
}

.answer-status.correct {
    color: #4CAF50;
}

.answer-status.incorrect {
    color: #f44336;
}

/* Стили для объяснений */
.answer-explanation {
    margin-top: 10px;
    padding: 10px;
    background: #e8f5e9;
    border-left: 4px solid #4CAF50;
    border-radius: 4px;
}

/* Стили для подсказок */
.quiz-hint {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

/* Стили для прогресс-бара */
.progress-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    margin: 15px 0;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: #007bff;
    transition: width 0.3s ease;
}
/* Стили для одиночной викторины */
.quiz-single-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.quiz-single-content {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Улучшенный loader */
.quiz-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Улучшенные стили для результатов */
.quiz-results {
    min-height: 200px;
    margin: 20px 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quiz-results.visible {
    opacity: 1;
}

/* Стили для прогресс-бара */
.progress-bar {
    height: 6px;
    background: #e9ecef;
    margin: 15px 0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: #007bff;
    transition: width 0.3s ease;
}