/**
 * WordPress Quiz Engine Styles
 */

html {
    scroll-behavior: smooth;
}

* {
    scroll-margin-top: 20px;
}

.wp-quiz-engine {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: white;
}

/* Quiz Header */
.quiz-header {
    text-align: center;
    margin-bottom: 40px;
}

.quiz-category {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 20px 0;
    padding: 0;
}

.quiz-progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2B6CB0 0%, #2C5282 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.quiz-progress-text {
    font-size: 14px;
    color: #666;
    margin: 0;
    font-weight: 500;
}

/* Question Container */
.quiz-all-questions {
    margin-bottom: 30px;
}

.quiz-question-block {
    background: #ffffff;
    border-radius: 0;
    padding: 50px 40px;
    box-shadow: none;
    margin-bottom: 0;
    scroll-margin-top: 20px;
    transition: box-shadow 0.3s ease;
}

.quiz-question-block:focus-within {
    box-shadow: none;
}

.question-number {
    display: inline-block;
    background: linear-gradient(135deg, #2B6CB0 0%, #2C5282 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.question-divider {
    height: 50px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.question-divider::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, transparent, #e0e0e0 20%, #e0e0e0 80%, transparent);
}

.question-divider::after {
    content: '•••';
    background: white;
    padding: 0 30px;
    color: #e0e1e0;
    font-size: 16px;
    letter-spacing: 8px;
    position: relative;
    z-index: 1;
}

.quiz-question-container {
    background: #ffffff;
    border-radius: 16px;
    padding: 40px 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.quiz-question {
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 40px 0;
    line-height: 1.5;
}

.question-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 30px;
    display: block;
}

.question-hint {
    font-size: 13px;
    color: #2B6CB0;
    font-weight: 500;
    margin: -20px 0 20px 0;
    font-style: italic;
}

/* Quiz Options */
.quiz-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    text-align: left;
    width: 100%;
    position: relative;
}

.quiz-option:hover:not(:disabled) {
    background: #E6F2FF;
    border-color: #2B6CB0;
}

.quiz-option:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.quiz-option.selected {
    background: #E6F2FF;
    border-color: #2B6CB0;
    border-width: 2px;
}

.quiz-option.selected .option-letter {
    background: #2B6CB0;
}

.option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #2B6CB0;
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    align-self: flex-start;
}

.option-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-text {
    color: #1a1a1a;
    font-weight: 500;
}

.option-image {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin-top: 5px;
}

.quiz-option.correct {
    background: #d4edda;
    border-color: #28a745;
    animation: correctAnswer 0.5s ease;
}

.quiz-option.correct .option-letter {
    background: #28a745;
}

.quiz-option.incorrect {
    background: #f8d7da;
    border-color: #dc3545;
    animation: incorrectAnswer 0.5s ease;
}

.quiz-option.incorrect .option-letter {
    background: #dc3545;
}

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

@keyframes incorrectAnswer {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
    20%, 40%, 60%, 80% { transform: translateX(3px); }
}

/* Navigation Buttons */
.quiz-submit-container {
    text-align: center;
    margin-top: 30px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    scroll-margin-top: 20px;
}

.quiz-submit-btn {
    padding: 18px 48px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 50px;
    box-shadow: none;
}

.quiz-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: none;
}

.quiz-submit-btn:disabled {
    background: linear-gradient(135deg, #9e9e9e 0%, #757575 100%);
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.quiz-submit-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.submit-hint {
    margin-top: 16px;
    font-size: 14px;
    color: #2B6CB0;
    font-weight: 500;
}

.quiz-navigation {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.quiz-btn {
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.quiz-btn-primary {
    background: linear-gradient(135deg, #2B6CB0 0%, #2C5282 100%);
    color: white;
}

.quiz-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(43, 108, 176, 0.4);
}

.quiz-btn-secondary {
    background: #f8f9fa;
    color: #1a1a1a;
    border: 2px solid #e0e0e0;
}

.quiz-btn-secondary:hover {
    background: #e9ecef;
    border-color: #cbd3da;
}

/* Results Section */
.quiz-results-summary {
    background: #ffffff;
    border-radius: 0;
    padding: 60px 50px;
    box-shadow: none;
    margin-top: 0;
    animation: slideIn 0.6s ease;
    scroll-margin-top: 20px;
}

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

.results-header h2 {
    font-size: 36px;
    font-weight: 700;
    color: #1a1a1a;
    text-align: center;
    margin: 0 0 50px 0;
}

.results-score-display {
    text-align: center;
    padding: 60px 40px;
    border-radius: 0;
    margin-bottom: 50px;
}

.quiz-results-summary.excellent .results-score-display {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.quiz-results-summary.excellent .score-big {
    color: #28a745;
}

.quiz-results-summary.good .results-score-display {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
}

.quiz-results-summary.good .score-big {
    color: #17a2b8;
}

.quiz-results-summary.average .results-score-display {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
}

.quiz-results-summary.average .score-big {
    color: #ffc107;
}

.quiz-results-summary.needs-improvement .results-score-display {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
}

.quiz-results-summary.needs-improvement .score-big {
    color: #dc3545;
}

.results-actions {
    text-align: center;
    margin-top: 50px;
}

.results-actions .quiz-btn {
    min-width: 250px;
    padding: 18px 48px;
    font-size: 18px;
    border-radius: 50px;
}

.quiz-results {
    background: #ffffff;
    border-radius: 0;
    padding: 50px 40px;
    box-shadow: none;
}

.results-summary {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 40px;
    border-radius: 12px;
}

.score-display {
    margin-bottom: 24px;
}

.score-big {
    font-size: 72px;
    font-weight: 900;
    color: #1a1a1a;
    line-height: 1;
    margin-bottom: 16px;
}

.score-label {
    font-size: 16px;
    color: #666;
    margin: 0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.score-percentage {
    font-size: 24px;
    font-weight: 600;
    color: #2B6CB0;
    margin-top: 24px;
}

.results-summary.excellent {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.results-summary.excellent .score-big {
    color: #28a745;
}

.results-summary.good {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
}

.results-summary.good .score-big {
    color: #17a2b8;
}

.results-summary.average {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
}

.results-summary.average .score-big {
    color: #ffc107;
}

.results-summary.needs-improvement {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
}

.results-summary.needs-improvement .score-big {
    color: #dc3545;
}

.results-message {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 24px 0 0 0;
}

/* Calculating Results Loader */
.quiz-calculating {
    background: #ffffff;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
}

.calculating-content h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 24px 0 8px 0;
}

.calculating-content p {
    font-size: 16px;
    color: #666;
    margin: 0;
}

.loader {
    width: 60px;
    height: 60px;
    border: 6px solid #e0e0e0;
    border-top: 6px solid #2B6CB0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.results-score {
    font-size: 18px;
    color: #666;
    margin: 0;
    font-weight: 500;
}

/* Results Details */
.results-details {
    margin-top: 40px;
}

.results-details h3 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 20px 0;
}

.result-item {
    background: #f8f9fa;
    border-radius: 0;
    padding: 20px;
    margin-bottom: 16px;
    border-left: 4px solid #e0e0e0;
    transition: all 0.3s ease;
}

.result-item.correct {
    border-left-color: #28a745;
    background: linear-gradient(to right, #d4edda 0%, #f0f9f4 100%);
    border: 2px solid #28a745;
}

.result-item.incorrect {
    border-left-color: #dc3545;
    background: linear-gradient(to right, #f8d7da 0%, #fef5f6 100%);
    border: 2px solid #dc3545;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.result-number {
    font-weight: 700;
    color: #2B6CB0;
    font-size: 14px;
}

.result-status {
    font-size: 20px;
    font-weight: 700;
}

.result-item.correct .result-status {
    color: #28a745;
}

.result-item.incorrect .result-status {
    color: #dc3545;
}

.result-question {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 12px 0;
}

.result-answer {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.6;
}

.result-answer strong {
    color: #1a1a1a;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wp-quiz-engine {
        padding: 0 16px;
        margin: 20px auto;
    }

    .quiz-options {
        grid-template-columns: 1fr;
    }

    .quiz-category {
        font-size: 24px;
    }

    .quiz-question-block {
        padding: 30px 20px;
    }

    .question-number {
        font-size: 12px;
        padding: 6px 16px;
    }

    .quiz-question {
        font-size: 18px;
    }

    .quiz-option {
        padding: 14px 16px;
        font-size: 15px;
    }

    .option-letter {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }

    .quiz-btn {
        padding: 12px 24px;
        font-size: 15px;
    }

    .quiz-submit-btn {
        padding: 16px 36px;
        font-size: 16px;
    }

    .score-big {
        font-size: 56px;
    }

    .results-message {
        font-size: 24px;
    }

    .quiz-navigation {
        flex-direction: column;
    }

    .quiz-calculating {
        padding: 60px 30px;
    }

    .calculating-content h3 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .quiz-category {
        font-size: 20px;
    }

    .quiz-question-block {
        padding: 24px 16px;
    }

    .quiz-question {
        font-size: 16px;
    }

    .question-divider {
        height: 20px;
    }

    .score-big {
        font-size: 48px;
    }

    .loader {
        width: 50px;
        height: 50px;
        border-width: 5px;
    }

    .quiz-calculating {
        padding: 50px 20px;
    }

    .calculating-content h3 {
        font-size: 18px;
    }

    .quiz-submit-container {
        margin-top: 30px;
        padding: 20px;
    }

    .quiz-submit-btn {
        padding: 14px 30px;
        font-size: 15px;
        width: 100%;
    }
}
