@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400;700&family=Caveat:wght@400;600&family=Inter:wght@400;500;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 182, 193, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 192, 203, 0.06) 0%, transparent 50%),
        linear-gradient(135deg, #fdf7f9 0%, #fef1f4 25%, #fdeef2 50%, #fce8ed 75%, #fae2e8 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    padding: 20px;
    position: relative;
}

/* Subtle floating elements */
body::before {
    content: '✨ 🌸 ✨ 🌸 ✨ 🌸 ✨ 🌸 ✨ 🌸';
    position: fixed;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    font-size: 24px;
    opacity: 0.02;
    animation: gentleFloat 40s linear infinite;
    pointer-events: none;
    z-index: 1;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

@keyframes gentleFloat {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    max-width: 95vw;
    z-index: 10;
    position: relative;
    transition: all 0.8s ease;
}

/* Push container up when note is open */
.container.note-open {
    transform: translateY(-120px);
}

.header {
    text-align: center;
    margin-bottom: 20px;
}

.title {
    font-family: 'Dancing Script', cursive;
    background: linear-gradient(135deg, #e91e63, #ad1457, #c2185b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 42px;
    margin-bottom: 15px;
    font-weight: 700;
}

.subtitle {
    color: rgba(169, 20, 60, 0.8);
    text-align: center;
    font-weight: 500;
    font-size: 18px;
    font-family: 'Caveat', cursive;
}

.envelope-container {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    filter: drop-shadow(0 15px 35px rgba(233, 30, 99, 0.15));
}

.envelope-container:hover {
    transform: scale(1.02) rotate(0.5deg);
}

.envelope {
    width: 320px;
    height: 220px;
    position: relative;
    background: linear-gradient(135deg, #f8bbd9, #f48fb1);
    box-shadow: 
        0 15px 30px rgba(244, 143, 177, 0.25),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    overflow: visible;
}

.envelope-back {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f48fb1, #f06292);
    border-radius: 12px;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.envelope-front {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(135deg, #f8bbd9, #f48fb1);
    border-radius: 0 0 12px 12px;
    z-index: 2;
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 55%;
    background: linear-gradient(135deg, #e91e63, #f8bbd9);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    transform-origin: 50% 0%;
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
    border-radius: 12px 12px 0 0;
}

.envelope-flap.open {
    transform: rotateX(-180deg) translateZ(5px);
    z-index: 1;
}

.wax-seal {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 45px;
    height: 45px;
    background: radial-gradient(circle, #c2185b, #ad1457);
    border-radius: 50%;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    box-shadow: 
        0 6px 15px rgba(194, 24, 91, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.2);
    transition: all 0.7s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.wax-seal.broken {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0) rotate(180deg);
}

.love-note {
    position: fixed;
    width: 300px;
    height: 400px;
    background: 
        linear-gradient(135deg, #ffffff, #fefefe),
        radial-gradient(circle at 10px 10px, rgba(233, 30, 99, 0.05) 1px, transparent 1px);
    background-size: 100% 100%, 20px 20px;
    border-radius: 8px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0) rotate(-5deg);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.12),
        inset 0 1px 3px rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    padding: 30px 25px;
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    z-index: 20;
    border-left: 3px solid rgba(233, 30, 99, 0.1);
}

.love-note.visible {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    opacity: 1;
}

.note-header {
    text-align: center;
    margin-bottom: 25px;
}

.note-date {
    font-family: 'Caveat', cursive;
    color: #999;
    font-size: 14px;
    margin-bottom: 8px;
}

.note-title {
    font-family: 'Dancing Script', cursive;
    color: #c2185b;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
}

.hearts-decoration {
    font-size: 16px;
    opacity: 0.7;
}

.note-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.note-paragraph {
    color: #555;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.6;
    font-family: 'Caveat', cursive;
    text-align: left;
    position: relative;
}

.note-footer {
    text-align: right;
    margin-top: 20px;
}

.signature {
    font-family: 'Dancing Script', cursive;
    color: #c2185b;
    font-size: 20px;
    font-weight: 600;
    opacity: 0.8;
}

.kiss-mark {
    font-size: 18px;
    margin-top: 5px;
    opacity: 0.6;
}

.toggle-btn {
    background: linear-gradient(135deg, #f48fb1, #f06292);
    border: none;
    border-radius: 25px;
    padding: 14px 28px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: white;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 8px 20px rgba(244, 143, 177, 0.3);
    transition: all 0.3s ease;
    min-width: 160px;
    position: relative;
    z-index: 15;
}

.toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(244, 143, 177, 0.4);
}

.toggle-btn.closing {
    background: linear-gradient(135deg, #9e9e9e, #757575);
}

.audio-control {
    position: fixed;
    top: 25px;
    right: 25px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.audio-control:hover {
    transform: scale(1.1);
}

.audio-control.playing {
    background: rgba(244, 143, 177, 0.2);
}

.floating-heart {
    position: fixed;
    font-size: 24px;
    pointer-events: none;
    animation: floatUp 4s ease-out forwards;
    z-index: 1000;
}

@keyframes floatUp {
    0% {
        opacity: 0.8;
        transform: translateY(0) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-150px) rotate(180deg) scale(0.5);
    }
}

.status-indicator {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 20px;
    font-family: 'Caveat', cursive;
    font-size: 16px;
    color: #c2185b;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.status-indicator.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .envelope {
        width: 280px;
        height: 190px;
    }

    .love-note {
        width: 270px;
        height: 360px;
        padding: 25px 20px;
    }

    .container.note-open {
        transform: translateY(-80px);
    }

    .title {
        font-size: 36px;
    }

    .subtitle {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .envelope {
        width: 260px;
        height: 180px;
    }

    .love-note {
        width: 250px;
        height: 340px;
        padding: 20px 18px;
    }

    .container.note-open {
        transform: translateY(-60px);
    }

    .title {
        font-size: 32px;
    }

    .toggle-btn {
        padding: 12px 24px;
        font-size: 15px;
        min-width: 140px;
    }
}