/* ============================================
   Valentine Proposal Website - style.css
   Whimsical, hand-drawn, pastel pink aesthetic
   ============================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    overflow-y: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

html::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

body {
    font-family: 'Quicksand', sans-serif;
    height: 100vh;
    height: 100dvh;
    background: #f472a0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: background 1s ease;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

/* --- Fade in on page load --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Z-INDEX MAP
   Decorations:        0
   Main container:     1
   Moving NO button:   2
   Toast message:      3
   Confetti canvas:   10
   Success overlay:   20
   Confetti on top:   25
   ============================================ */

/* --- Decorations Layer --- */
.decorations {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Hide SVG decorations for cleaner look */
.deco-heart-chain,
.deco-scribble-heart,
.deco-love-script {
    display: none;
}

/* Heart chain - top */
.deco-heart-chain {
    position: absolute;
    top: 8px;
    left: 0;
    width: 100%;
    height: 50px;
}

/* Scribble heart - bottom left */
.deco-scribble-heart {
    position: absolute;
    bottom: -10px;
    left: -20px;
    width: clamp(120px, 18vw, 200px);
    height: auto;
}

/* Love script - bottom right */
.deco-love-script {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: clamp(160px, 22vw, 280px);
    height: auto;
}

/* Cupid silhouette */
.deco-cupid {
    position: absolute;
    top: 25%;
    right: 15%;
    width: clamp(80px, 10vw, 120px);
    height: auto;
    opacity: 0.4;
}

/* Mini floating hearts */
.mini-heart {
    position: absolute;
    pointer-events: none;
    animation: floatMiniHeart 5s ease-in-out infinite alternate;
    will-change: transform;
}

@keyframes floatMiniHeart {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.6;
    }

    50% {
        transform: translateY(-12px) scale(1.15);
        opacity: 0.9;
    }

    100% {
        transform: translateY(4px) scale(0.95);
        opacity: 0.5;
    }
}

/* Scattered petals */
.petal {
    position: absolute;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #f4a0b5 30%, transparent 70%);
    border-radius: 50% 0 50% 50%;
    opacity: 0.35;
    animation: driftPetal 7s ease-in-out infinite alternate;
    will-change: transform;
}

@keyframes driftPetal {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }

    50% {
        transform: translate(15px, -20px) rotate(45deg) scale(1.3);
    }

    100% {
        transform: translate(-10px, 10px) rotate(-30deg) scale(0.8);
    }
}

/* --- Main Container --- */
.container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 24px 16px;
    text-align: center;
}

.card {
    background: #ffffff;
    border-radius: 28px;
    padding: 40px 36px 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    animation: fadeInUp 1.2s ease forwards;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.1);
    max-width: 680px;
    width: 92vw;
}

/* --- Teddy Bear --- */
.teddy-scene {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 280px;
    overflow: visible;
    animation: gentleBounce 3s ease-in-out infinite;
}

.card-text-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.teddy-emoji {
    font-size: clamp(90px, 25vw, 140px);
    line-height: 1;
    filter: drop-shadow(0 6px 20px rgba(196, 149, 106, 0.25));
    z-index: 1;
}

.teddy-bouquet {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(36px, 10vw, 55px);
    animation: bouquetBob 2s ease-in-out infinite alternate;
    z-index: 2;
}

@keyframes bouquetBob {
    from {
        transform: translateX(-50%) translateY(0) rotate(-3deg);
    }

    to {
        transform: translateX(-50%) translateY(-4px) rotate(3deg);
    }
}

/* Floating hearts around teddy */
.teddy-float-hearts {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.tf-heart {
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: clamp(18px, 5vw, 26px);
    transform: translate(var(--x, 0), var(--y, 0));
    animation: tfFloat 3s ease-in-out infinite alternate;
    animation-delay: var(--delay, 0s);
    will-change: transform, opacity;
}

@keyframes tfFloat {
    0% {
        opacity: 0.4;
        transform: translate(var(--x, 0), var(--y, 0)) scale(0.8);
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
        transform: translate(var(--x, 0), calc(var(--y, 0) - 14px)) scale(1.2);
    }
}

@keyframes gentleBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* Hugging bears in success overlay */
.hug-scene {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(200px, 50vw, 300px);
    height: clamp(150px, 40vw, 220px);
    animation: hugWobble 1s ease-in-out infinite alternate;
}

.hug-bear {
    font-size: clamp(70px, 20vw, 110px);
    line-height: 1;
    filter: drop-shadow(0 6px 20px rgba(255, 255, 255, 0.3));
}

.hug-bear-left {
    transform: scaleX(1) rotate(-5deg);
    margin-right: -20px;
    z-index: 1;
}

.hug-bear-right {
    transform: scaleX(-1) rotate(5deg);
    margin-left: -20px;
}

@keyframes hugWobble {
    from {
        transform: translateY(0) rotate(-2deg);
    }

    to {
        transform: translateY(-10px) rotate(2deg);
    }
}

/* --- Heading --- */
.main-text {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(1.8rem, 5.5vw, 3.2rem);
    font-weight: 700;
    color: #c45c78;
    line-height: 1.4;
    max-width: 500px;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.main-text.fade-out {
    opacity: 0;
    transform: translateY(-20px);
}

.heart-inline {
    display: inline-block;
    animation: heartBeat 1.5s ease-in-out infinite;
    font-size: 0.8em;
}

.sub-text {
    font-family: 'Quicksand', sans-serif;
    font-size: clamp(0.95rem, 2.5vw, 1.15rem);
    color: #b0b0b0;
    font-weight: 500;
    margin-top: -8px;
}

@keyframes heartBeat {

    0%,
    100% {
        transform: scale(1);
    }

    15% {
        transform: scale(1.15);
    }

    30% {
        transform: scale(1);
    }

    45% {
        transform: scale(1.1);
    }

    60% {
        transform: scale(1);
    }
}

/* --- Buttons --- */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    align-items: center;
}

.btn {
    font-family: 'Quicksand', sans-serif;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    font-weight: 700;
    min-height: 48px;
    padding: 14px 32px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    outline: none;
    letter-spacing: 0.5px;
}

/* YES button */
.btn-yes {
    background: linear-gradient(135deg, #f47a8f 0%, #ee5a6f 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(238, 90, 111, 0.3);
    min-width: 140px;
}

.btn-yes:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(238, 90, 111, 0.4);
}

.btn-yes:active {
    transform: scale(0.97);
}

@keyframes pulse {

    0%,
    100% {
        box-shadow:
            0 4px 18px rgba(228, 69, 116, 0.35),
            0 0 30px rgba(244, 105, 138, 0.15);
    }

    50% {
        box-shadow:
            0 4px 28px rgba(228, 69, 116, 0.55),
            0 0 50px rgba(244, 105, 138, 0.3);
    }
}

/* NO button */
.btn-no {
    background: linear-gradient(135deg, #f47a8f 0%, #ee5a6f 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(238, 90, 111, 0.3);
    min-width: 140px;
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-no:hover {
    background: linear-gradient(135deg, #f08a9c 0%, #e84d65 100%);
}

.btn-no.moving {
    position: fixed;
    z-index: 2;
    transition-property: left, top;
    transition-timing-function: ease-out;
    /* transition-duration is set by JS */
}

.btn-no.shrink-1 {
    font-size: 0.8rem;
    padding: 10px 22px;
}

.btn-no.shrink-2 {
    font-size: 0.7rem;
    padding: 8px 18px;
}

/* --- Toast Message --- */
.toast-msg {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #ffffff;
    color: #c45c78;
    font-weight: 700;
    font-size: clamp(0.8rem, 2.2vw, 0.95rem);
    padding: 10px 22px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 3;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.toast-msg.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- Confetti Canvas --- */
#confetti-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 25;
    pointer-events: none;
}

/* --- Success Overlay --- */
.success-overlay {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ff758c 0%, #ff7eb3 40%, #ff9a9e 70%, #fad0c4 100%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

.success-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.success-content {
    background: #ffffff;
    border-radius: 28px;
    padding: 40px 36px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 90vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: scaleIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transform: scale(0);
}

.success-overlay.active .success-content {
    transform: scale(1);
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.success-text {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(1.8rem, 6vw, 3.2rem);
    font-weight: 700;
    color: #c45c78;
    line-height: 1.4;
    max-width: 600px;
}

.success-sub {
    font-family: 'Quicksand', sans-serif;
    font-size: clamp(1rem, 3vw, 1.25rem);
    font-weight: 600;
    color: #999;
    line-height: 1.4;
    max-width: 500px;
}

.next-page-btn {
    text-decoration: none;
    margin-top: 8px;
    display: inline-block;
}

/* --- Floating hearts (success state) --- */
.float-heart {
    position: fixed;
    z-index: 19;
    font-size: 2rem;
    pointer-events: none;
    animation: riseHeart linear forwards;
    will-change: transform, opacity;
}

@keyframes riseHeart {
    0% {
        opacity: 1;
        transform: translateY(0) scale(0.5) rotate(0deg);
    }

    100% {
        opacity: 0;
        transform: translateY(-100vh) scale(1.5) rotate(360deg);
    }
}

/* --- Disabled state --- */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* --- Desktop enhancements --- */
@media (min-width: 768px) {
    .card {
        flex-direction: row;
        gap: 40px;
        padding: 44px 48px;
        max-width: 720px;
    }

    .teddy-scene {
        max-width: 240px;
        flex-shrink: 0;
    }

    .card-text-area {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 24px;
    }

    .btn {
        padding: 16px 40px;
        font-size: 1.15rem;
    }
}

/* --- Very small screens --- */
@media (max-width: 420px) {
    .card {
        padding: 28px 18px 28px;
        width: 92vw;
        gap: 20px;
    }

    .teddy-scene {
        max-width: 200px;
    }

    .main-text {
        font-size: 1.4rem;
    }

    .btn {
        padding: 12px 24px;
        font-size: 0.85rem;
    }

    .btn-no {
        max-width: 200px;
    }

    .success-text {
        font-size: 1.6rem;
    }

    .success-sub {
        font-size: 0.95rem;
    }

    .hug-scene {
        width: 80vw;
        max-width: 250px;
    }

    .deco-love-script,
    .deco-scribble-heart {
        display: none;
    }
}

/* --- Extra small screens (iPhone SE etc.) --- */
@media (max-width: 360px) {
    .card {
        padding: 20px 14px 22px;
        gap: 16px;
    }

    .teddy-scene {
        max-width: 170px;
    }

    .main-text {
        font-size: 1.25rem;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.8rem;
        min-height: 42px;
    }
}