/* CSS Styling */
:root {
    --bg-color: #FFF8F0;
    --text-color: #444;
    --primary-color: #E8A0BF;
    --line-color: #d3d3d3;
    --heading-font: 'Playfair Display', serif;
    --body-font: 'Lato', sans-serif;
}

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    /* Hide scrollbar for all browsers */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

html::-webkit-scrollbar {
    display: none; /* WebKit browsers (Chrome, Safari, Edge) */
}

body {
    font-family: var(--body-font);
    background:
        radial-gradient(1200px 800px at 10% -10%, rgba(232, 160, 191, 0.15), transparent 60%),
        radial-gradient(1000px 700px at 110% 10%, rgba(191, 160, 232, 0.12), transparent 60%),
        radial-gradient(900px 600px at 50% 120%, rgba(160, 232, 191, 0.10), transparent 60%),
        var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    /* Hide scrollbar for all browsers */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

body::-webkit-scrollbar {
    display: none; /* WebKit browsers (Chrome, Safari, Edge) */
}

/* Hide scrollbar for all elements */
* {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

*::-webkit-scrollbar {
    display: none; /* WebKit browsers (Chrome, Safari, Edge) */
}

/* Critical CSS for above-the-fold content */
.header {
    text-align: center;
    padding: 60px 0;
    position: relative;
    z-index: 1;
}

.header h1 {
    font-family: var(--heading-font);
    font-size: 3.2rem;
    color: transparent;
    background: linear-gradient(135deg, #E8A0BF, #BFA0E8, #A0E8BF);
    -webkit-background-clip: text;
    background-clip: text;
    margin-bottom: 16px;
    text-shadow: 0 4px 20px rgba(232,160,191,0.3);
    letter-spacing: -0.02em;
}

.header-subtitle {
    font-size: 1.2rem;
    color: #7a6071;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.header-description {
    font-size: 1.1rem;
    color: #7a6071;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.5;
    margin: 0 0 20px 0;
    text-shadow: 0 2px 8px rgba(122,96,113,0.15);
}

.timeline-title {
    font-family: var(--heading-font);
    font-size: 2.5rem;
    color: transparent;
    background: linear-gradient(135deg, #E8A0BF, #BFA0E8);
    -webkit-background-clip: text;
    background-clip: text;
    text-align: center;
    margin-bottom: 16px;
    text-shadow: 0 4px 20px rgba(232,160,191,0.3);
}

.timeline-description {
    text-align: center;
    font-size: 1.1rem;
    color: #7a6071;
    margin-bottom: 40px;
    line-height: 1.6;
}

/* ===== Simple Music Player ===== */
.simple-music-player {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.play-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #E8A0BF, #BFA0E8);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(232,160,191,0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 30px rgba(232,160,191,0.5);
}

.play-btn:active {
    transform: scale(0.95);
}

.play-btn.playing {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 8px 25px rgba(232,160,191,0.4); }
    50% { box-shadow: 0 8px 25px rgba(232,160,191,0.6), 0 0 0 10px rgba(232,160,191,0.1); }
    100% { box-shadow: 0 8px 25px rgba(232,160,191,0.4); }
}

/* Mobile responsive for simple music player */
@media screen and (max-width: 768px) {
    .simple-music-player {
        top: 15px;
        right: 15px;
    }
    
    .play-btn {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
}

@media screen and (max-width: 430px) {
    .simple-music-player {
        top: 10px;
        right: 10px;
    }
    
    .play-btn {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
        box-shadow: 0 6px 20px rgba(232,160,191,0.4);
    }
}


#content-root {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* Content reveal helper */
.content-hidden {
    opacity: 0;
}
.content-visible {
    animation: contentFadeIn 900ms ease forwards;
}
@keyframes contentFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Fullscreen Loader */
.loader {
    position: fixed;
    inset: 0;
    background:
        /* Sticker hearts (layer 1) */
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23E8A0BF' opacity='0.16'><path d='M12 21s-6.716-4.632-9.193-7.109C.93 11.014 1.214 7.6 3.757 6.157 5.86 4.986 8.3 5.62 9.6 7.38L12 10.5l2.4-3.12c1.3-1.76 3.74-2.394 5.843-1.223 2.543 1.443 2.827 4.857.95 7.734C18.716 16.368 12 21 12 21z'/></svg>") repeat 0 0 / 120px 120px,
        /* Sticker hearts (layer 2) */
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23BFA0E8' opacity='0.14'><path d='M12 21s-6.716-4.632-9.193-7.109C.93 11.014 1.214 7.6 3.757 6.157 5.86 4.986 8.3 5.62 9.6 7.38L12 10.5l2.4-3.12c1.3-1.76 3.74-2.394 5.843-1.223 2.543 1.443 2.827 4.857.95 7.734C18.716 16.368 12 21 12 21z'/></svg>") repeat 60px 60px / 140px 140px,
        /* Soft ambient gradients */
        radial-gradient(800px 500px at 20% 20%, rgba(232,160,191,0.15), transparent 60%),
        radial-gradient(700px 400px at 80% 30%, rgba(191,160,232,0.14), transparent 60%),
        rgba(255, 248, 240, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loader-box {
    text-align: center;
    background: #ffffff;
    border-radius: 12px;
    padding: 28px 32px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    border: 1px solid rgba(232,160,191,0.2);
    max-width: 680px;
    width: calc(100% - 48px);
    position: relative;
    overflow: hidden;
    animation: gentlePulse 2.6s ease-in-out infinite;
}

.loader-step {
    font-family: var(--heading-font);
    color: #444;
    font-size: 2rem;
    line-height: 1.35;
    opacity: 0;
    display: none;
    background: linear-gradient(90deg, #E8A0BF, #BFA0E8, #E8A0BF);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 18px rgba(232,160,191,0.25);
}

.loader-step.active {
    display: block;
    animation: stepCycle var(--step-duration, 2500ms) ease-in-out forwards;
}

.loader-step + .loader-step {
    margin-top: 8px;
}

.loader.fade-out {
    animation: loaderFadeOut 700ms ease forwards;
}

@keyframes loaderFadeOut {
    to { opacity: 0; visibility: hidden; }
}

@keyframes stepCycle {
    0% { opacity: 0; transform: translateY(6px) scale(0.96); }
    12% { opacity: 1; transform: translateY(0) scale(1); }
    78% { opacity: 1; transform: translateY(0) scale(1.02); }
    100% { opacity: 0; transform: translateY(-6px) scale(0.96); }
}

@keyframes gentlePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 12px 40px rgba(0,0,0,0.12); }
    50% { transform: scale(1.01); box-shadow: 0 14px 44px rgba(232,160,191,0.25); }
}

/* Loader floating ornaments */
.loader-decor { position: absolute; inset: 0; pointer-events: none; }
.l-heart {
    position: absolute; width: 14px; height: 14px; background: rgba(232,160,191,0.9); transform: rotate(-45deg);
}
.l-heart::before, .l-heart::after { content: ''; position: absolute; width: 14px; height: 14px; background: inherit; border-radius: 50%; }
.l-heart::before { top: -7px; left: 0; }
.l-heart::after  { top: 0; left: 7px; }

.spark { position: absolute; width: 6px; height: 6px; background: radial-gradient(circle, #fff, rgba(255,255,255,0)); border-radius: 50%; filter: blur(0.5px); opacity: 0.9; }

.lh1 { left: 8%;  bottom: -10%; animation: floatLoader 6s linear infinite; }
.lh2 { left: 88%; bottom: -12%; animation: floatLoader 7s linear infinite 0.8s; }
.lh3 { left: 48%; bottom: -14%; animation: floatLoader 8s linear infinite 0.4s; }
.sp1 { left: 20%; top: 10%; animation: sparkle 2.2s ease-in-out infinite; }
.sp2 { left: 80%; top: 30%; animation: sparkle 2.8s ease-in-out infinite 0.6s; }
.sp3 { left: 50%; top: 70%; animation: sparkle 2.5s ease-in-out infinite 1s; }

@keyframes floatLoader {
    0% { transform: translateY(0) rotate(-45deg) scale(1); opacity: 0; }
    10% { opacity: 1; }
    60% { transform: translateY(-60vh) rotate(-45deg) scale(1.05); }
    100% { transform: translateY(-110vh) rotate(-45deg) scale(1.1); opacity: 0; }
}

/* Password Protection Screen */
.password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,248,240,0.95), rgba(248,240,255,0.9));
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    opacity: 1;
    visibility: visible;
    transition: all 0.5s ease;
}

.password-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.password-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(232, 160, 191, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: passwordSlideIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.password-header {
    margin-bottom: 30px;
}

.lock-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    animation: lockPulse 2s ease-in-out infinite;
}

.password-header h2 {
    font-family: var(--heading-font);
    font-size: 2rem;
    color: transparent;
    background: linear-gradient(135deg, #E8A0BF, #BFA0E8);
    -webkit-background-clip: text;
    background-clip: text;
    margin-bottom: 10px;
}

.password-header p {
    font-size: 1rem;
    color: #7a6071;
    line-height: 1.5;
}

.password-form {
    margin-bottom: 20px;
}

#password-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid rgba(232, 160, 191, 0.3);
    border-radius: 50px;
    font-size: 1.1rem;
    text-align: center;
    letter-spacing: 0.2em;
    font-family: var(--body-font);
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

#password-input:focus {
    outline: none;
    border-color: #E8A0BF;
    box-shadow: 0 0 20px rgba(232, 160, 191, 0.3);
    transform: scale(1.02);
}

#password-submit {
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, #E8A0BF, #BFA0E8);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(232, 160, 191, 0.4);
}

#password-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(232, 160, 191, 0.5);
}

#password-submit:active {
    transform: translateY(0);
}

.password-error {
    color: #ff6b6b;
    font-size: 0.9rem;
    font-weight: 500;
    animation: errorShake 0.5s ease-in-out;
}

@keyframes passwordSlideIn {
    0% {
        transform: scale(0.8) translateY(30px);
        opacity: 0;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes lockPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Desktop-only refinements for password modal */
@media screen and (min-width: 1024px) {
    .password-overlay { padding: 16px; }
    .password-container {
        width: 440px; /* fixed, elegant width on desktop */
        max-width: calc(100vw - 64px); /* ensure no overflow near edges */
        margin: 0 auto; /* extra safety centering */
        padding: 36px 32px; /* slightly tighter padding for balance */
    }
}

/* Fireworks Animation */
.fireworks-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fireworks-container.active {
    opacity: 1;
}

.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    animation: fireworkExplode 2s ease-out forwards;
}

.fw1 { top: 20%; left: 20%; background: #ff6b6b; animation-delay: 0s; }
.fw2 { top: 30%; left: 80%; background: #4ecdc4; animation-delay: 0.3s; }
.fw3 { top: 60%; left: 15%; background: #45b7d1; animation-delay: 0.6s; }
.fw4 { top: 70%; left: 85%; background: #f9ca24; animation-delay: 0.9s; }
.fw5 { top: 25%; left: 50%; background: #f0932b; animation-delay: 1.2s; }
.fw6 { top: 75%; left: 30%; background: #eb4d4b; animation-delay: 1.5s; }
.fw7 { top: 40%; left: 70%; background: #6c5ce7; animation-delay: 1.8s; }
.fw8 { top: 80%; left: 60%; background: #a29bfe; animation-delay: 2.1s; }

@keyframes fireworkExplode {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(20);
        opacity: 0.8;
    }
    100% {
        transform: scale(40);
        opacity: 0;
    }
}

/* Celebration Popup */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.popup-letter {
    position: relative;
    max-width: 780px;
    width: 95%;
    animation: popupBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.letter-envelope {
    background: linear-gradient(135deg, #fff, #f8f9fa);
    border-radius: 15px;
    padding: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(232, 160, 191, 0.3);
    position: relative;
    overflow: hidden;
}

.envelope-flap {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 250px solid transparent;
    border-right: 250px solid transparent;
    border-bottom: 20px solid rgba(232, 160, 191, 0.2);
    z-index: 1;
}

.letter-content {
    padding: 40px 30px;
    position: relative;
    z-index: 2;
}

.letter-header {
    text-align: center;
    margin-bottom: 25px;
}

.letter-heart-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    animation: heartBeat 1.5s ease-in-out infinite;
}

.letter-header h3 {
    font-family: var(--heading-font);
    font-size: 2rem;
    color: transparent;
    background: linear-gradient(135deg, #E8A0BF, #BFA0E8);
    -webkit-background-clip: text;
    background-clip: text;
    margin: 0;
}

.letter-body p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 15px;
    text-align: center;
}

.letter-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(232, 160, 191, 0.3);
}

.letter-footer p {
    font-size: 1rem;
    color: #7a6071;
    margin: 0;
    font-style: italic;
}

.close-popup {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 35px;
    height: 35px;
    border: none;
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    transition: all 0.3s ease;
    z-index: 3;
}

.close-popup:hover {
    background: #ff5252;
    transform: scale(1.1);
}

@keyframes popupBounce {
    0% {
        transform: scale(0.3) translateY(50px);
        opacity: 0;
    }
    50% {
        transform: scale(1.05) translateY(-10px);
        opacity: 1;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@media (max-width: 768px) {
    .loader-step { font-size: 1.4rem; }
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 30px;
    /* Hide scrollbar */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.container::-webkit-scrollbar {
    display: none; /* WebKit browsers */
}


.header p {
    font-size: 1.3rem;
    color: #7a6071;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.5;
    margin: 0 0 20px 0;
    text-shadow: 0 2px 8px rgba(122,96,113,0.15);
}

.header-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.nav-link {
    color: #E8A0BF;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(232, 160, 191, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(232, 160, 191, 0.3);
}

.nav-link:hover {
    background: rgba(232, 160, 191, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(232, 160, 191, 0.3);
}

/* Timeline */
.timeline {
    position: relative;
    padding: 80px 0 50px 0; /* Add more top padding to create space from title */
    z-index: 1;
    flex: 1 0 auto; /* allow main to grow and push footer */
    /* Hide scrollbar */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.timeline::-webkit-scrollbar {
    display: none; /* WebKit browsers */
}

/* The central line - HIDDEN */
.timeline::before {
    content: '';
    position: absolute;
    top: 60px; /* Start line after the title section */
    left: 50%;
    width: 2px;
    height: calc(100% - 60px); /* Adjust height to start after title */
    background: var(--line-color);
    transform: translateX(-50%);
    z-index: 0; /* Ensure it's behind content */
    display: none; /* Hide the timeline line */
}

.timeline-item {
    position: relative;
    width: 50%;
    margin-bottom: 50px;
    padding: 10px 40px;
}

.timeline-item.hidden { display: none; }

/* The circle on the timeline - HIDDEN */
.timeline-item::after {
    content: '';
    position: absolute;
    top: 25px;
    width: 20px;
    height: 20px;
    background: var(--bg-color);
    border: 4px solid var(--primary-color);
    border-radius: 50%;
    z-index: 1;
    display: none; /* Hide the timeline circles */
}

/* Left-side items */
.timeline-item:nth-child(odd) {
    left: 0;
    padding-right: 40px; /* Reduced padding since no circle */
}

.timeline-item:nth-child(odd)::after {
    right: -10px;
}

/* Right-side items */
.timeline-item:nth-child(even) {
    left: 50%;
    padding-left: 40px; /* Reduced padding since no circle */
}

.timeline-item:nth-child(even)::after {
    left: -10px;
}

.timeline-content {
    background: #fff;
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

/* Uniform media framing */
.media-frame {
    width: 100%;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    border: 1px solid rgba(232,160,191,0.25);
    padding: 8px;
}
.media-frame > img, .media-frame > video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* Multiple images grid */
.media-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 12px;
}
/* .media-grid .media-frame inherits intrinsic media sizing (no fixed ratio) */

@media screen and (max-width: 430px) {
    .media-grid { grid-template-columns: 1fr; }
}

.timeline-content:hover {
    transform: translateY(-5px);
}

.timeline-content h3 {
    font-family: var(--heading-font);
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.timeline-date {
    font-size: 0.9rem;
    font-weight: bold;
    color: #888;
    margin-bottom: 15px;
}

.timeline-content img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin-top: 12px;
}

/* Letter cover overlay for timeline items */
.timeline-item.is-locked .timeline-content {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    user-select: none;
    transition: none;
}

.timeline-item.is-open .timeline-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    animation: contentReveal 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes contentReveal {
    0% { 
        opacity: 0; 
        transform: translateY(20px) scale(0.95); 
    }
    50% { 
        opacity: 0.7; 
        transform: translateY(-5px) scale(1.02); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.letter-cover {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 24px;
    z-index: 3;
    pointer-events: auto;
}

.letter-paper {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: linear-gradient(135deg, #fff, #fefefe);
    border-radius: 16px;
    box-shadow: 
        0 20px 40px rgba(0,0,0,0.15),
        0 8px 16px rgba(232,160,191,0.2),
        inset 0 1px 0 rgba(255,255,255,0.8);
    border: 2px solid rgba(232,160,191,0.3);
    padding: 32px 28px 36px;
    text-align: center;
    overflow: hidden;
    transform: rotate(-1deg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.letter-paper:hover {
    transform: rotate(0deg) scale(1.02);
    box-shadow: 
        0 24px 48px rgba(0,0,0,0.18),
        0 12px 24px rgba(232,160,191,0.25),
        inset 0 1px 0 rgba(255,255,255,0.9);
}

.letter-paper::before {
    content: '';
    position: absolute;
    left: 50%;
    top: -40px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 200px solid transparent;
    border-right: 200px solid transparent;
    border-bottom: 40px solid rgba(232,160,191,0.2);
    filter: drop-shadow(0 8px 16px rgba(232,160,191,0.15));
}

.letter-paper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(232,160,191,0.3), transparent);
}

.letter-title {
    font-family: var(--heading-font);
    font-size: 1.3rem;
    color: #7a6071;
    margin-bottom: 16px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.letter-heart {
    display: inline-block;
    width: 28px; 
    height: 28px;
    background: linear-gradient(135deg, #E8A0BF, #BFA0E8);
    transform: rotate(-45deg);
    margin-bottom: 18px;
    box-shadow: 0 4px 12px rgba(232,160,191,0.4);
    animation: heartPulse 2s ease-in-out infinite;
}

.letter-heart::before, .letter-heart::after {
    content: '';
    position: absolute;
    width: 28px; 
    height: 28px;
    background: linear-gradient(135deg, #E8A0BF, #BFA0E8);
    border-radius: 50%;
}

.letter-heart::before { top: -14px; left: 0; }
.letter-heart::after { top: 0; left: 14px; }

@keyframes heartPulse {
    0%, 100% { transform: rotate(-45deg) scale(1); }
    50% { transform: rotate(-45deg) scale(1.1); }
}

.letter-description {
    margin: 16px 0 24px; 
    color: #7a6071; 
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 500;
}

.open-btn {
    display: inline-block;
    border: none;
    background: linear-gradient(135deg, #E8A0BF, #BFA0E8);
    color: #fff;
    font-family: var(--body-font);
    font-weight: 700;
    font-size: 1rem;
    padding: 14px 24px;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(232,160,191,0.3);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.open-btn:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 12px 28px rgba(232,160,191,0.4);
    background: linear-gradient(135deg, #F0A8C8, #C8A8F0);
}

.open-btn:active { 
    transform: translateY(0); 
    box-shadow: 0 6px 16px rgba(232,160,191,0.3);
}

.timeline-item.is-open .letter-cover {
    pointer-events: none;
    animation: coverFadeOut 600ms ease forwards;
}

@keyframes coverFadeOut {
    to { opacity: 0; transform: translateY(-6px) scale(0.98); }
}

/* Final Message Section */
.final-message {
    text-align: center;
    padding: 80px 0;
    color: #444;
    position: relative;
    z-index: 1;
    margin-top: auto; /* stick footer to bottom when content short */
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px);
    transition: all 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.final-message.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.final-message h2,
.final-message h3 {
    font-family: var(--heading-font);
    font-size: 2.8rem;
    color: transparent;
    background: linear-gradient(135deg, #E8A0BF, #BFA0E8, #A0E8BF);
    -webkit-background-clip: text;
    background-clip: text;
    margin-bottom: 20px;
    text-shadow: 0 4px 20px rgba(232,160,191,0.3);
    letter-spacing: -0.02em;
}

.final-message p {
    font-size: 1.3rem;
    color: #7a6071;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.6;
    margin: 0;
    text-shadow: 0 2px 8px rgba(122,96,113,0.15);
    max-width: 600px;
    margin: 0 auto;
}

/* Social Media Links */
.social-links {
    margin-top: 40px;
    text-align: center;
}

.social-links h4 {
    font-family: var(--heading-font);
    font-size: 1.5rem;
    color: transparent;
    background: linear-gradient(135deg, #E8A0BF, #BFA0E8);
    -webkit-background-clip: text;
    background-clip: text;
    margin-bottom: 20px;
    font-weight: 600;
}

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    max-width: 600px;
    margin: 0 auto;
}

.social-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 2px solid transparent;
    min-width: 120px;
    justify-content: center;
}

.facebook-btn {
    background: linear-gradient(135deg, #1877F2, #42A5F5);
    color: white;
}

.facebook-btn:hover {
    background: linear-gradient(135deg, #166FE5, #1976D2);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(24, 119, 242, 0.3);
}

.instagram-btn {
    background: linear-gradient(135deg, #E4405F, #F77737, #FCAF45);
    color: white;
}

.instagram-btn:hover {
    background: linear-gradient(135deg, #D62976, #E95950, #F77737);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(228, 64, 95, 0.3);
}

.social-icon {
    font-size: 1.2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.social-text {
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Responsive design - Mobile First */
@media screen and (max-width: 768px) {
    .container { padding: 0 16px; }

    .header { padding: 36px 0; }
    .header h1 { font-size: 2.2rem; }
    .header p { font-size: 1rem; }
    .header-nav { gap: 12px; }
    .nav-link { padding: 6px 12px; font-size: 0.9rem; }

    .timeline { padding: 30px 0; }
    .timeline-content { padding: 16px 18px; }
    .timeline-content h3 { font-size: 1.25rem; }
    .timeline-date { font-size: 0.9rem; }

    .open-btn { padding: 12px 20px; }

    .final-message { padding: 56px 0; }
    .final-message h2,
    .final-message h3 { font-size: 2rem; }
    .final-message p { font-size: 1rem; }

    .loader-box { padding: 20px 22px; }
    .loader-step { font-size: 1.25rem; }

    .password-container { padding: 28px; }
    .password-header h2 { font-size: 1.7rem; }
    #password-input, #password-submit { padding: 14px 18px; font-size: 1rem; }

    .popup-letter { width: 96%; }
    .letter-content { padding: 28px 20px; }
    .letter-header h3 { font-size: 1.6rem; }
    .letter-body p { font-size: 1rem; }
    .close-popup { width: 40px; height: 40px; }
    
    .social-links { margin-top: 30px; }
    .social-links h4 { font-size: 1.3rem; }
    .social-buttons { gap: 10px; }
    .social-btn { padding: 10px 16px; font-size: 0.9rem; min-width: 100px; }

    .timeline::before {
        left: 30px;
        top: 60px; /* Start line after title on mobile too */
        height: calc(100% - 60px);
        display: none; /* Hide timeline line on mobile too */
    }

    .timeline-item {
        width: 100%;
        padding-left: 40px; /* Reduced padding since no circle */
        padding-right: 25px;
    }

    .timeline-item:nth-child(even) {
        left: 0;
    }

    .timeline-item::after {
        left: 20px;
    }
}

/* Small phones */
@media screen and (max-width: 430px) {
    .header h1 { font-size: 1.9rem; }
    .header p { font-size: 0.95rem; }

    .timeline::before { left: 22px; top: 60px; height: calc(100% - 60px); }
    .timeline-item { padding-left: 40px; padding-right: 16px; }
    .timeline-item::after { left: 14px; width: 16px; height: 16px; }

    .timeline-content { padding: 14px 14px; }
    .timeline-content h3 { font-size: 1.15rem; }
    .timeline-date { font-size: 0.85rem; }

    .final-message h2,
    .final-message h3 { font-size: 1.7rem; }
    .final-message p { font-size: 0.95rem; }
    
    .social-links h4 { font-size: 1.2rem; }
    .social-buttons { gap: 8px; }
    .social-btn { padding: 8px 12px; font-size: 0.85rem; min-width: 90px; }

    .loader-step { font-size: 1.1rem; }
    
    /* Audio controls at bottom - smaller on mobile */
    .audio-controls { 
        padding: 6px 10px; 
        gap: 8px; 
        max-width: 250px;
    }
    .audio-volume { width: 120px; }
    .audio-btn { 
        width: 32px; 
        height: 32px; 
        font-size: 14px;
    }
}

/* Animated background hearts */
.bg-hearts {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.heart {
    position: absolute;
    bottom: -60px; /* start below viewport */
    width: 16px;
    height: 16px;
    background: rgba(232, 160, 191, 0.8);
    transform: rotate(-45deg);
    animation: floatUp 12s linear infinite;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.heart::before,
.heart::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: inherit;
    border-radius: 50%;
}

.heart::before {
    top: -8px;
    left: 0;
}

.heart::after {
    left: 8px;
    top: 0;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(-45deg) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    50% {
        transform: translateY(-50vh) rotate(-45deg) scale(1.05);
    }
    100% {
        transform: translateY(-110vh) rotate(-45deg) scale(1.1);
        opacity: 0;
    }
}

/* Variations for hearts */
.heart.h1 { left: 8%;  animation-duration: 14s; animation-delay: 0s;    width: 14px; height: 14px; }
.heart.h2 { left: 18%; animation-duration: 18s; animation-delay: 2s;    width: 12px; height: 12px; opacity: 0.7; }
.heart.h3 { left: 28%; animation-duration: 16s; animation-delay: 1s;    width: 18px; height: 18px; }
.heart.h4 { left: 38%; animation-duration: 20s; animation-delay: 4s;    width: 10px; height: 10px; opacity: 0.6; }
.heart.h5 { left: 48%; animation-duration: 15s; animation-delay: 0.5s;  width: 16px; height: 16px; }
.heart.h6 { left: 58%; animation-duration: 22s; animation-delay: 3s;    width: 12px; height: 12px; opacity: 0.7; }
.heart.h7 { left: 68%; animation-duration: 17s; animation-delay: 1.5s;  width: 20px; height: 20px; }
.heart.h8 { left: 78%; animation-duration: 19s; animation-delay: 2.5s;  width: 14px; height: 14px; opacity: 0.8; }
.heart.h9 { left: 88%; animation-duration: 21s; animation-delay: 3.5s;  width: 12px; height: 12px; opacity: 0.75; }
.heart.h10{ left: 12%; animation-duration: 23s; animation-delay: 5s;    width: 16px; height: 16px; }
.heart.h11{ left: 32%; animation-duration: 24s; animation-delay: 6s;    width: 12px; height: 12px; opacity: 0.7; }
.heart.h12{ left: 72%; animation-duration: 26s; animation-delay: 7s;    width: 18px; height: 18px; }
/* Extra dense hearts */
.heart.h13{ left: 4%;   animation-duration: 14s; animation-delay: 1.2s;  width: 10px; height: 10px; opacity: 0.7; }
.heart.h14{ left: 14%;  animation-duration: 19s; animation-delay: 2.8s;  width: 12px; height: 12px; }
.heart.h15{ left: 24%;  animation-duration: 16s; animation-delay: 1.8s;  width: 14px; height: 14px; }
.heart.h16{ left: 34%;  animation-duration: 21s; animation-delay: 3.2s;  width: 11px; height: 11px; opacity: 0.65; }
.heart.h17{ left: 44%;  animation-duration: 17s; animation-delay: 0.9s;  width: 13px; height: 13px; }
.heart.h18{ left: 54%;  animation-duration: 20s; animation-delay: 2.3s;  width: 15px; height: 15px; }
.heart.h19{ left: 64%;  animation-duration: 18s; animation-delay: 1.1s;  width: 12px; height: 12px; opacity: 0.75; }
.heart.h20{ left: 74%;  animation-duration: 22s; animation-delay: 3.6s;  width: 10px; height: 10px; opacity: 0.7; }
.heart.h21{ left: 84%;  animation-duration: 19s; animation-delay: 2.1s;  width: 16px; height: 16px; }
.heart.h22{ left: 94%;  animation-duration: 23s; animation-delay: 4.2s;  width: 12px; height: 12px; }
.heart.h23{ left: 6%;   animation-duration: 25s; animation-delay: 5s;    width: 18px; height: 18px; }
.heart.h24{ left: 52%;  animation-duration: 15s; animation-delay: 1.4s;  width: 14px; height: 14px; }




/* --- Mobile-first enhancements & safeguards --- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

img, video { max-width: 100%; height: auto; display: block; }

button, [role="button"], .open-btn, #password-submit, .close-popup {
    min-height: 44px; /* comfortable touch target */
}

body { -webkit-tap-highlight-color: rgba(0,0,0,0); }

/* Tablet and below */
@media screen and (max-width: 768px) {
    .container { padding: 0 16px; }

    .header { padding: 36px 0; }
    .header h1 { font-size: 2.2rem; }
    .header p { font-size: 1rem; }

    .timeline { padding: 30px 0; }
    .timeline-content { padding: 16px 18px; }
    .timeline-content h3 { font-size: 1.25rem; }
    .timeline-date { font-size: 0.9rem; }

    .open-btn { padding: 12px 20px; }

    .final-message { padding: 56px 0; }
    .final-message h2,
    .final-message h3 { font-size: 2rem; }
    .final-message p { font-size: 1rem; }

    .loader-box { padding: 20px 22px; }
    .loader-step { font-size: 1.25rem; }

    .password-container { padding: 28px; }
    .password-header h2 { font-size: 1.7rem; }
    #password-input, #password-submit { padding: 14px 18px; font-size: 1rem; }

    .popup-letter { width: 96%; }
    .letter-content { padding: 28px 20px; }
    .letter-header h3 { font-size: 1.6rem; }
    .letter-body p { font-size: 1rem; }
    .close-popup { width: 40px; height: 40px; }
}

/* Small phones */
@media screen and (max-width: 430px) {
    .header h1 { font-size: 1.9rem; }
    .header p { font-size: 0.95rem; }

    .timeline::before { left: 22px; top: 60px; height: calc(100% - 60px); }
    .timeline-item { padding-left: 40px; padding-right: 16px; }
    .timeline-item::after { left: 14px; width: 16px; height: 16px; }

    .timeline-content { padding: 14px 14px; }
    .timeline-content h3 { font-size: 1.15rem; }
    .timeline-date { font-size: 0.85rem; }

    .final-message h2,
    .final-message h3 { font-size: 1.7rem; }
    .final-message p { font-size: 0.95rem; }
    
    .social-links h4 { font-size: 1.2rem; }
    .social-buttons { gap: 8px; }
    .social-btn { padding: 8px 12px; font-size: 0.85rem; min-width: 90px; }

    .loader-step { font-size: 1.1rem; }
}

/* Prevent accidental horizontal scroll on narrow screens */
.timeline, .header, .final-message, .popup-letter, .password-container { 
    max-width: 100%; 
    overflow-x: hidden; 
}

/* Touch-friendly improvements */
button, [role="button"], .open-btn, #password-submit, .close-popup, .audio-btn {
    min-height: 44px; /* comfortable touch target */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Safari-specific fixes */
@supports (-webkit-appearance: none) {
    .slider-viewport {
        -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
        mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    }
    
    .letter-paper {
        -webkit-transform: rotate(-1deg);
        transform: rotate(-1deg);
        -webkit-transition: -webkit-transform 0.3s ease, box-shadow 0.3s ease;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    
    .letter-paper:hover {
        -webkit-transform: rotate(0deg) scale(1.02);
        transform: rotate(0deg) scale(1.02);
    }
}

/* ===== Infinite Memories Slider ===== */
.memories-slider {
    position: relative;
    z-index: 1;
    padding: 40px 0 10px;
}

.slider-viewport {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    background: linear-gradient(180deg, rgba(255,255,255,0.8), rgba(255,255,255,0.9));
    /* fade the edges for a cinematic feel */
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
            mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

.slider-track {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    will-change: transform;
    animation: slideLoop 60s linear infinite;
}

.slider-track.duplicate { position: absolute; top: 0; left: 100%; }

.slider-item {
    flex: 0 0 auto;
    width: clamp(180px, 28vw, 340px);
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    overflow: hidden;
    background: #f6f6f6;
    box-shadow: 0 10px 26px rgba(0,0,0,0.12);
    transform: translateZ(0); /* promote to its own layer */
    transition: transform 250ms ease, box-shadow 250ms ease;
}

.slider-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Subtle per-item motion for liveliness */
.slider-item:nth-child(3n) { animation: bob 6s ease-in-out infinite; }
.slider-item:nth-child(3n+1) { animation: bob 7s ease-in-out infinite 0.3s; }
.slider-item:nth-child(3n+2) { animation: bob 8s ease-in-out infinite 0.6s; }

@keyframes bob {
    0%, 100% { transform: translateY(0) translateZ(0); }
    50% { transform: translateY(-4px) translateZ(0); }
}

@keyframes slideLoop {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Hover parallax (desktop only) */
@media (hover: hover) and (pointer: fine) {
    .slider-viewport:hover .slider-track { animation-play-state: paused; }
    .slider-item:hover { transform: translateY(-6px) scale(1.02); box-shadow: 0 16px 32px rgba(0,0,0,0.16); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .slider-track { animation-duration: 0.01ms; animation-iteration-count: 1; }
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .memories-slider { padding: 28px 0 6px; }
    .slider-track { gap: 12px; padding: 10px 12px; animation-duration: 50s; }
    .slider-item { width: clamp(160px, 52vw, 280px); }
}

@media screen and (max-width: 430px) {
    .slider-track { gap: 10px; padding: 8px 10px; animation-duration: 45s; }
    .slider-item { width: clamp(140px, 70vw, 240px); }
}

/* Slider popup dialog */
.popup-slider-dialog {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
}

/* Slider popup title and particles */
.slider-popup-header { text-align: center; padding: 16px 8px 6px; position: relative; }
.slider-popup-title {
    font-family: var(--heading-font);
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    background: linear-gradient(135deg, #E8A0BF, #BFA0E8, #A0E8BF);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    letter-spacing: -0.01em;
    opacity: 0; transform: translateY(10px) scale(0.98);
    animation: titleIn 800ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes titleIn {
    0% { opacity: 0; transform: translateY(10px) scale(0.98); }
    60% { opacity: 1; transform: translateY(-2px) scale(1.02); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.slider-particles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.particle {
    position: absolute;
    width: 16px; height: 16px;
    display: grid; place-items: center;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
    animation: floatOut 3.6s ease-out forwards;
}

@keyframes floatOut {
    0% { opacity: 0; transform: translate(var(--x, 0), var(--y, 0)) scale(0.7) rotate(0deg); }
    10% { opacity: 1; }
    100% { opacity: 0; transform: translate(calc(var(--x, 0) * 6), calc(var(--y, 0) * -6)) scale(1.2) rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .slider-popup-title { animation: none; opacity: 1; transform: none; }
    .particle { animation: none; opacity: 0.8; }
}

/* ===== Cursor Trail ===== */
.cursor-trail {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 10002;
}

.trail-dot {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff, rgba(255,255,255,0)) ,
                linear-gradient(135deg, rgba(232,160,191,0.9), rgba(191,160,232,0.9));
    box-shadow: 0 4px 10px rgba(232,160,191,0.5);
    transform: translate(-50%, -50%);
    animation: trailFade 700ms ease-out forwards;
}

.trail-emoji {
    position: fixed;
    font-size: 14px;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 6px 10px rgba(0,0,0,0.18));
    animation: trailFloat 900ms ease-out forwards;
}

@keyframes trailFade {
    0% { opacity: 0.9; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -80%) scale(0.6); }
}

@keyframes trailFloat {
    0% { opacity: 0.9; transform: translate(-50%, -50%) rotate(0deg) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -90%) rotate(25deg) scale(0.8); }
}

@media (prefers-reduced-motion: reduce) {
    .trail-dot, .trail-emoji { animation-duration: 1ms; }
}

/* ===== Mobile Audio Prompt ===== */
#mobile-audio-prompt {
    animation: mobilePromptSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

#mobile-audio-prompt button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(232,160,191,0.4);
}

#mobile-audio-prompt button:active {
    transform: translateY(0);
}

@keyframes mobilePromptSlideIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) translateY(0);
    }
}

@keyframes enhancedPromptSlideIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.7) translateY(30px);
    }
    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.05) translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) translateY(0);
    }
}

@keyframes slideUpFade {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ===== Add New Memory Button ===== */
.add-memory-section {
    text-align: center;
    padding: 60px 0;
    margin-top: 40px;
}

.add-memory-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 0 20px;
}

.add-memory-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #E8A0BF, #BFA0E8);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 18px 36px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(232,160,191,0.4);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.add-memory-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 16px 40px rgba(232,160,191,0.5);
    background: linear-gradient(135deg, #F0A8C8, #C8A8F0);
}

.add-memory-btn:active {
    transform: translateY(-1px) scale(1.02);
}

.add-icon {
    font-size: 1.5rem;
    animation: sparkle 2s ease-in-out infinite;
}

.add-text {
    font-family: var(--body-font);
    font-weight: 700;
}

.add-memory-description {
    margin-top: 16px;
    color: #7a6071;
    font-size: 1rem;
    font-style: italic;
    line-height: 1.5;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(10deg); }
}

/* Mobile responsive for add memory button */
@media screen and (max-width: 768px) {
    .add-memory-section {
        padding: 40px 0;
    }
    
    .add-memory-btn {
        padding: 16px 28px;
        font-size: 1.1rem;
        gap: 10px;
    }
    
    .add-icon {
        font-size: 1.3rem;
    }
    
    .add-memory-description {
        font-size: 0.9rem;
        margin-top: 12px;
    }
}

@media screen and (max-width: 430px) {
    .add-memory-btn {
        padding: 14px 24px;
        font-size: 1rem;
        gap: 8px;
    }
    
    .add-icon {
        font-size: 1.2rem;
    }
    
    .add-memory-description {
        font-size: 0.85rem;
    }
}

/* ===== Scroll to Top Button ===== */
.scroll-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #E8A0BF, #BFA0E8);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(232,160,191,0.4);
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.scroll-to-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 30px rgba(232,160,191,0.5);
    background: linear-gradient(135deg, #F0A8C8, #C8A8F0);
}

.scroll-to-top-btn:active {
    transform: translateY(-1px) scale(1.02);
}

.scroll-icon {
    display: block;
    animation: bounceUp 2s ease-in-out infinite;
}

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

/* Mobile responsive for scroll to top button */
@media screen and (max-width: 768px) {
    .scroll-to-top-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
}

@media screen and (max-width: 430px) {
    .scroll-to-top-btn {
        bottom: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
        box-shadow: 0 6px 20px rgba(232,160,191,0.4);
    }
}

/* ===== Button Ripple Effect ===== */
.ripple-container { position: relative; overflow: hidden; }
.ripple {
    position: absolute;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    background: radial-gradient(circle, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0.3) 40%, rgba(255,255,255,0) 70%);
    width: 12px; height: 12px;
    opacity: 0.9;
    animation: rippleExpand 600ms ease-out forwards;
}

@keyframes rippleExpand {
    0% { transform: translate(-50%, -50%) scale(0.2); opacity: 0.9; }
    100% { transform: translate(-50%, -50%) scale(12); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .ripple { animation-duration: 1ms; }
}
