/* Thank-you modal — dark, elegant, with check mark and smooth animation */

/* container overlay */
#thankyouScreen {
    display: none;
    /* kept hidden by your JS which toggles 'hidden' */
    align-items: center;
    justify-content: center;
    background: rgba(2, 6, 12, 0.65);
    backdrop-filter: blur(6px) saturate(120%);
    -webkit-backdrop-filter: blur(6px) saturate(120%);
    transition: opacity 280ms ease, visibility 280ms ease;
}

/* when JS shows it, it likely removes 'hidden' -> make it flex and animate */
#thankyouScreen:not(.hidden) {
    display: flex;
    opacity: 1;
    visibility: visible;
}

/* inner panel */
#thankyouScreen>div {
    width: 100%;
    max-width: 720px;
    background: linear-gradient(180deg, rgba(18, 20, 23, 0.96), rgba(12, 14, 16, 0.98));
    color: #e6eef8;
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 30px 80px rgba(3, 6, 12, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transform: translateY(14px) scale(.985);
    opacity: 0;
    transition: transform 360ms cubic-bezier(.2, .9, .25, 1), opacity 360ms ease;
    position: relative;
    overflow: visible;
}

/* animate in when visible */
#thankyouScreen:not(.hidden)>div {
    transform: translateY(0) scale(1);
    opacity: 1;
    animation: thankPop 420ms cubic-bezier(.2, .9, .25, 1);
}

@keyframes thankPop {
    0% {
        transform: translateY(14px) scale(.985);
        opacity: 0;
    }

    60% {
        transform: translateY(-6px) scale(1.02);
        opacity: 1;
    }

    100% {
        transform: translateY(0) scale(1);
    }
}

/* heading with subtle glow */
#thankyouScreen h2 {
    font-size: 1.6rem;
    margin: 0 0 6px 0;
    color: #fff;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    text-shadow: 0 6px 30px rgba(0, 0, 0, 0.6);
}

/* Check mark badge using pseudo-element on the h2 */
#thankyouScreen h2::before {
    content: "✓";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffd68a, #ff9a47);
    color: #0b1220;
    font-weight: 800;
    font-size: 26px;
    box-shadow: 0 10px 30px rgba(255, 138, 62, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transform: scale(.85) rotate(-6deg);
    opacity: 0;
    margin-right: 4px;
    transition: transform 420ms cubic-bezier(.2, .9, .25, 1), opacity 420ms ease;
}

/* animate check in sync with modal */
#thankyouScreen:not(.hidden) h2::before {
    transform: scale(1) rotate(0deg);
    opacity: 1;
    animation: checkBounce 520ms cubic-bezier(.2, .9, .25, 1);
}

@keyframes checkBounce {
    0% {
        transform: scale(.2) rotate(-20deg);
        opacity: 0;
    }

    60% {
        transform: scale(1.08) rotate(6deg);
        opacity: 1;
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* reference text */
#thankRef {
    color: #ffd68a;
    font-weight: 600;
    margin: 6px 0 12px 0;
    letter-spacing: 0.2px;
}

/* details box */
#thankDetails {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: 10px;
    color: #dbe9ff;
    max-height: 260px;
    overflow: auto;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

/* small rows inside details */
#thankDetails>div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 6px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.03);
}

#thankDetails>div:last-child {
    border-bottom: none;
}

/* left label & right value */
#thankDetails .label {
    color: rgba(230, 238, 248, 0.8);
    font-size: 0.92rem;
}

#thankDetails .value {
    color: #fff;
    font-weight: 600;
    text-align: right;
}

/* Close button (single action) */
#thankyouScreen .flex.justify-end {
    margin-top: 16px;
}

/* #closeThank button style */
#closeThank {
    background: linear-gradient(90deg, #111827, #1f2937);
    color: #e6eef8;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 0 8px 30px rgba(2, 6, 23, 0.6);
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

#closeThank:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 50px rgba(2, 6, 23, 0.7);
    background: linear-gradient(90deg, #151922, #232b36);
}

/* responsive tweaks */
@media (max-width:640px) {
    #thankyouScreen>div {
        padding: 18px;
        border-radius: 12px;
    }

    #thankyouScreen h2::before {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }

    #thankDetails {
        max-height: 200px;
        font-size: 0.95rem;
    }
}

/* small shimmer for the reference to add premium feel */
#thankRef {
    position: relative;
}

#thankRef::after {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 60%;
    height: 2px;
    transform: translateY(-50%) skewX(-12deg);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0));
    opacity: 0.9;
    animation: shimmer 2.2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-120%) translateY(-50%) skewX(-12deg);
        opacity: 0;
    }

    50% {
        transform: translateX(20%) translateY(-50%) skewX(-12deg);
        opacity: 0.9;
    }

    100% {
        transform: translateX(120%) translateY(-50%) skewX(-12deg);
        opacity: 0;
    }
}