:root {
    --primary-color: #ff4d6d;
    --secondary-color: #ffe5ec;
    --text-color: #590d22;
    --font-heading: 'Dancing Script', cursive;
    --font-body: 'Nunito', sans-serif;
}

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

body {
    background-color: var(--secondary-color);
    font-family: var(--font-body);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    /* changed from height to min-height for scrolling if needed */
    overflow: hidden;
    /* Prevent scrolling during slideshow */
    position: relative;
    /* z-index removed from body to keep stacking context clean */
}

/* Floating Memory Elements */
#petals-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    /* Keep behind text but visible */
    overflow: hidden;
}

.memory-float {
    position: absolute;
    font-size: 1.5rem;
    animation: floatMemory 15s linear infinite;
    /* Increased duration for elegance */
    opacity: 0;
    filter: drop-shadow(0 2px 4px rgba(255, 77, 109, 0.3));
    will-change: transform, opacity;
    /* Performance optimization */
}

@keyframes floatMemory {
    0% {
        transform: translateY(105vh) rotate(0deg) scale(0.6);
        opacity: 0;
    }

    10% {
        opacity: 0.6;
        /* Softer fade in */
    }

    50% {
        transform: translateY(50vh) rotate(15deg) scale(1) translateX(20px);
        opacity: 0.8;
    }

    90% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(-20vh) rotate(-15deg) scale(0.7) translateX(-15px);
        opacity: 0;
    }
}

.container {
    width: 90%;
    max-width: 600px;
    height: 80vh;
    /* Contain within viewport */
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Center content vertically */
    padding: 20px;
    position: relative;
    z-index: 10;
    /* Ensure content is strictly above floating elements */
    text-align: center;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

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

    50% {
        transform: translateY(-10px);
    }
}



/* Slideshow */
.slideshow {
    width: 100%;
    /* flex: 1; Removed so that it doesn't push the button down */
    /* Take up available space */
    display: grid;
    place-items: center;
    position: relative;
}

.slide {
    grid-area: 1 / 1;
    opacity: 0;
    transition: opacity 0.8s ease-in-out, transform 0.8s ease;
    transform: scale(0.9);
    pointer-events: none;
    /* Prevent interaction with hidden slides */
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.slide.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.photo-frame {
    background: white;
    padding: 15px;
    /* Polaroid style border */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: rotate(-2deg);
    margin-bottom: 20px;
    max-width: 100%;
    width: fit-content;
}

.photo-frame img {
    max-width: 100%;
    max-height: 40vh;
    /* Limit height to fit mobile screens */
    width: auto;
    display: block;
    object-fit: cover;
    border-radius: 2px;
}

.caption {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-top: 15px;
    color: var(--primary-color);
    padding: 0 10px;
}

/* Controls */
.controls {
    margin-top: 20px;
    padding-bottom: 20px;
}

.nav-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1.1rem;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(255, 77, 109, 0.3);
    transition: transform 0.2s;
    font-family: var(--font-body);
    font-weight: bold;
}

.nav-btn:hover {
    transform: translateY(-2px);
    background: #e60050;
}

/* Proposal Section */
.proposal {
    display: none;
    /* Explicitly hidden */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    animation: fadeIn 1s;
}

.proposal.active {
    display: flex;
}

.main-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 30px;
    line-height: 1.2;
}

.action-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    /* Wrap buttons on very small screens */
    justify-content: center;
    position: relative;
    /* For absolute positioning context if needed */
    width: 100%;
    min-height: 50px;
    /* Space for buttons to move */
}

.action-btn {
    padding: 15px 30px;
    font-size: 1.2rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    min-width: 120px;
}

.yes {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 77, 109, 0.4);
}

.yes:hover {
    transform: scale(1.1);
    background-color: #d60045;
}

.no {
    background-color: #ddd;
    color: #666;
}

/* Celebration Overlay */
.celebration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
    text-align: center;
}

.celebration.show {
    opacity: 1;
    pointer-events: auto;
}

.celebration h1 {
    font-family: var(--font-heading);
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.celebration p {
    font-size: 1.5rem;
}

/* Utilities */
.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login Page */
.login-container {
    height: auto;
    min-height: auto;
    padding: 40px 30px;
    max-width: 450px;
}

.login-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-title {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    color: var(--primary-color);
    margin-bottom: 8px;
    line-height: 1.2;
}

.login-subtitle {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 30px;
}

.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.input-label {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-input {
    width: 100%;
    padding: 14px 18px;
    font-size: 1rem;
    font-family: var(--font-body);
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid rgba(255, 77, 109, 0.2);
    border-radius: 15px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

.login-input::placeholder {
    color: rgba(89, 13, 34, 0.35);
}

.login-input:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 4px rgba(255, 77, 109, 0.1);
}

.login-btn {
    margin-top: 10px;
    width: 100%;
    padding: 14px 25px;
    font-size: 1.1rem;
}

.error-message {
    color: var(--primary-color);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .container {
        width: 85%;
        height: 75vh;
        padding: 15px;
    }

    .main-title {
        font-size: 2rem;
    }

    .caption {
        font-size: 1.5rem;
    }

    .photo-frame img {
        max-height: 35vh;
    }

    .celebration h1 {
        font-size: 3rem;
    }

    .login-container {
        padding: 30px 20px;
    }

    .login-title {
        font-size: 2.2rem;
    }
}