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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    padding: 40px 20px;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.heart {
    position: absolute;
    font-size: 30px;
    animation: float 6s ease-in-out infinite;
    opacity: 0.7;
    filter: drop-shadow(0 0 10px rgba(255, 105, 180, 0.7));
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-120vh) rotate(360deg);
        opacity: 0;
    }
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.5); }
}

.container {
    background: rgba(255, 255, 255, 0.98);
    padding: 60px 50px;
    border-radius: 40px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(255, 255, 255, 0.3) inset;
    text-align: center;
    max-width: 600px;
    width: 90%;
    position: relative;
    z-index: 10;
    backdrop-filter: blur(10px);
    animation: containerEntry 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes containerEntry {
    from {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff0080, #ff8c00, #40e0d0, #ff0080);
    border-radius: 40px;
    z-index: -1;
    opacity: 0.6;
    filter: blur(20px);
    animation: borderGlow 3s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.emoji {
    font-size: 100px;
    margin-bottom: 20px;
    animation: heartbeat 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(255, 105, 180, 0.8));
    display: inline-block;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    10%, 30% {
        transform: scale(0.9);
    }
    20%, 40% {
        transform: scale(1.1);
    }
}

h1 {
    font-family: 'Pacifico', cursive;
    font-size: 42px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    animation: titleShine 3s ease-in-out infinite;
}

@keyframes titleShine {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.3);
    }
}

.subtitle {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
    font-weight: 400;
}

.days-container {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 40px;
}

.day-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 25px;
    padding: 30px 25px;
    width: 240px;
    text-decoration: none;
    color: white;
    transition: all 0.4s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.day-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.day-card:hover::before {
    left: 100%;
}

.day-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.3);
}

.day-card:nth-child(1) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.day-card:nth-child(2) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.day-emoji {
    font-size: 50px;
    margin-bottom: 15px;
    animation: bounce 2s ease-in-out infinite;
}

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

.day-card h2 {
    font-family: 'Dancing Script', cursive;
    font-size: 26px;
    margin-bottom: 10px;
    font-weight: 700;
}

.day-date {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 10px;
    font-weight: 600;
}

.day-description {
    font-size: 15px;
    opacity: 0.95;
    font-style: italic;
    line-height: 1.4;
}

.buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    position: relative;
    min-height: 80px;
}

button {
    padding: 18px 50px;
    font-size: 24px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active::before {
    width: 300px;
    height: 300px;
}

#yesBtn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

@keyframes yesPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(245, 87, 108, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 8px 40px rgba(245, 87, 108, 0.8);
    }
}

#yesBtn:hover {
    transform: scale(1.15) rotate(-2deg);
    box-shadow: 0 12px 40px rgba(245, 87, 108, 0.6);
}

#noBtn {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
    transition: all 0.2s ease;
}

#noBtn.moving {
    position: fixed;
    animation: shake 0.5s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(-3px) rotate(-2deg); }
    75% { transform: translateX(3px) rotate(2deg); }
}

#noBtn:hover {
    transform: scale(0.9) rotate(5deg);
}

.hidden {
    display: none !important;
}

/* Envelope Animation Styles */
.envelope-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
    background: transparent;
    transition: background 0.5s ease 3.5s;
}

.envelope-container.page-mode {
    background: rgba(0, 0, 0, 0.9);
}

.envelope-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    animation: envelopeAppear 0.6s ease-out;
}

@keyframes envelopeAppear {
    from {
        opacity: 0;
        transform: scale(0.5) translateY(100px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.envelope {
    position: relative;
    width: 100%;
    height: 400px;
    margin: 0 auto;
}

.envelope-body {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-radius: 0 0 20px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1;
    animation: envelopeDisappear 0.8s ease-in-out 3.5s forwards;
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    transform-origin: top center;
    border-radius: 20px 20px 0 0;
    clip-path: polygon(0 0, 50% 60%, 100% 0);
    z-index: 3;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    animation: flapOpen 1.2s ease-in-out 0.8s forwards, envelopeDisappear 0.8s ease-in-out 3.5s forwards;
}

@keyframes flapOpen {
    0% {
        transform: rotateX(0deg);
    }
    100% {
        transform: rotateX(180deg);
    }
}

@keyframes envelopeDisappear {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.5);
        visibility: hidden;
    }
}

.envelope-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, #fad0c4 0%, #ffd1ff 100%);
    border-radius: 20px 20px 0 0;
    clip-path: polygon(0 0, 50% 60%, 100% 0, 100% 100%, 0 100%);
    z-index: 2;
    animation: envelopeDisappear 0.8s ease-in-out 3.5s forwards;
}

.letter {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    background: white;
    background-image: 
        repeating-linear-gradient(
            transparent,
            transparent 31px,
            #e8e8e8 31px,
            #e8e8e8 32px
        );
    background-size: 100% 32px;
    background-position: 0 10px;
    padding: 50px 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 4;
    animation: letterSlideOut 1.5s ease-in-out 2s forwards, letterExpand 1s ease-in-out 4s forwards;
    max-height: 350px;
    overflow: hidden;
    position: relative;
}

.letter::before {
    content: '';
    position: absolute;
    left: 60px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ffcdd2;
    opacity: 0.5;
}

.letter::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background: 
        linear-gradient(to bottom, 
            transparent 0%, 
            transparent 10px,
            rgba(255, 235, 205, 0.3) 10px,
            rgba(255, 235, 205, 0.1) 100%
        );
    pointer-events: none;
    border-radius: 15px;
}

@keyframes letterSlideOut {
    0% {
        top: 0;
        opacity: 0.8;
    }
    100% {
        top: -300px;
        opacity: 1;
    }
}

@keyframes letterExpand {
    0% {
        top: -300px;
        left: 50%;
        transform: translateX(-50%) scale(1);
        width: 95%;
        max-width: 600px;
        max-height: 350px;
        border-radius: 15px;
    }
    100% {
        top: 50%;
        left: 50%;
        transform: translateX(-50%) translateY(-50%) scale(1.1);
        width: 90%;
        max-width: 800px;
        max-height: 90vh;
        border-radius: 20px;
        box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
    }
}

.success-message {
    animation: fadeInContent 0.8s ease-in 3.2s forwards, contentReveal 1s ease-in-out 4.5s forwards;
    opacity: 0;
    font-family: 'Dancing Script', cursive;
    line-height: 2.2;
    position: relative;
    z-index: 1;
}

.success-message h1 {
    font-family: 'Dancing Script', cursive;
    font-size: 48px;
    color: #e73c7e;
    margin-bottom: 25px;
    font-weight: 700;
    line-height: 1.4;
}

.success-message .message {
    font-family: 'Kalam', cursive;
    font-size: 24px;
    color: #333;
    line-height: 2.5;
    margin: 30px 0;
    font-weight: 400;
}

.success-message .love-letter {
    font-family: 'Indie Flower', cursive;
    background: transparent;
    padding: 30px 20px;
    border-radius: 0;
    margin: 35px 0;
    font-size: 22px;
    line-height: 2.8;
    color: #555;
    box-shadow: none;
    font-style: normal;
    font-weight: 400;
    border-left: 3px solid #ff69b4;
    padding-left: 25px;
}

.success-message p {
    font-family: 'Kalam', cursive;
    font-size: 22px;
    line-height: 2.5;
}

.success-message .celebration {
    font-size: 70px;
    margin-bottom: 25px;
    animation: celebrationSpin 1s ease-in-out;
    line-height: 1.5;
}

.success-message .emoji {
    font-size: 80px;
    margin: 25px 0;
    animation: heartbeat 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(255, 105, 180, 0.8));
    display: inline-block;
    line-height: 1.5;
}

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

@keyframes contentReveal {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1.05);
    }
}

.celebration {
    font-size: 80px;
    margin-bottom: 20px;
    animation: celebrationSpin 1s ease-in-out;
}

@keyframes celebrationSpin {
    from {
        transform: rotate(0deg) scale(0);
    }
    to {
        transform: rotate(720deg) scale(1);
    }
}

.message {
    font-size: 26px;
    color: #333;
    line-height: 1.8;
    margin: 25px 0;
    font-weight: 600;
}

.love-letter {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    padding: 30px;
    border-radius: 20px;
    margin: 30px 0;
    font-size: 18px;
    line-height: 1.8;
    color: #333;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    font-style: italic;
}

#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    pointer-events: none;
}

.attempt-counter {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px 25px;
    border-radius: 30px;
    font-weight: 600;
    color: #667eea;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: counterPop 0.3s ease;
    z-index: 100;
}

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

.date-badge {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 20px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.desperate-popup {
    position: fixed;
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
    padding: 20px 30px;
    border-radius: 15px;
    font-size: 20px;
    font-weight: 700;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    animation: popupBounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 350px;
    text-align: center;
    border: 3px solid white;
    transition: opacity 0.5s ease;
}

@keyframes popupBounce {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    70% {
        transform: scale(1.1) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

[contenteditable="true"] {
    outline: none;
    cursor: text;
    min-height: 1.5em;
}

[contenteditable="true"]:focus {
    background: rgba(255, 235, 205, 0.3);
    border-radius: 5px;
    padding: 2px 5px;
}

[contenteditable="true"]:empty:before {
    content: attr(data-placeholder);
    color: #999;
    font-style: italic;
}

.image-placeholder {
    margin: 20px 0;
    text-align: center;
}

.placeholder-content {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border: 3px dashed #ff69b4;
    border-radius: 15px;
    padding: 40px;
    cursor: pointer;
    font-size: 24px;
    color: #666;
    transition: all 0.3s ease;
    font-family: 'Kalam', cursive;
}

.placeholder-content:hover {
    background: linear-gradient(135deg, #ffd6a5 0%, #fdab9f 100%);
    transform: scale(1.02);
    border-color: #ff1493;
}

/* GIF Popup Styles */
.gif-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    background: rgba(0, 0, 0, 0.95);
    padding: 0;
    border-radius: 25px;
    box-shadow: 0 20px 60px rgba(255, 20, 147, 0.6);
    animation: gifBounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transition: opacity 0.3s ease;
    border: 4px solid #ff1493;
    overflow: hidden;
}

.gif-popup.hidden {
    display: none;
    opacity: 0;
}

.gif-popup-content {
    position: relative;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.close-gif-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 28px;
    line-height: 28px;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: bold;
    z-index: 10001;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.close-gif-btn:hover {
    background: #ff1493;
    color: white;
    transform: rotate(90deg) scale(1.1);
}

.gif-popup .gif-image {
    display: block;
    width: 350px;
    height: 350px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

@keyframes gifBounce {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(-10deg);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1) rotate(5deg);
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .container {
        padding: 40px 25px;
        max-width: 95%;
    }
    
    h1 {
        font-size: 32px;
    }
    
    .emoji {
        font-size: 70px;
    }
    
    .subtitle {
        font-size: 16px;
    }
    
    .days-container {
        gap: 20px;
    }
    
    .day-card {
        width: 100%;
        max-width: 300px;
    }
    
    button {
        padding: 15px 35px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 30px 20px;
    }
    
    h1 {
        font-size: 28px;
    }
    
    .emoji {
        font-size: 60px;
    }
    
    .day-card {
        padding: 25px 20px;
    }
    
    .day-emoji {
        font-size: 40px;
    }
    
    .day-card h2 {
        font-size: 22px;
    }
}
