/* =============================================================
   00) Base, Tokens & Theming
   ============================================================= */

:root {
    --bg-grad-1: #0b1220;
    --bg-grad-2: #070b10;
    --card-bg: #121417;
    --ink: #e5e7eb;
    --muted: #9ca3af;
    --border: #2a2f36;

    --shadow: 0 8px 24px rgba(0, 0, 0, .35);

    --btn-outline: #3a3f46;
    --chk-accent: #7ec8ff;
    --chk-ring: rgba(126, 200, 255, .35);

    --page-pad: clamp(16px, 3vw, 28px);
    --card-pad: clamp(16px, 3vw, 24px);
}

html[data-theme="light"] {
    --bg-grad-1: #ffffff;
    --bg-grad-2: #f5f7fa;
    --card-bg: #ffffff;
    --ink: #111827;
    --muted: #555;
    --border: #e5e7eb;
    --shadow: 0 6px 24px rgba(15, 23, 42, .08);
    --btn-outline: #cfd4dc;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Motion reduction */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* =============================================================
   01) Page Layout
   ============================================================= */

html,
body {
    height: 100%;
}

body {
    margin: 0;
    padding: var(--page-pad);
    color: var(--ink);
    background:
        radial-gradient(1200px 700px at 10% 5%, #0b1220 0%, #0a0f17 55%, #070b10 100%),
        linear-gradient(135deg, var(--bg-grad-1), var(--bg-grad-2));
}

.app-box {
    width: clamp(360px, 92vw, 980px);
    margin: clamp(16px, 4vh, 48px) auto;
    padding: var(--card-pad);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.app-subtitle {
    color: var(--muted);
}

/* Mobile full width */
@media (max-width: 640px) {
    body {
        padding: 0;
        min-height: 100svh;
    }

    .app-box {
        width: 100%;
        margin: 0 auto;
        border-radius: 0;
        border: none;
        box-shadow: none;
        padding: clamp(16px, 3.5vw, 24px);
        min-height: 100svh;
    }
}

/* =============================================================
   02) Buttons
   ============================================================= */

/* Universal theming */
.theme-toggle,
.clear-btn {
    border: 1px solid var(--btn-outline);
    background: transparent;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Theme toggle circle */
.theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
}

/* Small clear button */
.clear-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 1.2rem;
}

/* Surprise Me */
#btnSurprise {
    background: #212529;
    border-color: #212529;
    color: #fff;
}

#btnSurprise:hover {
    background: #343a40;
    transform: scale(1.03);
}

/* Create Playlist enabled */
#btnToSpotify:not([disabled]) {
    background-color: var(--chk-accent) !important;
    border-color: var(--chk-accent) !important;
    color: #0a0f14 !important;
    font-weight: 600;
    box-shadow: 0 0 12px var(--chk-ring);
    transition: all .25s;
}

#btnToSpotify:not([disabled]):hover {
    filter: brightness(1.07);
    box-shadow: 0 0 18px var(--chk-ring);
    transform: translateY(-1px);
}

/* Create Playlist disabled */
#btnToSpotify[disabled] {
    background: #212529 !important;
    border-color: #212529 !important;
    color: #aaa !important;
    cursor: not-allowed;
}

/* =============================================================
   03) Text Inputs
   ============================================================= */

textarea.form-control {
    background: #000;
    color: #fff;
    border: 2px solid #6366f1;
    border-radius: 8px;
    padding: .75rem;
    font-size: 16px !important;
}

textarea.form-control:focus {
    background: #000 !important;
    border-color: #444 !important;
    box-shadow: none !important;
}

#user-request[readonly] {
    background: #000 !important;
    color: #fff !important;
}

/* =============================================================
   04) Results List
   ============================================================= */

#results {
    color: var(--ink) !important;
}

#results .list-group-item {
    background: transparent !important;
    border: 0 !important;
    padding: 12px 16px;
}

#results .list-group-item+.list-group-item {
    border-top: 1px solid var(--border);
}

/* =============================================================
   05) Bundles Dropdown
   ============================================================= */

.dropdown-menu {
    min-width: 240px;
    border-radius: 10px;
    background: #0e151c;
    border: 1px solid var(--border);
}

.dropdown-item {
    color: var(--ink) !important;
    background: transparent;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* =============================================================
   06) Bundle Buttons (Your two buttons)
   ============================================================= */

.btn-bundle {
    background-color: var(--btn-outline) !important;
    border: 1px solid var(--border) !important;
    color: var(--ink) !important;
}

.btn-bundle:hover {
    background-color: var(--btn-outline) !important;
}


/* =============================================================
   07) Footer
   ============================================================= */

.app-footer {
    background: linear-gradient(to top, #0a0b0d, #0f1012);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    color: #c4c6ca;
    font-size: .9rem;
    line-height: 1.6;
    border-radius: 12px;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, .35);
}

.app-footer .spotify-disclaimer {
    color: #8e9095;
}

/* =============================================================
   08) Crate Image
   ============================================================= */

.crate-image-wrapper {
    margin-top: 60px !important;
    margin-bottom: 100px !important;
    text-align: center;
}

.crate-image {
    width: 920px;
    max-width: 95%;
    border-radius: 14px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, .45);
    margin: 0 auto;
    display: block;
}

/* =============================================================
   09) Mobile Fixes
   ============================================================= */

/* @media (max-width: 700px) {
    #ownedBundlesBtn {
        margin-bottom: 8px !important;
    }
} */

/* =============================================================
   10) Square Modal Cleanup
   ============================================================= */

#squareModal .modal-content {
    background: #fff !important;
    color: #000 !important;
    border: none !important;
    border-radius: 20px !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .25) !important;
}

/* Kill Square debug iframe */
iframe[sandbox*="allow-popups"] {
    display: none !important;
}

#buyBundleBtn.btn-bundle-active {
    background-color: rgba(255, 255, 255, 0.14) !important;
    border-color: rgba(255, 255, 255, 0.20) !important;
    color: var(--ink) !important;
}

.dropdown-item.disabled {
    opacity: 0.35 !important;
    pointer-events: none !important;
}

/* Base style (normal state) */
.btn-bundle {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.20) !important;
    color: var(--ink) !important;
    backdrop-filter: blur(3px);
    transition: background-color 120ms ease, border-color 120ms ease;
}

/* Hover state */
.btn-bundle:hover {
    background-color: rgba(255, 255, 255, 0.14) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
}

/* Active flash state (like Bootstrap’s default) */
.btn-bundle:active,
.btn-bundle.active {
    background-color: rgba(255, 255, 255, 0.22) !important;
    border-color: rgba(255, 255, 255, 0.30) !important;
    transition: background-color 40ms ease-out;
    /* quicker flash */
}

.active-bundle-hint {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    font-weight: 700;
    text-transform: uppercase;
    color: #1DB954;
    opacity: 0.9;
}

#user-request[readonly] {
    pointer-events: none;
    background: #000;
    color: #fff;
}

#results * {
    opacity: 1 !important;
    color: var(--ink) !important;
}

/* Crate image — reduced ~65% */
.crate-img {
    width: 30%;
    max-width: 120px;
    border-radius: 12px;
    display: block;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* Sparkle layer (scaled to match smaller crate) */
.sparkles {
    position: absolute;
    top: -20%;
    left: -20%;
    width: 140%;
    height: 140%;
    pointer-events: none;
    z-index: 3;

    background-image: radial-gradient(circle,
            rgba(255, 255, 255, 0.9) 0%,
            rgba(255, 255, 255, 0) 55%),
        radial-gradient(circle,
            rgba(255, 255, 200, 0.8) 0%,
            rgba(255, 255, 200, 0) 55%);

    background-size: 4px 4px, 7px 7px;
    background-position:
        25% 40%,
        60% 55%;

    animation:
        sparkleFloat 4s infinite ease-in-out,
        sparkleBlink 2.8s infinite ease-in-out alternate;

    opacity: 0.75;
}

/* Clean, normal-sized crate */
.crate-img {
    width: 38%;
    max-width: 180px;
    display: block;
    margin: 0 auto 16px auto;
    border-radius: 12px;

    /* make sure no filter or background is causing artifacts */
    background: none !important;
    filter: none !important;
    image-rendering: auto !important;
}

/* Smooth fade-out / fade-in for invisible page refresh */
html {
    opacity: 1;
    transition: opacity 0.25s ease-in-out;
}

html.fade-out {
    opacity: 0;
}

/* Footer link style — no underline, soft blue-violet */
footer a,
a.footer-link,
.footer a,
#footer-links a {
    text-decoration: none;
    color: #8ab4ff;
    transition: color 0.2s ease, opacity 0.2s ease;
}

/* Hover — brighter, subtle pop */
footer a:hover,
a.footer-link:hover,
.footer a:hover,
#footer-links a:hover {
    color: #b7c9ff;
    opacity: 0.95;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    background: #a00;
    /* default red */
    box-shadow: 0 0 6px rgba(255, 0, 0, 0.5);
}

.status-dot.online {
    background: #00c853;
    /* green */
    box-shadow: 0 0 6px rgba(0, 255, 80, 0.7);
}

.pulse-arrow {
    color: #b084ff;
    /* soft neon purple */
    margin-right: 8px;
    opacity: 0.8;
    animation: arrowPulse 1.8s ease-in-out infinite;
    transition: opacity 0.4s ease;
}

.pulse-arrow.hidden {
    opacity: 0;
    animation: none;
}

@keyframes arrowPulse {
    0% {
        opacity: 0.25;
        transform: translateX(0);
    }

    50% {
        opacity: 1;
        transform: translateX(4px);
    }

    100% {
        opacity: 0.25;
        transform: translateX(0);
    }
}

.faq-mark {
    color: var(--accent);
    /* purple (#6d44ff) */
    font-weight: 900;
    /* SUPER bold */
    font-size: 1.7em;
    /* bigger than text */
    margin-right: 8px;
    line-height: 0.8;
    text-shadow: 0 0 12px rgba(109, 68, 255, 0.75),
        0 0 4px rgba(109, 68, 255, 0.5);
}

.faq a:hover,
.contact a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--accent2);
    filter: drop-shadow(0 0 6px rgba(109, 68, 255, 0.7));
    /* purple glow */
}

.max-bundles-content {
    background: radial-gradient(circle at center, #00ffb0 0%, #00cc77 40%, #003a1f 100%);
    border: none;
    padding: 40px;
    text-align: center;
    color: #fff;
    box-shadow: 0 0 60px rgba(0, 255, 150, 0.5);
    border-radius: 18px;
}

.max-bundles-inner {
    position: relative;
}

.max-bundle-crate {
    width: 160px;
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 20px rgba(0, 255, 140, 0.8));
}

.max-bundles-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 10px;
    text-shadow: 0 0 12px rgba(0, 255, 150, 0.7);
}

.max-bundles-subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: 20px;
}

.main-box {
    position: relative;
    /* required so footer anchors INSIDE this box */
}

.footer-copy {
    position: absolute;
    left: 20px;
    bottom: 18px;
    font-size: 0.85rem;
    color: #bbb;
    opacity: 0.9;
    pointer-events: none;
}

.faq-email {
    color: #b9a9ff;
    /* your pale purple */
    text-decoration: none;
    /* remove underline */
    font-weight: 600;
    /* optional — looks nice */
}

.faq-email:hover {
    color: #d2c6ff;
    /* lighter on hover */
    text-decoration: none;
    /* still no underline */
}

.faq-email {
    color: #b9a9ff;
    /* your pale purple */
    text-decoration: none;
    /* remove underline */
    font-weight: 600;
    /* optional — looks nice */
}

.faq-email:hover {
    color: #d2c6ff;
    /* lighter on hover */
    text-decoration: none;
    /* still no underline */
}

/* wrapper breaks out of any parent flex constraints */
.faq-image-wrapper {
    width: 100%;
    display: block;
    text-align: center;

    /* resets parent's height rules */
    height: auto !important;
    min-height: 0 !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
}

/* image sizing */
.faq-hero-img {
    width: 150px !important;
    /* <-- 50% of your original approx */
    height: auto !important;
    max-width: none !important;

    display: inline-block !important;
    object-fit: contain !important;

    /* critical: ignore parent's flexbox */
    flex: 0 0 auto !important;
}

.toast-message {
    font-size: 0.9rem;
    max-width: 90%;
    text-align: center;
}

.bundle-label {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    /* light gray for readability */
    font-size: 0.95rem;
}

.lock-icon {
    font-size: 1rem;
    opacity: 0.7;
    margin-left: 4px;
    vertical-align: middle;
}

.bundle-label {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
}

.update-bundles-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.3s ease;
}

.update-bundles-btn:hover {
    color: #1DB954;
    /* Spotify green hover */
}

.lock-icon {
    font-size: 1rem;
    opacity: 0.85;
    transition: transform 0.3s ease, color 0.3s ease;
}

.lock-icon.synced {
    color: #1DB954;
    /* green success */
    transform: rotate(360deg) scale(1.2);
}

textarea.form-control {
    background: #000;
    color: #f5f6f7;
    /* lighter text for readability */
    border: 2px solid #6366f1;
    border-radius: 8px;
    padding: .75rem;
    font-size: 16px !important;
}

textarea.form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
    /* lighter placeholder text */
}


/* Make dropdown menu exactly the same width as its button */
.dropdown-menu {
    width: 100% !important;
    min-width: 100% !important;
}

/* Make text inside menu right-aligned */
#ownedBundlesMenu .dropdown-item {
    text-align: right;
}