:root {
  --qx-primary: #1E3A8A;
  --qx-primary-hover: #1E40AF;
  --qx-secondary: #10B981;
  --qx-accent: #F59E0B;

  --qx-text-dark: #1F2937;
  --qx-text-muted: #6B7280;

  --qx-bg-light: #F3F4F6;
  --qx-bg-white: #FFFFFF;
  --qx-border: #E5E7EB;
}

/* =========================
   QUIZ CARD
========================= */
.quiz-card {
    background: var(--qx-bg-white);
    border-radius: 20px;
    padding: 32px;
    border: 1px solid var(--qx-border);
    border-left: 4px solid var(--qx-primary);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    transition: all 0.25s ease;
}

.quiz-card:hover {
    /* transform: translateY(-6px); */
    box-shadow: 0 20px 50px rgba(30, 58, 138, 0.15);
    /* box-shadow: 0 18px 40px rgba(0,0,0,0.08); */
}

/* =========================
   HEADER & PROGRESS
========================= */
.quiz-header {
    margin-bottom: 20px;
}

.quiz-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--qx-text-dark);
    margin-bottom: 10px;
}

.quiz-progress-wrap {
    margin-top: 10px;
}

.quiz-progress-text {
    font-size: 14px;
    color: var(--qx-text-muted);
    margin-bottom: 6px;
    display: block;
}

.quiz-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--qx-border);
    border-radius: 6px;
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    background: var(--qx-primary);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.quiz-next-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =========================
   AD SLOT
========================= */
.quiz-ad-slot {
    background: var(--qx-bg-light);
    text-align: center;
    font-size: 13px;
    padding: 10px;
    border-radius: 8px;
    color: var(--qx-text-muted);
    margin-bottom: 20px;
}

/* =========================
   QUESTION
========================= */
.quiz-question {
    /* padding: 20px; */
    background: var(--qx-bg-white);
    /* border: 1px solid var(--qx-border);
    border-radius: 10px; */
}

.quiz-question-header {
    margin-bottom: 15px;
}

.quiz-question-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--qx-text-dark);
}

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

.quiz-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--qx-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--qx-bg-white);
}

.quiz-option:hover {
    background: #f9fafb;
}

.quiz-option input {
    width: 18px;
    height: 18px;
    accent-color: var(--qx-primary);
    cursor: pointer;
}

.quiz-option-text {
    font-size: 15px;
    color: var(--qx-text-dark);
}

/* Selected state */
.quiz-option.selected {
    border-color: var(--qx-primary);
    background: #eef2ff;
}

/* =========================
   ACTIONS
========================= */
.quiz-actions {
    margin-top: 24px;
    text-align: right;
}

.quiz-next-btn {
    padding: 10px 26px;
    background: var(--qx-primary);
    color: #ffffff;
    border-radius: 8px;
    border: none;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.quiz-next-btn:hover {
    background: var(--qx-primary-hover);
}

.quiz-next-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* =========================
   RESULT PAGE
========================= */
.quiz-result {
    padding: 24px;
    background: var(--qx-bg-white);
    border: 1px solid var(--qx-border);
    border-radius: 12px;
    text-align: center;
}

.quiz-result h2 {
    margin-bottom: 10px;
    font-size: 22px;
}

.quiz-result-ad {
    margin: 20px 0;
    text-align: center;
}

/* =========================
   SCORE CARD (V2)
========================= */

.quiz-scorecard {
    background: #fff;
    border: 1px solid var(--qx-border);
    border-radius: 16px;
    padding: 30px 22px;
    text-align: center;
}

.quiz-scorecard-header h2 {
    font-size: 22px;
    margin-bottom: 4px;
}

.quiz-scorecard-subtitle {
    font-size: 14px;
    color: var(--qx-text-muted);
}

/* Score ring */
.quiz-score-ring {
    width: 130px;
    height: 130px;
    margin: 20px auto 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 700;
}

.quiz-score-ring.pass {
    border: 6px solid #10b981;
    color: #059669;
    background: #ecfdf5;
}

.quiz-score-ring.fail {
    border: 6px solid #ef4444;
    color: #dc2626;
    background: #fef2f2;
}

.quiz-score-text {
    margin: 8px 0;
    font-size: 15px;
}

/* Status pill */
.quiz-status-pill {
    display: inline-block;
    margin-bottom: 20px;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.quiz-status-pill.pass {
    background: #d1fae5;
    color: #065f46;
}

.quiz-status-pill.fail {
    background: #fee2e2;
    color: #7f1d1d;
}

/* Breakdown */
.quiz-breakdown {
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    margin-top: 20px;
    text-align: left;
}

.quiz-breakdown h4 {
    margin-bottom: 12px;
    font-size: 16px;
}

.quiz-break-row {
    margin-bottom: 12px;
}

.quiz-break-row .label {
    font-size: 14px;
    margin-bottom: 6px;
}

.quiz-break-row .label.success {
    color: #059669;
}

.quiz-break-row .label.error {
    color: #dc2626;
}

.quiz-break-row .bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.quiz-break-row .bar span {
    display: block;
    height: 100%;
    background: #10b981;
}

.quiz-break-row .bar.error span {
    background: #ef4444;
}

/* Actions */
.quiz-score-actions {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.quiz-btn {
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}

.quiz-btn.primary {
    background: var(--qx-primary);
    color: #fff;
    border: none;
}

.quiz-btn.outline {
    border: 2px solid var(--qx-primary);
    color: var(--qx-primary);
    background: transparent;
}

/* =========================
   RESULT BREAKDOWN (UPGRADED)
========================= */

.quiz-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 24px 0 10px;
}

.quiz-break-card {
    background: var(--qx-bg-light);
    border-radius: 14px;
    padding: 16px;
    position: relative;
}

.quiz-break-card.success {
    border-left: 4px solid var(--qx-secondary);
}

.quiz-break-card.error {
    border-left: 4px solid #ef4444;
}

.quiz-break-icon {
    font-size: 22px;
    margin-bottom: 6px;
}

.quiz-break-card.success .quiz-break-icon {
    color: var(--qx-secondary);
}

.quiz-break-card.error .quiz-break-icon {
    color: #ef4444;
}

.quiz-break-info strong {
    font-size: 22px;
    font-weight: 700;
    color: var(--qx-text-dark);
    display: block;
}

.quiz-break-info span {
    font-size: 13px;
    color: var(--qx-text-muted);
}

/* Progress bar inside cards */
.quiz-break-bar {
    margin-top: 10px;
    height: 8px;
    background: var(--qx-border);
    border-radius: 6px;
    overflow: hidden;
}

.quiz-break-bar span {
    display: block;
    height: 100%;
    width: 0;
    transition: width 0.4s ease;
}

.quiz-break-card.success .quiz-break-bar span {
    background: var(--qx-secondary);
}

.quiz-break-card.error .quiz-break-bar span {
    background: #ef4444;
}

/* Motivation text */
.quiz-motivation {
    margin: 14px 0 6px;
    font-size: 14px;
    color: var(--qx-text-dark);
    text-align: center;
}

/* =========================
   SCORE CARD POLISH
========================= */

.quiz-scorecard {
    /* max-width: 720px; */
    margin: 0 auto;
}

.quiz-score-ring {
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.quiz-status-pill {
    letter-spacing: 0.2px;
}

/* =========================
   RESULT ACTION BUTTONS
========================= */

.quiz-score-actions {
    margin-top: 26px;
}

.quiz-btn.primary {
    box-shadow: 0 6px 16px rgba(30,58,138,0.25);
}

.quiz-btn.outline:hover {
    background: var(--qx-primary);
    color: #fff;
}

/* =========================
   QUIZ START SCREEN
========================= */

/* Section Wrapper */
.single-quiz-section {
    padding: 60px 20px 60px;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
    position: relative;
    overflow: hidden;
}

/* Soft background glow */
.single-quiz-section::before {
    content: "";
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(37,99,235,0.15) 0%, transparent 70%);
    top: -150px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 0;
}

/* Container */
/* .quiz-container {
    max-width: 850px;
    margin: 0 auto;
} */

/* Start Card */
.quiz-start-card {
    background: #ffffff;
    padding: 70px 60px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 
        0 20px 60px rgba(37,99,235,0.08),
        0 10px 20px rgba(0,0,0,0.04);
    border: 1px solid rgba(255,255,255,0.6);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

.quiz-start-card::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 26px;
    background: linear-gradient(45deg, #2563eb, #10b981);
    z-index: -1;
    opacity: 0.05;
}

.quiz-category-badge {
    display: inline-block;
    background: rgba(37,99,235,0.1);
    color: #2563eb;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* Title */
.quiz-start-title {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 18px;
    color: var(--qx-text-dark);
}

.quiz-explanation {
    margin-top: 20px;
    padding: 16px 18px;
    border-radius: 10px;
    background: #f8fafc;
    border-left: 4px solid #2563eb;
    animation: fadeInUp 0.3s ease-in-out;
}

.quiz-explanation-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.quiz-explanation-icon {
    font-size: 18px;
    margin-right: 8px;
}

.quiz-explanation-title {
    font-weight: 600;
    font-size: 15px;
    color: #1e293b;
}

.quiz-explanation p {
    margin-bottom: 5px 0;
    color: #334155;
    line-height: 1.6;
    font-size: 14px;
}

/* Optional: Correct & Wrong Color Variants */
.quiz-explanation.correct {
    border-left-color: #16a34a;
    background: #f0fdf4;
}

.quiz-explanation.wrong {
    border-left-color: #dc2626;
    background: #fef2f2;
}

.quiz-option.option-correct {
    background: #f0fdf4;
    border: 1px solid #16a34a;
}

.quiz-option.option-wrong {
    background: #fef2f2;
    border: 1px solid #dc2626;
}

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

/* Smooth animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 1024px) {
    .quiz-start-title {
        font-size: 42px;
    }
}

/* Description */
.quiz-start-desc {
    font-size: 16px;
    color: var(--qx-text-muted);
    margin: 0 auto 35px;
    line-height: 1.7;
    max-width: 700px;
}

/* Meta Section */
.quiz-start-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

/* Meta Pills */
.quiz-meta-item {
    background: #ffffff;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #eef2ff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
}

.quiz-meta-item:hover {
    transform: translateY(-2px);
}

/* Start Button */
.quiz-start-btn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    padding: 18px 48px;
    border-radius: 14px;
    border: none;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-start-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 60px rgba(37,99,235,0.4);
}

img.emoji {
    width: 1.5em !important;
    height: 1.5em !important;
    margin-right: 5px !important;
    vertical-align: -0.4em !important;
}

.personality-title.red { background:#ff4d4d; color:#fff; }
.personality-title.blue { background:#3498db; color:#fff; }
.personality-title.yellow { background:#f1c40f; color:#000; }
.personality-title.green { background:#2ecc71; color:#fff; }

/* Footer Text */
.quiz-start-footer {
    margin-top: 18px;
    color: #6b7280;
    font-size: 13px;
    opacity: 0.8;
}

/* Animation */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(25px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Related Quiz Section */
.quiz-learning-wrapper {
    /* max-width: 900px; */
    margin: 60px auto 0;
    padding: 40px 40px 50px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.04);
}

.quiz-related-container {
    /* max-width: 850px; */
    margin: 0 auto;
}

.quiz-related-header h3 {
    font-size: 22px;
    margin-bottom: 6px;
}

.quiz-related-header p {
    font-size: 14px;
    color: #6b7280;
}

.quiz-view-all {
    margin: 30px 5px 0 0;
    text-align: right;
}

.view-all-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--qx-primary);
    text-decoration: none;
    transition: 0.3s ease;
}

.view-all-link:hover,
.view-all-link:hover svg path {
    opacity: 0.8;
}

/* Related Quiz Section */

/* Personality Card UI in Result Page */
.personality-result-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 40px 30px;
    margin: 30px auto;
    max-width: 720px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.06);
    border: 1px solid #eef2f7;
}

.personality-label {
    font-size: 13px;
    font-weight: 600;
    color: #16a34a;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.personality-title {
    font-size: 38px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 15px;
}

.personality-description {
    font-size: 16px;
    color: #64748b;
    max-width: 480px;
    margin: 0 auto;
}

.personality-result-card::before {
    content: "";
    display: block;
    height: 6px;
    width: 80px;
    background: #16a34a;
    margin: 0 auto 20px;
    border-radius: 50px;
}

.personality-confidence {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 12px;
}

.personality-result-card {
    animation: fadeInScale 0.4s ease-out;
}

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

/* Responsive */
@media (max-width: 768px) {
    .quiz-start-card {
        padding: 40px 25px;
    }

    .quiz-start-title {
        font-size: 26px;
    }

    .quiz-start-meta {
        gap: 12px;
    }

    .quiz-start-btn {
        width: 100%;
    }
    
    .quiz-related-grid {
        grid-template-columns: 1fr;
    }
}


#quiz-question-area > .quiz-card {
    max-width: 720px;
    margin: 30px auto;
}

/* .quiz-progress-wrap {
    display: none;
} */

/* =========================
   MOBILE OPTIMIZATION
========================= */
@media (max-width: 640px) {
    .quiz-card {
        padding: 18px;
    }

    .quiz-title {
        font-size: 20px;
    }

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

    .quiz-next-btn {
        width: 100%;
    }

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

    .quiz-score-ring {
        width: 110px;
        height: 110px;
        font-size: 26px;
    }

    .quiz-break-info strong {
        font-size: 20px;
    }

    .quiz-score-actions {
        flex-direction: column;
    }

    .quiz-start-card {
        padding: 28px 20px;
    }

    .quiz-start-title {
        font-size: 22px;
    }

    .quiz-start-btn {
        width: 100%;
    }
}
