/* OTT, self-aware, high-effort quiz styles */
:root {
    --neon1: #ff00c3;
    --neon2: #00fff0;
    --neon3: #ffe600;
    --bg1: #0b0b10;
    --bg2: #131321;
    --card: #1b1b2e;
}

@media (prefers-reduced-motion: no-preference) {
    .rainbow-text {
        background: linear-gradient(90deg, var(--neon1), var(--neon2), var(--neon3), var(--neon1));
        background-size: 300% 100%;
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        animation: shimmer 6s linear infinite;
    }
}

body.quiz-body {
    background: radial-gradient(1200px 600px at 10% 10%, rgba(255, 0, 195, 0.15), transparent),
    radial-gradient(800px 400px at 90% 20%, rgba(0, 255, 240, 0.12), transparent),
    linear-gradient(180deg, var(--bg1), var(--bg2));
    color: #f2f3f7;
    /* === FIX: Add these properties to prevent tiling and cover the viewport === */
    background-repeat: no-repeat;
    background-size: cover; /* Ensures the background covers the entire element */
    background-attachment: fixed; /* Keeps the background fixed to the viewport */
}

.navbar.bling {
    box-shadow: 0 0 24px rgba(255, 230, 0, 0.2) inset;
}

.quiz {
    background: var(--card);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
}

.progress-wrapper {
    position: relative;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--neon2), var(--neon1));
    transition: width 500ms cubic-bezier(.2, .8, .2, 1);
}

.step {
    display: none;
}

.step.show {
    display: block;
}

.step-inner {
    position: relative;
}

.mega {
    font-weight: 800;
    letter-spacing: .5px;
    text-shadow: 0 2px 16px rgba(0, 0, 0, .4);
}

/* Wheel */
.wheel-wrapper {
    height: 280px;
    overflow: hidden;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, .1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .4) inset;
    background: rgba(255, 255, 255, .02);
}

.wheel {
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    padding: 8px 0;
}

.wheel:focus {
    outline: 2px dashed var(--neon2);
    outline-offset: 4px;
}

.wheel-item {
    padding: 12px 24px;
    font-size: 1.125rem;
    scroll-snap-align: center;
    text-align: center;
    opacity: .5;
    transition: transform .2s, opacity .2s;
}

.wheel-item.active {
    transform: scale(1.2);
    opacity: 1;
    color: var(--neon2);
    text-shadow: 0 0 18px rgba(0, 255, 240, .25);
}

/* Inputs */
.glam .input-group-text {
    background: rgba(255, 255, 255, .06);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .15);
}

.glam .form-control {
    background: rgba(255, 255, 255, .05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .15);
}

.glam .form-control::placeholder {
    color: rgba(255, 255, 255, .5);    color: rgba(255, 255, 255, .5);

}

/* Buttons */
.neon {
    box-shadow: 0 0 20px rgba(0, 255, 240, .2), inset 0 0 12px rgba(0, 255, 240, .15);
}

.wobble {
    animation: wobble 8s ease-in-out infinite;
}

.explode {
    position: relative;
}

.explode:disabled {
    opacity: .6;
}

/* Result */
.result-step {
    background: radial-gradient(600px 300px at 50% 0%, rgba(0, 255, 240, .08), transparent);
}

/* Confetti */
#confetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.confetto {
    position: absolute;
    width: 10px;
    height: 14px;
    background: var(--neon3);
    opacity: 0;
    transform: translate(-50%, -50%) rotate(0deg);
    animation: fall 2.4s ease-out forwards;
}

/* Motion */
@keyframes shimmer {
    to {
        background-position: -200% 0;
    }
}

@keyframes wobble {
    0%, 100% {
        transform: rotate(-1deg);
    }
    50% {
        transform: rotate(1deg);
    }
}

@keyframes fall {
    0% {
        opacity: 1;
    }
    100% {
        transform: translate(-50%, calc(-50% + 80vh)) rotate(360deg);
        opacity: 0;
    }
}

/* Transitions between steps */
.steps {
    perspective: 1200px;
}

.step-enter {
    animation: flipIn 700ms cubic-bezier(.2, .8, .2, 1) both;
}

.step-exit {
    animation: flipOut 500ms cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes flipIn {
    0% {
        opacity: 0;
        transform: rotateY(-40deg) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: rotateY(0) translateY(0);
    }
}

@keyframes flipOut {
    0% {
        opacity: 1;
        transform: rotateY(0) translateY(0);
    }
    100% {
        opacity: 0;
        transform: rotateY(40deg) translateY(-20px);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .wobble, .step-enter, .step-exit, .rainbow-text, .confetto {
        animation: none !important;
    }

    .progress-bar {
        transition: none;
    }
}

/* Contrast adjustments for dark theme */
/* Improve readability of muted text and labels on dark cards */
.quiz .text-muted {
    color: rgba(255, 255, 255, 0.82) !important;
}

.quiz .form-label, .quiz .form-text {
    color: rgba(255, 255, 255, 0.88);
}

/* Navbar subtitle on bg-dark */
.navbar.bling .navbar-text {
    color: #ffe066 !important;
}

/* OTT, self-aware, high-effort quiz styles */
:root {
    --neon1: #ff00c3;
    --neon2: #00fff0;
    --neon3: #ffe600;
    --bg1: #0b0b10;
    --bg2: #131321;
    --card: #1b1b2e;
}

@media (prefers-reduced-motion: no-preference) {
    .rainbow-text {
        background: linear-gradient(90deg, var(--neon1), var(--neon2), var(--neon3), var(--neon1));
        background-size: 300% 100%;
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        animation: shimmer 6s linear infinite;
    }
}

body.quiz-body {
    background: radial-gradient(1200px 600px at 10% 10%, rgba(255,0,195,0.15), transparent),
                radial-gradient(800px 400px at 90% 20%, rgba(0,255,240,0.12), transparent),
                linear-gradient(180deg, var(--bg1), var(--bg2));
    color: #f2f3f7;
    /* === FIX: Add these properties to prevent tiling and cover the viewport === */
    background-repeat: no-repeat;
    background-size: cover; /* Ensures the background covers the entire element */
    background-attachment: fixed; /* Keeps the background fixed to the viewport */
}

.navbar.bling {
    box-shadow: 0 0 24px rgba(255, 230, 0, 0.2) inset;
}

.quiz {
    background: var(--card);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
}

.progress-wrapper {
    position: relative;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--neon2), var(--neon1));
    transition: width 500ms cubic-bezier(.2, .8, .2, 1);
}

.step {
    display: none;
}

.step.show {
    display: block;
}

.step-inner {
    position: relative;
}

.mega {
    font-weight: 800;
    letter-spacing: .5px;
    text-shadow: 0 2px 16px rgba(0, 0, 0, .4);
}

/* Wheel */
.wheel-wrapper {
    height: 280px;
    overflow: hidden;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, .1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .4) inset;
    background: rgba(255, 255, 255, .02);
}

.wheel {
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    padding: 8px 0;
}

.wheel:focus {
    outline: 2px dashed var(--neon2);
    outline-offset: 4px;
}

.wheel-item {
    padding: 12px 24px;
    font-size: 1.125rem;
    scroll-snap-align: center;
    text-align: center;
    opacity: .5;
    transition: transform .2s, opacity .2s;
}

.wheel-item.active {
    transform: scale(1.2);
    opacity: 1;
    color: var(--neon2);
    text-shadow: 0 0 18px rgba(0, 255, 240, .25);
}

/* Inputs */
.glam .input-group-text {
    background: rgba(255, 255, 255, .06);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .15);
}

.glam .form-control {
    background: rgba(255, 255, 255, .05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .15);
}

.glam .form-control::placeholder {
    color: rgba(255, 255, 255, .5);
}

/* Buttons */
.neon {
    box-shadow: 0 0 20px rgba(0, 255, 240, .2), inset 0 0 12px rgba(0, 255, 240, .15);
}

.wobble {
    animation: wobble 8s ease-in-out infinite;
}

.explode {
    position: relative;
}

.explode:disabled {
    opacity: .6;
}

/* Result */
.result-step {
    background: radial-gradient(600px 300px at 50% 0%, rgba(0, 255, 240, .08), transparent);
}

/* Confetti */
#confetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.confetto {
    position: absolute;
    width: 10px;
    height: 14px;
    background: var(--neon3);
    opacity: 0;
    transform: translate(-50%, -50%) rotate(0deg);
    animation: fall 2.4s ease-out forwards;
}

/* Motion */
@keyframes shimmer {
    to {
        background-position: -200% 0;
    }
}

@keyframes wobble {
    0%, 100% {
        transform: rotate(-1deg);
    }
    50% {
        transform: rotate(1deg);
    }
}

@keyframes fall {
    0% {
        opacity: 1;
    }
    100% {
        transform: translate(-50%, calc(-50% + 80vh)) rotate(360deg);
        opacity: 0;
    }
}

/* Transitions between steps */
.steps {
    perspective: 1200px;
}

.step-enter {
    animation: flipIn 700ms cubic-bezier(.2, .8, .2, 1) both;
}

.step-exit {
    animation: flipOut 500ms cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes flipIn {
    0% {
        opacity: 0;
        transform: rotateY(-40deg) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: rotateY(0) translateY(0);
    }
}

@keyframes flipOut {
    0% {
        opacity: 1;
        transform: rotateY(0) translateY(0);
    }
    100% {
        opacity: 0;
        transform: rotateY(40deg) translateY(-20px);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .wobble, .step-enter, .step-exit, .rainbow-text, .confetto {
        animation: none !important;
    }

    .progress-bar {
        transition: none;
    }
}

/* Contrast adjustments for dark theme */
/* Improve readability of muted text and labels on dark cards */
.quiz .text-muted {
    color: rgba(255, 255, 255, 0.82) !important;
}

.quiz .form-label, .quiz .form-text {
    color: rgba(255, 255, 255, 0.88);
}

/* Navbar subtitle on bg-dark */
.navbar.bling .navbar-text {
    color: #ffe066 !important;
}

/* Additional contrast fixes across the quiz page (outside the .quiz card too) */
.quiz-body .text-muted {
    color: rgba(255, 255, 255, 0.82) !important;
}

.quiz-body .form-label, .quiz-body .form-text {
    color: rgba(255, 255, 255, 0.88);
}


/* Global dark-theme contrast enhancements (scoped to quiz page) */
/* Boost secondary variants that can appear too dim on dark backgrounds */
.quiz-body .text-secondary, .quiz .text-secondary,
.quiz-body .text-body-secondary, .quiz .text-body-secondary {
    color: rgba(255, 255, 255, 0.82) !important;
}

/* Ensure lead text is bright enough over the neon-dark background */
.quiz-body .lead {
    color: rgba(255, 255, 255, 0.9);
}

/* Make non-button links readable with clear hover/focus underline */
.quiz-body a:not(.btn) {
    color: #6fe7ff;
    text-decoration-color: rgba(111, 231, 255, 0.6);
}

.quiz-body a:not(.btn):hover,
.quiz-body a:not(.btn):focus {
    color: #9af1ff;
    text-decoration-color: currentColor;
}

/* Brighter placeholders inside glam inputs for readability */
.quiz .glam .form-control::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* Navbar brand on dark background should be full white for contrast */
.navbar.bling .navbar-brand {
    color: #ffffff !important;
}

/* Fix: brighten Step 1 heading and selected date text inside .quiz card */
.quiz {
    --bs-body-color: rgba(255, 255, 255, 0.92);
    --bs-heading-color: #FFFFFF;
    color: var(--bs-body-color);
}

.quiz h1, .quiz h2, .quiz h3, .quiz h4, .quiz h5, .quiz h6 {
    color: rgba(255, 255, 255, 0.82) !important; /* Change to the desired white color */
}

.quiz #dateSelected {
    color: #ffffff;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

.text-bg-warning {
    color: rgb(248, 249, 250); /* Change text color to light gray/white */
    background-color: rgba(0, 0, 0, 0); /* Make background transparent */
    border: 0.8px solid rgb(248, 249, 250); /* Add a thin light gray/white border */
    padding: 8px 16px; /* Adjust padding */
    font-size: 20px; /* Increase font size */
    font-weight: 400; /* Change font weight to normal */
    box-shadow: none; /* Remove the shadow */
}

/* Stronger, targeted contrast fixes for Step 1 heading and selected date */
/* Ensure the Step 1 heading is fully bright regardless of Bootstrap/card defaults */
.quiz .step[data-step="1"] .mega {
    color: #ffffff !important;
    text-shadow: 0 2px 16px rgba(0, 0, 0, .45);
}

/* Ensure the selected date text is bright and readable */
.quiz #dateSelected {
    color: #ffffff !important;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45) !important;
}
