:root {
    --bg-color: #0d0408; /* Very dark romantic maroon/charcoal */
    --accent-red: #d92546;
    --accent-pink: #f28b9f;
    --text-primary: #ffffff;
    --text-secondary: #ffccd5;
    --font-heading: 'Cairo', sans-serif;
    --font-body: 'Cairo', sans-serif;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.6;
}

/* =========================================
   Intro Scene (Flower)
========================================= */
#intro-scene {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    background: radial-gradient(circle at center, #260a14 0%, var(--bg-color) 80%);
    transition: opacity 2s ease, visibility 2s;
}

#intro-scene.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.flower-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    cursor: pointer;
    transition: transform 0.3s ease;
    animation: float 4s ease-in-out infinite;
}

.flower-wrapper:hover {
    transform: scale(1.1);
}

.stem {
    position: absolute;
    bottom: -150px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 150px;
    background: linear-gradient(to bottom, #4caf50, #1b5e20);
    border-radius: 4px;
    z-index: 1;
}

.petal {
    position: absolute;
    width: 40px;
    height: 100px;
    background: #ffffff;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    transform-origin: bottom center;
    top: -50px;
    left: 30px;
    opacity: 0.95;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
    transition: all 2s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Closed state */
.p1 { transform: rotate(0deg) scaleY(0.5); }
.p2 { transform: rotate(60deg) scaleY(0.5); }
.p3 { transform: rotate(120deg) scaleY(0.5); }
.p4 { transform: rotate(180deg) scaleY(0.5); }
.p5 { transform: rotate(240deg) scaleY(0.5); }
.p6 { transform: rotate(300deg) scaleY(0.5); }

/* Blooming state (applied via JS) */
.flower-wrapper.bloom .petal {
    height: 120px;
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.8);
}
.flower-wrapper.bloom .p1 { transform: rotate(0deg) translateY(-20px) scaleY(1); }
.flower-wrapper.bloom .p2 { transform: rotate(60deg) translateY(-20px) scaleY(1); }
.flower-wrapper.bloom .p3 { transform: rotate(120deg) translateY(-20px) scaleY(1); }
.flower-wrapper.bloom .p4 { transform: rotate(180deg) translateY(-20px) scaleY(1); }
.flower-wrapper.bloom .p5 { transform: rotate(240deg) translateY(-20px) scaleY(1); }
.flower-wrapper.bloom .p6 { transform: rotate(300deg) translateY(-20px) scaleY(1); }

.center {
    position: absolute;
    width: 36px;
    height: 36px;
    background: #ffd700;
    border-radius: 50%;
    top: 32px;
    left: 32px;
    z-index: 10;
    box-shadow: inset 0 0 12px #ff8f00, 0 0 25px #ffd700;
    border: 2px solid #ffb300;
}

.hint-text {
    margin-top: 180px;
    font-size: 1.1rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: pulseText 2s infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulseText {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* =========================================
   Main Content Layout
========================================= */
#main-content {
    min-height: 100vh;
    padding: 0 5%;
    display: none; /* Changed to block via JS */
    opacity: 0;
    transition: opacity 2s ease;
    padding-bottom: 100px;
}

#main-content.visible {
    display: block;
    opacity: 1;
    animation: fadeInPage 2s forwards;
}

@keyframes fadeInPage {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero {
    text-align: center;
    padding: 15vh 0 10vh;
}

h1 {
    font-family: var(--font-heading);
    font-size: 4rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #fff, var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* =========================================
   Memories Section
========================================= */
.memories {
    display: flex;
    flex-direction: column;
    gap: 8rem;
    max-width: 1000px;
    margin: 0 auto;
}

.memory-card {
    display: flex;
    align-items: center;
    gap: 4rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.memory-card.reverse {
    flex-direction: row-reverse;
}

.image-wrapper {
    flex: 1;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.image-wrapper:hover img {
    transform: scale(1.05);
}

.card-content {
    flex: 1;
}

.card-content h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--accent-pink);
}

.card-content p {
    font-size: 1.1rem;
    color: #e0e0e0;
}

/* =========================================
   Finale & Video
========================================= */
.finale {
    margin-top: 10rem;
    display: flex;
    justify-content: center;
}

.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 4rem 2rem;
    text-align: center;
    max-width: 800px;
    width: 100%;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.glass-panel h2 {
    font-family: var(--font-heading);
    font-size: 3rem;
    margin-bottom: 0.5rem;
    color: var(--accent-red);
}

.video-desc {
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-size: 1.2rem;
}

.video-wrapper {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    margin-bottom: 3rem;
    background: #000;
}

.video-wrapper video {
    width: 100%;
    display: block;
    outline: none;
}

.final-message p {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 2rem;
}

.forgive-btn {
    background: linear-gradient(45deg, var(--accent-red), #ff4d6d);
    color: white;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(217, 37, 70, 0.3);
}

.forgive-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(217, 37, 70, 0.5);
}

/* =========================================
   Scroll Reveal Animations
========================================= */
.hidden-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.show-scroll {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   Responsive
========================================= */
@media (max-width: 768px) {
    h1 { font-size: 2.8rem; }
    .memory-card, .memory-card.reverse {
        flex-direction: column;
        gap: 2rem;
        padding: 1.5rem;
    }
    .card-content h2 { font-size: 2rem; }
    .glass-panel { padding: 2rem 1rem; }
    .glass-panel h2 { font-size: 2.2rem; }
}

/* =========================================
   Surprise Engagement Scene
========================================= */
#surprise-scene {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #3a000d 0%, #000000 100%);
    z-index: 200;
    display: none; /* Changed via JS */
    opacity: 0;
    transition: opacity 3s ease-in-out;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

#surprise-scene.visible {
    display: flex;
    opacity: 1;
}

.ring-container {
    animation: floatRing 4s ease-in-out infinite;
}

.ring-image {
    width: 300px;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.3);
    margin-bottom: 2rem;
    transition: transform 0.5s ease;
}

.ring-image:hover {
    transform: scale(1.05);
    box-shadow: 0 0 70px rgba(255, 215, 0, 0.5);
}

.proposal-text h1 {
    font-size: 4.5rem;
    color: #ffd700; /* Gold */
    background: none;
    -webkit-text-fill-color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    margin-bottom: 1rem;
    animation: pulseText 2s infinite;
}

.proposal-text p {
    font-size: 1.5rem;
    color: #fff;
    max-width: 600px;
    margin: 0 auto;
}

.distance-text {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
    font-weight: 300;
    letter-spacing: 1px;
}

@keyframes floatRing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* =========================================
   Responsive Design (Optimized for iPhone 16 / Mobile)
========================================= */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
        width: 100%;
    }

    .main-header h1 {
        font-size: 2.2rem;
        padding: 0 1rem;
    }

    .main-header p {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .memory-card {
        flex-direction: column !important;
        max-width: 95%;
        margin: 2rem auto;
        padding: 1rem;
    }

    .memory-img {
        width: 100% !important;
        height: 250px !important;
        margin-bottom: 1.5rem;
        border-radius: 15px;
    }

    .memory-content {
        padding: 0 !important;
        text-align: center;
    }

    .memory-card h3 {
        font-size: 1.4rem;
    }

    .memory-card p {
        font-size: 0.95rem;
    }

    .video-container {
        padding: 1.5rem;
    }

    .video-container h2 {
        font-size: 1.8rem;
    }

    .ring-image {
        width: 200px;
        margin-bottom: 1rem;
    }

    .proposal-text h1 {
        font-size: 2.5rem;
        margin-bottom: 0.5rem;
    }

    .distance-text {
        font-size: 1.1rem;
        margin-bottom: 0.2rem;
    }

    .proposal-text p {
        font-size: 1rem;
        padding: 0 1rem;
        max-width: 320px;
    }

    .button-group {
        flex-direction: column;
        gap: 0.8rem;
        width: 100%;
        max-width: 280px;
        margin: 0 auto 1.5rem auto;
    }

    .forgive-btn, .reject-btn {
        width: 100%;
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }

    .timer-display {
        font-size: 0.85rem;
        padding: 0.8rem 1rem;
        margin-bottom: 1.5rem;
        line-height: 1.8;
    }

    .timer-number {
        font-size: 1rem;
    }

    .password-lock {
        padding: 1.2rem;
        margin-top: 2rem;
        width: 95%;
    }

    #video-password {
        width: 100%;
        font-size: 1rem;
    }

    #unlock-btn {
        width: 100%;
        padding: 0.8rem;
    }

    #surprise-scene {
        padding: 1rem;
    }
}

/* =========================================
   Timer Display
========================================= */
.timer-display {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--text-secondary);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    border-radius: 15px;
    display: inline-block;
    direction: rtl;
}

.timer-number {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--accent-red);
    padding: 0 0.2rem;
}

/* =========================================
   Final Question & Buttons
========================================= */
.question-text {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.reject-btn {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--glass-border);
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: all 0.3s ease;
}

.reject-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

.hidden-msg {
    display: none;
    opacity: 0;
    font-size: 1.1rem;
    color: var(--accent-pink);
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--glass-bg);
    border-radius: 15px;
    border: 1px solid var(--accent-red);
    transition: opacity 0.5s ease;
}

.hidden-msg.show {
    display: block;
    animation: fadeInMsg 0.5s forwards;
}

@keyframes fadeInMsg {
    to { opacity: 1; }
}

/* =========================================
   Password Lock Styles
========================================= */
.password-lock {
    margin-top: 3rem;
    background: var(--glass-bg);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    animation: fadeIn 1s ease 6s forwards; /* Appear after some time */
    opacity: 0;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.password-lock p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

#video-password {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    outline: none;
    font-family: var(--font-body);
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 1rem;
    width: 250px;
}

#unlock-btn {
    background: var(--accent-red);
    color: white;
    border: none;
    padding: 0.8rem 2.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

#unlock-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(217, 37, 70, 0.4);
}

.secret-video-active .password-lock {
    display: none;
}

/* Rose Petal Animation */
.petal-particle {
    position: fixed;
    top: -10%;
    z-index: 150;
    pointer-events: none;
    width: 15px;
    height: 15px;
    background: radial-gradient(circle at 30% 30%, #ff4d6d, #d92546);
    border-radius: 50% 0 50% 50%;
    transform: rotate(45deg);
    opacity: 0.8;
}

@keyframes fall {
    0% {
        transform: translateY(0) rotate(45deg) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(96vh) rotate(720deg) translateX(50px);
        opacity: 0.8;
    }
}
