/* ==========================================================================
   VNX Quiz Builder — Frontend Styles
   Structural layout only. Typography and colour inherit from the active theme.
   ========================================================================== */

/* Keyframes for smooth section transitions */
@keyframes vnxFadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Container ─────────────────────────────────────────────────────────────
   No font-family, font-size, or color — everything inherits from the theme.
   ────────────────────────────────────────────────────────────────────────── */
.vnx-quiz-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 40px;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

/* ── Progress Bar ──────────────────────────────────────────────────────────*/
.vnx-quiz-container .quiz-progress-bar {
    height: 6px;
    background-color: #f3f4f6;
    border-radius: 6px;
    margin-bottom: 32px;
    overflow: hidden;
}

.vnx-quiz-container .quiz-progress-fill {
    height: 100%;
    background-color: #1d1440;
    border-radius: 6px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(29, 20, 64, 0.4);
    width: 0;
}

/* ── Sections ──────────────────────────────────────────────────────────────*/
.vnx-quiz-container .quiz-section {
    display: none;
    margin-bottom: 24px;
}

.vnx-quiz-container .quiz-section.active {
    display: block;
    animation: vnxFadeSlideUp 0.4s ease-out forwards;
}

/* h2 inside a section: only add spacing, let theme control size/colour/weight */
.vnx-quiz-container .quiz-section h2 {
    margin-bottom: 20px;
}

/* ── Question Cards ─────────────────────────────────────────────────────── */
.vnx-quiz-container .question-container {
    margin-bottom: 32px;
}

.vnx-quiz-container .question {
    margin-bottom: 16px;
    padding: 20px 24px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.vnx-quiz-container .question:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
    border-color: #d1d5db;
}

/* Question text — inherit theme styles, just tighten the bottom margin */
.vnx-quiz-container .question p {
    margin-top: 0;
    margin-bottom: 16px;
}

/* ── Answer Button Group ───────────────────────────────────────────────── */
.vnx-quiz-container .button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* ── All Quiz Buttons ──────────────────────────────────────────────────── */
.vnx-quiz-container .quiz-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    font-weight: 600;
    line-height: 1;
    transition: all 0.2s ease;
    text-decoration: none;
}

.vnx-quiz-container .quiz-button:active {
    transform: scale(0.98);
}

/* Primary — navigation/CTA buttons */
.vnx-quiz-container .quiz-button.primary {
    background-color: #d91a60;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(217, 26, 96, 0.25);
}

.vnx-quiz-container .quiz-button.primary:hover {
    background-color: #c21554;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(217, 26, 96, 0.35);
    color: #ffffff;
    text-decoration: none;
}

/* Secondary — Previous button */
.vnx-quiz-container .quiz-button.secondary {
    background-color: #f3f4f6;
    color: #4b5563;
}

.vnx-quiz-container .quiz-button.secondary:hover {
    background-color: #e5e7eb;
    color: #1f2937;
}

/* Answer buttons — outlined pill style */
.vnx-quiz-container .vnx-answer-btn {
    background-color: transparent;
    color: #d91a60;
    border: 1.5px solid #d91a60;
    box-shadow: none;
    min-width: 80px;
    font-size: 14px;
}

.vnx-quiz-container .vnx-answer-btn:hover {
    background-color: rgba(217, 26, 96, 0.06);
    border-color: #d91a60;
    color: #d91a60;
}

.vnx-quiz-container .vnx-answer-btn.selected {
    background-color: #1d1440;
    color: #ffffff;
    border-color: #1d1440;
    box-shadow: 0 4px 12px rgba(29, 20, 64, 0.2);
}

/* ── Navigation ────────────────────────────────────────────────────────── */
.vnx-quiz-container .navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #f3f4f6;
}

/* ── Welcome / Pass / Fail rich-text areas ─────────────────────────────────
   These areas contain content typed by the admin via wp_editor.
   We intentionally inherit ALL typography (font, size, colour, headings)
   from the active WordPress theme. Only spacing is managed here.
   ────────────────────────────────────────────────────────────────────────── */
.vnx-quiz-container .vnx-welcome-text {
    margin-bottom: 28px;
}

.vnx-quiz-container .vnx-welcome-text p,
.vnx-quiz-container .vnx-result-pass p,
.vnx-quiz-container .vnx-result-fail p {
    margin-top: 0;
    margin-bottom: 1em;
}

/* ── User Info Form ─────────────────────────────────────────────────────── */
.vnx-quiz-container .user-info-form {
    background-color: #f9fafb;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 28px;
    border: 1px solid #e5e7eb;
}

.vnx-quiz-container .user-info-form .form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 0;
}

.vnx-quiz-container .user-info-form .form-group {
    flex: 1;
    margin-bottom: 0;
}

.vnx-quiz-container .form-group {
    margin-bottom: 16px;
}

.vnx-quiz-container .form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
}

.vnx-quiz-container .form-group input[type="text"],
.vnx-quiz-container .form-group input[type="email"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: inherit;
    font-size: inherit;
    background-color: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.vnx-quiz-container .form-group input[type="text"]:focus,
.vnx-quiz-container .form-group input[type="email"]:focus {
    border-color: #1d1440;
    outline: none;
    box-shadow: 0 0 0 3px rgba(29, 20, 64, 0.1);
}

.vnx-quiz-container .form-info {
    font-size: 13px;
    color: #6b7280;
    margin-top: 12px;
    line-height: 1.5;
}

.vnx-quiz-container .error-message {
    font-size: 13px;
    margin-top: 6px;
    color: #dc2626;
    font-weight: 500;
}

/* ── Lists ─────────────────────────────────────────────────────────────── */
.vnx-quiz-container ul {
    margin: 16px 0;
    padding-left: 24px;
}

.vnx-quiz-container li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media screen and (max-width: 600px) {
    .vnx-quiz-container {
        padding: 24px 20px;
    }

    .vnx-quiz-container .button-group {
        flex-direction: column;
    }

    .vnx-quiz-container .vnx-answer-btn {
        width: 100%;
    }

    .vnx-quiz-container .user-info-form .form-row {
        flex-direction: column;
        gap: 16px;
    }
}