/*
 * HDQuiz — Modern Style Overrides
 * Based on actual plugin HTML structure
 * Add this file via functions.php wp_enqueue_style()
 * or paste at the bottom of your style.css
 * ─────────────────────────────────────────────
 * Uses the same CSS variables as the main theme:
 *   --accent  #E8232A
 *   --dark    #111827
 *   --mid     #6B7280
 *   --border  #E5E7EB
 *   --bg      #F9FAFB
 *   --surface #FFFFFF
 */

/* ─── Wrapper ──────────────────────────────── */
.hdq_quiz_wrapper {
    font-family: 'Inter', system-ui, sans-serif;
    max-width: 720px;
    margin: 0 auto;
}

/* Hide the offset helper div */
.hdq_offset_div { display: none !important; }

/* ─── Each Question Block ──────────────────── */
.hdq_question {
    margin-bottom: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid var(--border, #E5E7EB);
}
.hdq_question:last-of-type { border-bottom: none; }

/* Question image */
.hdq_question_featured_image {
    margin-bottom: 22px;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}
.hdq_featured_image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Question heading */
.hdq_question_heading {
    font-family: 'Poppins', system-ui, sans-serif;
    font-size: 1.175rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--dark, #111827);
    margin-bottom: 18px;
    display: flex;
    gap: 10px;
    align-items: baseline;
}

/* #1. number badge */
.hdq_question_number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
    background: var(--accent, #E8232A);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    border-radius: 6px;
    padding: 0 7px;
    flex-shrink: 0;
    font-family: 'Inter', sans-serif;
    letter-spacing: .3px;
}

/* ─── Answers ──────────────────────────────── */
.hdq_answers {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hdq_row { margin: 0; }

/* The clickable label — this IS the answer button */
.hdq_label_answer {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border: 2px solid var(--border, #E5E7EB);
    border-radius: 10px;
    background: var(--surface, #fff);
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, transform .1s ease;
    user-select: none;
}
.hdq_label_answer:hover {
    border-color: var(--accent, #E8232A);
    background: #FEF2F2;
    transform: translateX(3px);
}

/* Hide the default checkbox visually — we build our own */
.hdq-options-check {
    position: relative;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
}

.hdq_check_input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Custom toggle circle */
.hdq_toggle {
    display: block;
    width: 22px;
    height: 22px;
    border: 2px solid var(--border, #E5E7EB);
    border-radius: 50%;
    background: var(--bg, #F9FAFB);
    transition: border-color .15s, background .15s;
    position: relative;
}
.hdq_toggle::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: var(--accent, #E8232A);
    opacity: 0;
    transform: scale(.5);
    transition: opacity .15s, transform .15s;
}

/* When the label is hovered, light up the toggle */
.hdq_label_answer:hover .hdq_toggle {
    border-color: var(--accent, #E8232A);
}
.hdq_label_answer:hover .hdq_toggle::after {
    opacity: .35;
    transform: scale(1);
}

/* Selected state — HDQuiz adds .hdq_selected or checks the input;
   we target checked input's siblings */
.hdq_check_input:checked ~ .hdq_toggle,
.hdq_label_answer.hdq_selected .hdq_toggle {
    border-color: var(--accent, #E8232A);
    background: var(--accent, #E8232A);
}
.hdq_check_input:checked ~ .hdq_toggle::after,
.hdq_label_answer.hdq_selected .hdq_toggle::after {
    opacity: 1;
    transform: scale(1);
    background: #fff;
}

/* Selected label styling */
.hdq_label_answer.hdq_selected,
.hdq_label_answer:has(.hdq_check_input:checked) {
    border-color: var(--accent, #E8232A);
    background: #FEF2F2;
}

/* Answer text */
.hdq_aria_label {
    font-size: .95rem;
    font-weight: 500;
    color: var(--dark, #111827);
    line-height: 1.4;
    transition: color .15s;
}
.hdq_label_answer:hover .hdq_aria_label { color: var(--accent, #E8232A); }
.hdq_label_answer.hdq_selected .hdq_aria_label { color: var(--accent, #E8232A); }

/* ─── Finish Button ────────────────────────── */
.hdq_finish {
    margin-top: 8px;
    display: flex;
    justify-content: center;
}

.hdq_finsh_button {
    display: inline-block;
    padding: 14px 48px;
    background: var(--accent, #E8232A);
    color: #fff !important;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: .2px;
    cursor: pointer;
    transition: background .15s, transform .1s;
    border: none;
    text-align: center;
}
.hdq_finsh_button:hover {
    background: #B91C1C;
    transform: translateY(-1px);
}
.hdq_finsh_button:active { transform: translateY(0); }

/* ─── Loading Bar ──────────────────────────── */
.hdq_loading_bar {
    height: 3px;
    background: linear-gradient(90deg, var(--accent, #E8232A), #ff6b6b);
    border-radius: 3px;
    margin-top: 16px;
    display: none; /* shown by plugin JS when loading */
}

/* ─── Results Section ──────────────────────── */
.hdq_results_wrapper {
    display: none;
    animation: hdq_fadeIn .4s ease;
}
@keyframes hdq_fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hdq_results_inner {
    background: var(--surface, #fff);
    border-radius: 16px;
    overflow: hidden;
}

.hdq_results_title {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--mid, #6B7280);
    text-align: center;
    padding: 28px 24px 0;
    margin-bottom: 0;
}

/* Each personality result card */
.hdq_result_personality {
    padding: 28px 32px;
    border-bottom: 1px solid var(--border, #E5E7EB);
    display: none; /* plugin shows only the winning one */
}
.hdq_result_personality:last-of-type { border-bottom: none; }

/* The small result type label (e.g. "Red/Extrovert") */
.hdq_result_personality .hdq_result {
    display: inline-block;
    padding: 4px 12px;
    background: var(--accent, #E8232A);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    border-radius: 4px;
    margin-bottom: 14px;
}

/* Result title (h3 inside the personality block) */
.hdq_result_personality h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark, #111827);
    line-height: 1.25;
    margin-bottom: 12px;
}

/* Result description text */
.hdq_result_personality p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--mid, #6B7280);
}

.hdq_result_after { display: none; }

/* ─── Share Section ────────────────────────── */
.hdq_share {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    background: var(--bg, #F9FAFB);
    border-top: 1px solid var(--border, #E5E7EB);
}

.hdq_social_icon a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #E5E7EB);
    transition: border-color .15s, transform .15s, box-shadow .15s;
    overflow: hidden;
}
.hdq_social_icon a:hover {
    border-color: var(--accent, #E8232A);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.hdq_social_icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* ─── Mobile ───────────────────────────────── */
@media (max-width: 640px) {
    .hdq_question_heading { font-size: 1.05rem; }

    .hdq_label_answer { padding: 12px 14px; gap: 12px; }
    .hdq_aria_label   { font-size: .9rem; }

    .hdq_finsh_button { width: 100%; padding: 14px 24px; }

    .hdq_result_personality { padding: 24px 20px; }
    .hdq_result_personality h3 { font-size: 1.25rem; }
}