:root {
    --primary: #ff4d6d; /* Rose Pink */
    --secondary: #fff0f3; /* Softest Pink */
    --accent: #ff8fa3; /* Pastel Pink */
    --text: #590d22; /* Deep Pink-Brown for text */
    --glass: rgba(255, 255, 255, 0.2);
    --glass-border: rgba(255, 182, 193, 0.3);
    --shadow: 0 15px 35px rgba(255, 77, 109, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background-color: var(--secondary);
    line-height: 1.6;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

h1, h2, h3 {
    font-family: 'Playfair Display', serif;
}

/* Canvas Background */
#heartCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #fff0f3 0%, #ffc1cf 100%);
}

/* Hero Section */
.hero-section {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: url('../images/hero.png') no-repeat center center/cover;
    position: relative;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 77, 109, 0.2); /* Pink tint overlay */
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 3rem;
    color: white;
}

.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.hero-content h1 {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 10px rgba(0,0,0,0.4);
    animation: fadeInDown 1.5s ease-out;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}


.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: 0.3s;
}

.btn:hover {
    background: var(--accent);
    transform: translateY(-3px);
}

.anniversary-section, .calendar-section, .story-section, .gallery-section, .letter-section, .reply-section, .surprise-section {
    padding: 3rem 10%; /* Reduced from 6rem */
    text-align: center;
}

.countdown-container, .calendar-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 3rem;
}

.countdown {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

.count-item {
    display: flex;
    flex-direction: column;
}

.count-item span {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
}

.calendar-header {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 2rem;
    font-family: 'Playfair Display', serif;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 2rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    font-weight: 500;
    transition: 0.3s;
    background: rgba(255, 255, 255, 0.3);
}

.calendar-day.anniversary {
    background: var(--primary);
    color: white;
    transform: scale(1.2);
    box-shadow: 0 0 15px var(--primary);
    position: relative;
}

.calendar-day.anniversary::after {
    content: '❤️';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 0.8rem;
}

.calendar-note {
    font-style: italic;
    color: var(--primary);
    font-size: 1.1rem;
}

/* Story Section */
.story-section {
    padding: 6rem 10%;
    text-align: center;
}

.section-title {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 3rem;
}

.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.story-card {
    padding: 2rem;
    transition: 0.3s;
}

.story-card:hover {
    transform: translateY(-10px);
}

.story-card h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

/* Gallery Section */
.gallery-section {
    padding: 6rem 10%;
    background: rgba(255, 255, 255, 0.5);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    height: 300px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 1rem;
    background: rgba(255, 77, 109, 0.8);
    color: white;
    text-align: center;
    transform: translateY(100%);
    transition: 0.3s;
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

/* Letter Section */
.letter-section {
    padding: 8rem 10%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.letter-container {
    perspective: 1000px;
}

.envelope {
    width: 400px;
    height: 250px;
    background: #fff0f3;
    position: relative;
    cursor: pointer;
    box-shadow: 0 15px 45px rgba(255, 77, 109, 0.2);
    transition: 0.5s;
    border: 2px solid #ff8fa3;
    border-radius: 0 0 15px 15px;
}

.envelope::before {
    content: '❤️';
    position: absolute;
    top: 45%;
    left: 45%;
    font-size: 2rem;
    z-index: 5;
    transition: 0.5s;
}

.envelope.open::before {
    opacity: 0;
    transform: scale(0);
}

.envelope.open {
    height: 500px;
    transform: translateY(-50px);
}

.flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffb3c1;
    clip-path: polygon(0 0, 50% 60%, 100% 0);
    z-index: 4;
    transition: 0.5s;
    border-radius: 15px 15px 0 0;
}

.envelope.open .flap {
    transform: rotateX(180deg);
    z-index: 1;
}

.letter {
    position: absolute;
    top: 20px;
    left: 10px;
    width: 380px;
    height: 210px;
    background: #fff9f9;
    padding: 2rem;
    z-index: 1;
    transition: 0.5s;
    overflow-y: auto; /* Added for scrollability */
    opacity: 0;
}

.envelope.open .letter {
    height: 460px;
    opacity: 1;
    z-index: 3;
}

.letter h2 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.signature {
    margin-top: 2rem;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: var(--primary);
    font-size: 1.5rem;
}

.instruction {
    margin-top: 2rem;
    color: var(--primary);
    font-weight: 500;
}

footer {
    padding: 3rem;
    text-align: center;
    background: var(--primary);
    color: white;
}

/* Bucket List Section */
.bucket-list-section {
    padding: 6rem 10%;
    text-align: center;
}

.bucket-list {
    max-width: 600px;
    margin: 3rem auto;
    padding: 2rem;
    text-align: left;
}

.bucket-item {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    color: var(--primary);
}

.bucket-item input[type="checkbox"] {
    margin-right: 1.5rem;
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Reply Section */
.reply-section {
    padding: 6rem 10%;
    background: rgba(255, 77, 109, 0.05);
    text-align: center;
}

.reply-container {
    max-width: 700px;
    margin: 3rem auto;
    padding: 3rem;
}

.reply-container p {
    margin-bottom: 2rem;
    font-size: 1.2rem;
    color: var(--primary);
}

#replyForm textarea {
    width: 100%;
    height: 150px;
    padding: 1.5rem;
    border-radius: 15px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.5);
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 2rem;
    resize: none;
    transition: 0.3s;
}

#replyForm textarea:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 10px rgba(139, 29, 61, 0.1);
}

/* Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Floating Music Toggle */
.music-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: 0.3s;
}

.music-toggle:hover {
    transform: scale(1.1) rotate(15deg);
}

/* Surprise Section */
.surprise-section {
    padding: 6rem 10%;
    text-align: center;
}

.quote-box {
    margin-top: 3rem;
    padding: 3rem;
    font-style: italic;
    font-size: 1.5rem;
    color: var(--primary);
}

/* Game Section */
.game-section {
    padding: 3rem 10%;
    text-align: center;
}

.game-container {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2rem;
}

.puzzle-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 2rem;
    perspective: 1000px;
}

.card {
    aspect-ratio: 1;
    background: #ffb3c1;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    box-shadow: 0 4px 10px rgba(255, 77, 109, 0.2);
}

.card.flipped {
    transform: rotateY(180deg);
}

.card::before {
    content: '❓';
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #ffb3c1;
    border-radius: 12px;
    color: white;
}

.card::after {
    content: attr(data-emoji);
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: white;
    border-radius: 12px;
    transform: rotateY(180deg);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.card.matched {
    animation: pulse 0.5s infinite alternate;
}

@keyframes pulse {
    from { transform: rotateY(180deg) scale(1); }
    to { transform: rotateY(180deg) scale(1.1); }
}

/* Kiss Confetti */
.kiss-emoji {
    position: fixed;
    font-size: 2rem;
    pointer-events: none;
    z-index: 2000;
    animation: fall 3s linear forwards;
}

@keyframes fall {
    0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

/* Lock Screen */
#lockScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #fff0f3 0%, #ffc1cf 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    text-align: center;
}

.lock-card {
    padding: 4rem;
    max-width: 500px;
}

.lock-card h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

#passwordInput {
    width: 100%;
    padding: 1rem;
    border-radius: 50px;
    border: 2px solid #ffb3c1;
    margin: 2rem 0;
    font-size: 1.1rem;
    text-align: center;
    outline: none;
    transition: 0.3s;
}

#passwordInput:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(255, 77, 109, 0.2);
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.8rem;
    }
    
    .hero-content h2 {
        font-size: 1.5rem;
    }

    .anniversary-section, .calendar-section, .story-section, .gallery-section, .letter-section, .reply-section, .surprise-section, .game-section {
        padding: 3rem 5%;
    }

    .countdown {
        gap: 1rem;
    }

    .count-item span {
        font-size: 2rem;
    }

    .calendar-grid {
        gap: 5px;
    }

    .calendar-day {
        font-size: 0.9rem;
    }

    .envelope {
        width: 300px;
        height: 200px;
    }

    .envelope.open {
        height: 700px;
    }

    .letter {
        width: 280px;
        height: 160px;
    }

    .envelope.open .letter {
        height: 650px;
    }

    .puzzle-grid {
        gap: 8px;
    }

    .card {
        font-size: 1.8rem;
    }

    .lock-card {
        padding: 2rem;
        width: 90%;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2.2rem;
    }

    .countdown {
        flex-wrap: wrap;
    }

    .envelope.open {
        height: 800px;
    }

    .letter {
        width: 240px;
        height: 160px;
    }
    
    .envelope.open .letter {
        height: 750px;
    }
    
    .card {
        font-size: 1.5rem;
    }
}
