/* =========================================
   GLOBAL THEME
   ========================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Quicksand', sans-serif;
    min-height: 100vh; color: #4a4a4a; overflow-x: hidden;
    background: linear-gradient(120deg, #ff9a9e, #fecfef, #e0c3fc, #fad0c4);
    background-size: 300% 300%;
    animation: breathe 10s ease infinite alternate;
}
@keyframes breathe {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

h1 { font-family: 'Playfair Display', serif; font-size: 3.5rem; color: #c2185b; margin-top: 50px; text-align: center; text-shadow: 2px 2px 0px rgba(255,255,255,0.4); }
h2 { font-family: 'Playfair Display', serif; font-size: 2.2rem; color: #880e4f; margin: 60px 0 30px 0; text-align: center; position: relative; }
h2::after { content: ''; display: block; width: 60px; height: 3px; background: white; margin: 10px auto 0; border-radius: 2px; }
.subtitle { text-align: center; color: #666; font-size: 1.1rem; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 20px; }

/* MAIN CONTAINER BLUR TRANSITION */
.container { 
    max-width: 800px; margin: auto; padding: 20px; padding-bottom: 50px; 
    transition: filter 1s ease, opacity 1s ease;
}
.container.blur-out {
    filter: blur(10px) grayscale(0.5);
    opacity: 0.5;
    pointer-events: none;
}
.content-hidden { display: none; }

/* LOCK SCREEN */
#lock-screen { position: fixed; inset: 0; background: rgba(255,255,255,0.85); backdrop-filter: blur(15px); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 9999; transition: transform 0.8s ease-in-out; }
#lock-screen.hidden { transform: translateY(-100%); pointer-events: none; }
input { padding: 12px 25px; border-radius: 50px; border: 2px solid #ff4b6e; outline: none; text-align: center; margin-top: 20px; font-size: 1.2rem; }

/* TIMER */
#love-timer { display: flex; justify-content: center; gap: 15px; margin: 30px 0; flex-wrap: wrap; }
.time-box { background: rgba(255,255,255,0.4); backdrop-filter: blur(5px); border: 1px solid white; border-radius: 15px; padding: 15px; min-width: 80px; text-align: center; }
.time-box span { display: block; font-size: 1.8rem; font-weight: 700; color: #c2185b; font-family: 'Playfair Display', serif; }

/* TIMELINE */
.timeline-container { position: relative; max-width: 800px; margin: 0 auto; padding: 20px 0; }
.timeline-container::after { content: ''; position: absolute; width: 4px; background: white; top: 0; bottom: 0; left: 50%; margin-left: -2px; }
.timeline-card { padding: 10px 40px; position: relative; width: 50%; animation: fadeInUp 1s ease; }
.left { left: 0; text-align: right; }
.right { left: 50%; text-align: left; }
.timeline-card::after { content: ''; position: absolute; width: 20px; height: 20px; right: -10px; background: white; border: 4px solid #ff4b6e; top: 15px; border-radius: 50%; z-index: 1; }
.right::after { left: -10px; }
.content { padding: 20px 25px; background: rgba(255,255,255,0.7); backdrop-filter: blur(10px); border-radius: 15px; border: 1px solid white; }
.date-badge { display: inline-block; background: #ff4b6e; color: white; padding: 4px 12px; border-radius: 20px; font-size: 0.8rem; margin-bottom: 5px; }

/* 3D FLIP GALLERY */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; perspective: 1000px; }
.gallery-card { width: 100%; height: 250px; position: relative; transform-style: preserve-3d; transition: transform 0.8s; cursor: pointer; }
.gallery-card.flipped { transform: rotateY(180deg); }
.gallery-front, .gallery-back { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 15px; box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.gallery-front { background: linear-gradient(45deg, #ff9a9e, #fad0c4); display: flex; align-items: center; justify-content: center; border: 4px solid white; }
.gallery-front::after { content: '❤️'; font-size: 3rem; opacity: 0.5; }
.gallery-back { transform: rotateY(180deg); background: white; overflow: hidden; }
.gallery-back img { width: 100%; height: 100%; object-fit: cover; }

/* BUCKET LIST - UPDATED WITH HEART POP */
.bucket-item { background: rgba(255,255,255,0.6); padding: 15px; margin-bottom: 10px; border-radius: 12px; display: flex; align-items: center; cursor: pointer; transition: 0.3s; border: 1px solid white; }
.bucket-item:hover { transform: translateX(5px); background: rgba(255,255,255,0.9); }
.checkbox { width: 24px; height: 24px; border: 2px solid #ff4b6e; border-radius: 6px; margin-right: 15px; display: flex; align-items: center; justify-content: center; background: white; transition: 0.3s; }

/* Bucket Item Done State */
.bucket-item.done .checkbox { 
    background: #ff4b6e; 
    border-color: #ff4b6e; 
    animation: heartPop 0.4s ease-out; /* Pop animation */
}
.bucket-item.done .checkbox::after { 
    content: '\f004'; /* FontAwesome Heart Unicode */
    font-family: "Font Awesome 6 Free"; 
    font-weight: 900; 
    color: white; 
    font-size: 12px; 
}
.bucket-item.done span { 
    text-decoration: none; /* Removed line-through */
    color: #c2185b;        /* Changed to pink */
    font-weight: 700;      /* Made bold */
    opacity: 1; 
}

/* SCRATCH CARD */
.scratch-container { display: flex; flex-direction: column; align-items: center; margin: 30px 0; }
.scratch-card { position: relative; width: 300px; height: 150px; border-radius: 15px; overflow: hidden; box-shadow: 0 10px 20px rgba(0,0,0,0.15); }
.scratch-content { position: absolute; inset: 0; background: white; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; border: 2px dashed #ff4b6e; }
canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }

/* ENVELOPE */
.envelope-container { height: 380px; display: flex; align-items: flex-end; justify-content: center; margin-top: 50px; perspective: 1000px; }
.envelope-wrapper { width: 300px; height: 200px; position: relative; cursor: pointer; transition: all 0.4s ease; }
.envelope-wrapper:hover { transform: translateY(-5px); }
.envelope-body { position: absolute; inset: 0; border-radius: 0 0 20px 20px; z-index: 10; background: linear-gradient(135deg, rgba(255,255,255,0.4), rgba(255,255,255,0.1)); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.5); border-top: none; }
.envelope-pocket { position: absolute; inset: 0; z-index: 20; pointer-events: none; clip-path: polygon(0 0, 50% 55%, 100% 0, 100% 100%, 0 100%); background: linear-gradient(to bottom right, rgba(255,255,255,0.6), rgba(255,255,255,0.25)); backdrop-filter: blur(5px); border: 1px solid rgba(255,255,255,0.6); border-radius: 0 0 20px 20px; }
.envelope-flap { position: absolute; inset: 0; z-index: 30; transform-origin: top; transition: 0.6s ease; clip-path: polygon(0 0, 50% 55%, 100% 0); background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(255,255,255,0.3)); backdrop-filter: blur(5px); border-top: 1px solid rgba(255,255,255,0.8); }
.envelope-wrapper.open .envelope-flap { transform: rotateX(180deg); z-index: 1; opacity: 0.6; }
.heart-seal { position: absolute; top: 58%; left: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; background: #c2185b; clip-path: path('M20 35.8l-2.9-2.6C6.8 23.8 0 17.6 0 10 0 4.4 4.4 0 10 0c3.1 0 6 1.5 8.1 3.8 2.1-2.3 5-3.8 8.1-3.8 5.6 0 10 4.4 10 10 0 7.6-6.8 13.8-17.1 23.2L20 35.8z'); z-index: 40; cursor: pointer; animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(1.1); } 100% { transform: translate(-50%, -50%) scale(1); } }
.envelope-wrapper.open .heart-seal { opacity: 0; }
.card-stack { position: absolute; bottom: 0; left: 20px; right: 20px; height: 150px; pointer-events: none; z-index: 5; }


/* FINAL LIQUID GLASS CARD */
.final-section { display: flex; justify-content: center; margin-top: 80px; }
.liquid-glass-card { position: relative; width: 90%; max-width: 450px; padding: 50px 30px; border-radius: 25px; text-align: center; background: rgba(255,255,255,0.65); backdrop-filter: blur(25px) saturate(180%); -webkit-backdrop-filter: blur(25px) saturate(180%); border: 1px solid rgba(255,255,255,0.8); box-shadow: 0 20px 50px rgba(0,0,0,0.15), inset 0 0 0 1px rgba(255,255,255,0.5); }
.glowing-text { font-family: 'Playfair Display', serif; font-size: 2.5rem; color: #c2185b; margin-bottom: 40px; text-shadow: 0 2px 10px rgba(194, 24, 91, 0.2); }
.btn-group { position: relative; height: 60px; display: flex; justify-content: center; gap: 20px; }
.yes-btn { padding: 12px 40px; font-size: 1.2rem; border: none; border-radius: 50px; background: linear-gradient(135deg, #ff4b6e, #c2185b); color: white; box-shadow: 0 10px 20px rgba(255, 75, 110, 0.4); cursor: pointer; transition: transform 0.2s; position: relative; z-index: 5; }
.no-btn { padding: 12px 30px; font-size: 1.2rem; border: none; border-radius: 50px; background: #f0f0f0; color: #666; cursor: pointer; position: relative; transition: 0.2s; }
.bubble { position: absolute; border-radius: 50%; background: linear-gradient(135deg, #ff9a9e, #fad0c4); opacity: 0.6; z-index: -1; filter: blur(20px); }
.b1 { width: 100px; height: 100px; top: -30px; left: -30px; animation: float 6s infinite alternate; }
.b2 { width: 80px; height: 80px; bottom: -20px; right: -20px; background: #a18cd1; animation: float 5s infinite alternate-reverse; }
@keyframes float { from { transform: translate(0,0); } to { transform: translate(20px, 20px); } }
/* UPDATED ENVELOPE CARD STYLE */
.letter-card {
    position: absolute;
    inset: 0;
    
    /* Layout & Scrolling Logic */
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Aligns text to top so it doesn't cut off */
    align-items: center;
    
    /* Appearance */
    background: white;
    color: #c2185b;
    font-family: 'Playfair Display', serif;
    font-size: 1rem;       /* Reduced size (was 1.4rem) to fit more text */
    line-height: 1.5;      /* Adds breathing room between lines */
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
    
    /* Animation Properties */
    cursor: pointer;
    transition: 0.6s;
    
    /* Scroll Settings */
    padding: 25px 15px;    /* Padding: Top/Bottom 25px, Left/Right 15px */
    text-align: center;
    overflow-y: auto;      /* Enables scrolling for long text */
    white-space: pre-wrap; /* Respects paragraphs/newlines */
    
    /* HIDE SCROLLBAR (Make it look clean) */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

/* Hide Scrollbar for Chrome/Safari */
.letter-card::-webkit-scrollbar {
    display: none;
}

/* CELEBRATION OVERLAY & LONG MESSAGE FIX */
#celebration-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none;
    transition: opacity 1s ease;
}
#celebration-overlay.visible {
    opacity: 1; pointer-events: auto;
}

/* FIX: SCROLLABLE CARD (INVISIBLE SCROLLBAR) */
#celebration-overlay .liquid-glass-card {
    max-height: 80vh;        /* Limits height to 80% of screen */
    overflow-y: auto;        /* Allows scrolling */
    
    /* HIDE SCROLLBAR (Firefox) */
    scrollbar-width: none;  
    
    /* HIDE SCROLLBAR (IE and Edge) */
    -ms-overflow-style: none; 
    
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* HIDE SCROLLBAR (Chrome, Safari, Opera) */
#celebration-overlay .liquid-glass-card::-webkit-scrollbar {
    display: none;
}

/* FIX: MESSAGE FORMATTING */
#celebration-text {
    font-size: 1.1rem !important; 
    line-height: 1.6;
    text-align: justify;
    white-space: pre-wrap;
    width: 100%;
    margin-bottom: 20px;
    text-shadow: none;
    color: #880e4f;
}

/* Ensure the heart icon stays at the bottom */
#celebration-overlay .fa-heart {
    flex-shrink: 0;
    margin-top: auto;
}


/* EXTRAS */
.music-btn { position: fixed; bottom: 25px; right: 25px; width: 50px; height: 50px; background: white; border-radius: 50%; display: flex; justify-content: center; align-items: center; color: #ff4b6e; box-shadow: 0 5px 15px rgba(0,0,0,0.2); cursor: pointer; z-index: 100; }
.fly-right { transform: translate(300px, -200px) rotate(45deg) !important; opacity: 0; }
.fly-left { transform: translate(-300px, -200px) rotate(-45deg) !important; opacity: 0; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.floating-hearts { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; overflow: hidden; }
.heart-bg { position: absolute; bottom: -10vh; color: rgba(255, 75, 110, 0.2); animation: floatUp linear infinite; }
@keyframes floatUp { 0% { transform: translateY(0) rotate(0deg); opacity: 1; } 100% { transform: translateY(-110vh) rotate(360deg); opacity: 0; } }

/* Heart Pop Animation */
@keyframes heartPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

.instruction { text-align: center; width: 100%; display: block; margin-top: 20px; color: #880e4f; opacity: 0.8; font-size: 0.9rem; }
@media screen and (max-width: 600px) { h1 { font-size: 2.5rem; } .timeline-container::after { left: 31px; } .timeline-card { width: 100%; padding-left: 70px; padding-right: 25px; } .timeline-card::after { left: 21px; } .right::after { left: 21px; } .left, .right { text-align: left; } .gallery-grid { grid-template-columns: 1fr; } }

/* SCROLL HINT ANIMATION */
.scroll-hint {
    color: #ff4b6e;      /* Pink color */
    font-size: 1.2rem;   /* Small size */
    margin-top: 15px;    /* Space between text and arrow */
    opacity: 0.6;        /* Make it subtle/slight */
    animation: bounce 2s infinite;
    width: 100%;
    text-align: center;
    flex-shrink: 0;      /* Prevents it from getting squished */
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-3px); }
}