@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400;700&family=Outfit:wght@300;400;600&family=Great+Vibes&display=swap');

:root {
    --primary-red: #ff3366;
    --deep-red: #c41e3a;
    --gold: #ffd700;
    --soft-pink: #ff8fa3;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    font-family: 'Outfit', sans-serif;
    color: var(--text-white);
    overflow: hidden;
    perspective: 1200px;
}

/* Background Overlay for Sparkles/Hearts */
#hearts-container,
#fireflies-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Main Container with Glassmorphism */
.container {
    position: relative;
    z-index: 10;
    padding: 60px 40px;
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.05);
    /* Lighter glass */
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(255, 51, 102, 0.1);
    text-align: center;
    width: 90%;
    max-width: 600px;
    transform-style: preserve-3d;
    transition: transform 0.2s ease-out;
}

/* The Fixed Heart Shape */
.heart-wrapper {
    position: relative;
    width: 100px;
    height: 90px;
    margin: 0 auto 100px;
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* Glowing ring around the heart */
.heart-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 180px;
    height: 180px;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255, 51, 102, 0.3);
    border-radius: 50%;
    animation: pulseRing 2s infinite;
}

@keyframes pulseRing {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

.heart {
    position: relative;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #ff3366, #ff0054);
    transform: rotate(-45deg) scale(1);
    animation: heartbeat 1.2s infinite cubic-bezier(0.21, 0.61, 0.35, 1);
    box-shadow: -10px 10px 50px rgba(255, 51, 102, 0.6),
        inset -5px 5px 15px rgba(255, 255, 255, 0.4);
    filter: drop-shadow(0 0 20px rgba(255, 51, 102, 0.4));
    z-index: 2;
}

.heart::before,
.heart::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    background: inherit;
    border-radius: 50%;
    box-shadow: inherit;
    inset: inherit;
}

.heart::before {
    top: -50px;
    left: 0;
}

.heart::after {
    top: 0;
    left: 50px;
}

/* Glowing Inner Text */
h1 {
    font-family: 'Dancing Script', cursive;
    font-size: 4.5rem;
    margin: 20px 0;
    background: linear-gradient(to bottom, #fff 30%, var(--gold) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(255, 51, 102, 0.4));
    line-height: 1.2;
    font-weight: 700;
}

.subtitle {
    font-size: 1.8rem;
    font-weight: 300;
    margin-top: 10px;
    font-family: 'Great Vibes', cursive;
    opacity: 0.9;
    letter-spacing: 2px;
}

/* Interactive Buttons */
.interactive-area {
    margin-top: 40px;
}

.glass-btn {
    position: relative;
    padding: 15px 35px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    color: white;
    font-size: 1.2rem;
    font-weight: 500;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin: 10px;
    backdrop-filter: blur(10px);
}

.glass-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
}

.glass-btn:hover {
    transform: translateY(-5px) scale(1.05);
    background: rgba(255, 51, 102, 0.3);
    border-color: var(--primary-red);
    box-shadow: 0 20px 40px rgba(255, 51, 102, 0.3);
}

.glass-btn:hover::after {
    opacity: 1;
}

/* Love Meter */
.love-meter-container {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Outfit', sans-serif;
}

.love-meter-container p {
    font-size: 1.1rem;
    color: var(--soft-pink);
    margin-bottom: 10px;
}

#love-percent {
    font-weight: 700;
    color: var(--gold);
    font-size: 1.3rem;
}

.meter-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.meter-fill {
    width: 99%;
    height: 100%;
    background: linear-gradient(to right, #ff3366, #ffd700);
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(255, 51, 102, 0.5);
    animation: fillMeter 5s ease-out forwards;
}

@keyframes fillMeter {
    from {
        width: 0;
    }

    to {
        width: 99.9%;
    }
}

.reason-text {
    min-height: 40px;
    margin-top: 30px;
    font-size: 1.5rem;
    font-family: 'Great Vibes', cursive;
    color: var(--gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    opacity: 0;
    transition: all 0.5s ease;
}

/* Floating Hearts & Cursor Trail */
.floating-heart {
    position: absolute;
    color: var(--primary-red);
    filter: drop-shadow(0 0 10px var(--primary-red));
    user-select: none;
    z-index: 1;
}

.cursor-trail {
    position: fixed;
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 0 15px var(--gold);
    animation: particleFade 0.8s forwards;
}

/* Modal Styling */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
    backdrop-filter: blur(15px);
}

.modal.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(135deg, #1a0b14, #3a0e1c);
    padding: 60px 40px;
    border-radius: 30px;
    max-width: 600px;
    width: 90%;
    border: 1px solid var(--deep-red);
    box-shadow: 0 0 50px rgba(255, 51, 102, 0.4);
    position: relative;
    transform: scale(0.8) rotateX(10deg);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.visible .modal-content {
    transform: scale(1) rotateX(0);
}

.letter-body {
    font-family: 'Dancing Script', cursive;
    font-size: 1.8rem;
    line-height: 1.8;
    color: #ffd1dc;
    text-align: left;
}

.close-btn {
    position: absolute;
    top: 25px;
    right: 30px;
    font-size: 2.5rem;
    cursor: pointer;
    color: var(--gold);
    transition: 0.3s;
}

/* Animations */
@keyframes heartbeat {
    0% {
        transform: rotate(-45deg) scale(0.9);
    }

    20% {
        transform: rotate(-45deg) scale(1.1);
    }

    40% {
        transform: rotate(-45deg) scale(1);
    }

    60% {
        transform: rotate(-45deg) scale(1.05);
    }

    100% {
        transform: rotate(-45deg) scale(0.9);
    }
}

@keyframes drawPulse {
    0% {
        stroke-dashoffset: 1000;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        stroke-dashoffset: 0;
        opacity: 0;
    }
}

.pulse-container {
    margin: 20px auto;
    width: 250px;
    height: 60px;
}

.pulse-svg {
    width: 100%;
    height: 100%;
}

.pulse-path {
    fill: none;
    stroke: #ff3366;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawPulse 3s linear infinite;
    filter: drop-shadow(0 0 10px #ff3366);
}

@keyframes floatUp {
    0% {
        transform: translateY(110vh) scale(0);
        opacity: 0;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        transform: translateY(-20vh) scale(1.5);
        opacity: 0;
    }
}

@keyframes particleFade {
    to {
        opacity: 0;
        transform: scale(3) translate(var(--mx), var(--my));
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(-10px, 0);
    }

    75% {
        transform: translate(10px, 0);
    }
}

/* Responsive */
@media (max-width: 600px) {
    h1 {
        font-size: 3.5rem;
    }

    .container {
        padding: 30px 20px;
    }

    .heart-wrapper {
        width: 100px;
        height: 100px;
    }

    .heart {
        width: 90px;
        height: 90px;
    }

    .heart::before,
    .heart::after {
        width: 90px;
        height: 90px;
    }

    .heart::before {
        top: -45px;
    }

    .heart::after {
        left: -45px;
    }
}