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

:root {
    --primary-color: #ff4d6d;
    --secondary-color: #ff8fa3;
    --bg-gradient: linear-gradient(135deg, #fff0f3 0%, #ffccd5 100%);
    --text-color: #590d22;
    --white: #ffffff;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-gradient);
    height: 100vh;
    overflow: hidden;
    /* Prevent scrolling during animations */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    position: relative;
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #fff9c4 0%, #fff176 100%);
    /* Pastel yellow */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 1.5s ease-out;
}

.preloader-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.preloader-text {
    font-family: 'Dancing Script', cursive;
    font-size: 4rem;
    color: #ff6f00;
    animation: float 3s ease-in-out infinite;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Floating Sunflowers Animation */
.sunflower {
    position: absolute;
    font-size: 3rem;
    user-select: none;
    animation: floatAround 10s linear infinite;
    opacity: 0.8;
}

@keyframes floatAround {
    0% {
        transform: translateY(110vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.8;
    }

    90% {
        opacity: 0.8;
    }

    100% {
        transform: translateY(-10vh) rotate(360deg);
        opacity: 0;
    }
}

/* Falling Hearts Animation */
.heart-falling {
    position: absolute;
    top: -10vh;
    user-select: none;
    animation: fallDown 4s linear infinite;
    opacity: 0.8;
    z-index: 1;
}

@keyframes fallDown {
    0% {
        transform: translateY(0vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.9;
    }

    90% {
        opacity: 0.9;
    }

    100% {
        transform: translateY(110vh) rotate(360deg);
        opacity: 0;
    }
}

/* Main Content */
#main-content {
    display: none;
    /* Hidden initially */
    opacity: 0;
    transition: opacity 1s ease-in;
    text-align: center;
    width: 100%;
    height: 100vh;
    /* Full viewport height */
    flex-direction: column;
    justify-content: space-between;
    /* Space out content and slider */
    align-items: center;
    position: relative;
    z-index: 10;
    overflow-y: auto;
    /* Allow scroll if needed on small screens */
    padding-top: 20px;
}

.content-wrapper {
    flex: 1;
    /* Takes up available space */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    z-index: 20;
    padding-bottom: 20px;
    /* Space from slider */
}

/* Background Hearts */
.bg-heart {
    position: absolute;
    color: rgba(255, 77, 109, 0.2);
    font-size: 2rem;
    animation: floatUp 15s linear infinite;
    z-index: 0;
}

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

    50% {
        opacity: 0.5;
    }

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

.main-title {
    font-family: 'Dancing Script', cursive;
    font-size: 4.5rem;
    margin-bottom: 2rem;
    color: #d00000;
    text-shadow: 2px 2px 8px rgba(255, 180, 180, 0.6);
    z-index: 20;
    position: relative;
}

.buttons-container {
    display: flex;
    gap: 2rem;
    justify-content: center;
    z-index: 20;
    position: relative;
}

.btn {
    padding: 15px 40px;
    font-size: 1.5rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

.btn-yes {
    background-color: #ff4d6d;
    color: white;
}

.btn-yes:hover {
    transform: scale(1.1);
    background-color: #d90429;
    box-shadow: 0 15px 30px rgba(255, 77, 109, 0.4);
}

.btn-no {
    background-color: white;
    color: #ff4d6d;
    border: 2px solid #ff4d6d;
}

.btn-no:hover {
    transform: scale(1.1);
    background-color: #fff0f3;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* Popups */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.popup-content {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    max-width: 90%;
    width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: popup 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
}

.heart-popup {
    background: radial-gradient(circle, #ffccd5 0%, #fff0f3 100%);
    border: 4px solid #ff4d6d;
}

.error-popup {
    border: 4px solid #aaa;
}

@keyframes popup {
    0% {
        transform: scale(0);
        opacity: 0;
    }

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

.popup-text {
    font-size: 1.8rem;
    color: #800f2f;
    margin-bottom: 2rem;
    font-family: 'Dancing Script', cursive;
}

.btn-retry {
    background: #590d22;
    color: white;
    padding: 10px 30px;
    border-radius: 30px;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-retry:hover {
    transform: scale(1.05);
}

/* Slider */
.slider-container {
    position: relative;
    width: 100%;
    height: 400px;
    /* Taller */
    overflow: hidden;
    z-index: 5;
    background: rgba(255, 255, 255, 0.4);
    padding: 10px 0;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    margin-top: auto;
}

/* Ensure track and slide sizes are consistent */
.slider-track {
    display: flex;
    width: calc(280px * 12);
    /* 4 unique images * 3 sets = 12 total items */
    animation: scroll 20s linear infinite;
    /* continuous loop */
}

.slide {
    width: 280px;
    height: 380px;
    padding: 0 15px;
    flex-shrink: 0;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Fill frame for better clarity */
    border-radius: 15px;
    /* Removed strong shadow to look cleaner with contain */
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.15));
    transition: transform 0.3s ease;
    image-rendering: -webkit-optimize-contrast;
    /* Try to crisp up edges */
}

.slide img:hover {
    transform: scale(1.05);
    /* Only scale, don't pause */
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-200px * 4));
    }

    /* Move exactly 4 slides width */
}

/* Responsiveness */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
        margin-bottom: 1.5rem;
        padding: 0 10px;
    }

    .buttons-container {
        gap: 1rem;
    }

    .btn {
        padding: 12px 30px;
        font-size: 1.2rem;
    }

    /* Slider adjustments */
    .slider-container {
        height: 200px;
    }

    .slide {
        width: 160px;
        height: 180px;
    }

    .slider-track {
        width: calc(160px * 12);
    }

    @keyframes scroll {
        0% {
            transform: translateX(0);
        }

        100% {
            transform: translateX(calc(-160px * 4));
        }
    }
}

/* Very Small Screens */
@media (max-width: 480px) {
    .main-title {
        font-size: 2rem;
        /* Even smaller */
    }

    .buttons-container {
        flex-direction: column;
        /* Stack buttons vertically */
        width: 80%;
    }

    .btn {
        width: 60%;
        margin: 0.5rem auto;
    }

    .slider-container {
        height: 380px;
    }

    .slide {
        width: 250px;
        /* Nearly full screen width for focus */
        height: 350px;
    }

    .slider-track {
        width: calc(250px * 12);
    }

    @keyframes scroll {
        0% {
            transform: translateX(0);
        }

        100% {
            transform: translateX(calc(-250px * 4));
        }
    }
}