.wp-quiz-container {
    max-width: 700px;
    margin: 30px auto;
    padding: 32px;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    line-height: 1.5;
}

.quiz-loading {
    text-align: center;
    padding: 60px 20px;
    color: #475569;
    font-size: 16px;
    font-weight: 500;
}

.quiz-header {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid #f1f5f9;
}

.quiz-header h2 {
    margin: 0 0 12px 0;
    color: #0f172a;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.quiz-header p {
    margin: 0;
    color: #475569;
    font-size: 16px;
    font-weight: 400;
}

.quiz-question {
    margin-bottom: 32px;
}

.quiz-question h3 {
    margin-bottom: 24px;
    color: #0f172a;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
}

.wp-quiz-container .quiz-options {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.quiz-options li {
    margin-bottom: 12px;
}

.quiz-options label {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    min-height: 56px;
    box-sizing: border-box;
}

.quiz-options label:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.quiz-options input[type="radio"]:checked + .option-text {
    font-weight: 600;
    color: #0f172a;
}

.quiz-options label:has(input[type="radio"]:checked) {
    background-color: #eff6ff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.quiz-options input[type="radio"] {
    margin-right: 16px;
    transform: scale(1.2);
    accent-color: #3b82f6;
}

.option-text {
    color: #1f2937;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
}

.quiz-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #f1f5f9;
}

.quiz-btn {
    padding: 14px 28px;
    background-color: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0;
    min-height: 48px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.quiz-btn:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.quiz-btn:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.quiz-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.quiz-progress {
    width: 100%;
    height: 8px;
    background-color: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 32px;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 4px;
}

.quiz-counter {
    background: #f8fafc;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 14px;
    color: #475569;
    font-weight: 600;
    border: 1px solid #e2e8f0;
}

.quiz-results {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.quiz-results h3 {
    margin-top: 0;
    color: #0f172a;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
}

.quiz-score {
    font-size: 56px;
    font-weight: 800;
    color: #3b82f6;
    margin: 24px 0;
    text-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.quiz-results p {
    color: #1f2937;
    font-size: 16px;
    margin: 16px 0;
    font-weight: 500;
}

.quiz-message {
    font-size: 18px;
    color: #475569;
    margin-bottom: 32px;
    font-weight: 500;
}

.quiz-error {
    color: #dc2626;
    background-color: #fef2f2;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    border: 1px solid #fecaca;
    font-weight: 500;
}

.quiz-nav-left {
    width: 120px;
}

/* Results buttons layout */
.quiz-results-buttons {
    margin-top: 24px;
}

/* Stacked layout (for existing users - cleaner single button) */
.quiz-results-buttons.stacked {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.quiz-results-buttons.stacked .quiz-btn {
    max-width: 200px;
}

/* Side-by-side layout (for new users with save button) */
.quiz-results-buttons.with-save {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.quiz-results-buttons.with-save .quiz-btn {
    width: 100%;
    max-width: 180px;
}

/* When there are two buttons, put them side by side */
.quiz-results-buttons.with-save .quiz-btn:first-of-type {
    margin-bottom: 0;
}

.quiz-results-buttons.with-save .quiz-btn:nth-of-type(2) {
    margin-top: 0;
}

/* Create a button row for the two action buttons */
.quiz-results-buttons.with-save {
    gap: 16px;
}

.quiz-results-buttons.with-save .quiz-btn {
    flex: 0 0 auto;
}

/* Button container for side-by-side */
.quiz-results-buttons.with-save::before {
    content: '';
    display: flex;
    gap: 12px;
    justify-content: center;
    width: 100%;
}

/* Adjust the layout for save scenario */
.quiz-results-buttons.with-save {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: 400px;
    margin: 24px auto 0;
    align-items: start;
}

.quiz-results-buttons.with-save .quiz-signin-tip {
    grid-column: 1 / -1;
    margin-top: 8px;
    margin-bottom: 0;
}

/* Rank info styling */
.quiz-results p strong {
    color: #0f172a;
}

.quiz-comparison {
    color: #1f2937;
    font-size: 16px;
    margin: 16px 0;
    padding: 12px 16px;
    background-color: #f9fafb;
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
    font-weight: 500;
}

/* Sign‑in prompt styling */
.quiz-signin-tip {
    text-align: center;
    font-size: 14px;
    color: #64748b;
    margin: 16px 0 0 0;
}

.quiz-signin-tip a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.quiz-signin-tip a:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Save button styling */
.quiz-save-btn {
    background-color: #10b981;
}

.quiz-save-btn:hover {
    background-color: #059669;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.quiz-timer {
    text-align: right;
    margin-bottom: 8px;
    font-size: 14px;
    color: #475569;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .wp-quiz-container {
        margin: 20px;
        padding: 24px;
    }

    .quiz-header h2 {
        font-size: 24px;
    }

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

    .quiz-options label {
        padding: 14px 16px;
        min-height: 52px;
    }

    .quiz-navigation {
        flex-direction: column;
        gap: 16px;
    }

    .quiz-btn {
        width: 100%;
        max-width: 200px;
    }

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

    /* Mobile adjustments for results buttons */
    .quiz-results-buttons.with-save {
        grid-template-columns: 1fr;
        max-width: 250px;
    }

    .quiz-results-buttons.with-save .quiz-btn {
        width: 100%;
        max-width: none;
    }
}