/* Advanced Valentine's Day App - Enhanced CSS */

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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #ffafbd, #ffc3a0, #ff6b9d, #ff9a8b);
    min-height: 100vh;
    color: #5a3e36;
    overflow-x: hidden;
    position: relative;
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    background-attachment: fixed;
}

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

/* Enhanced typography */
h1, h2, h3 {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-weight: bold;
}

/* Enhanced button styles */
button {
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    border: none;
}

button:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Enhanced card hover effects */
.card-hover {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: center;
}

.card-hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}


/* Main App */
.main-app {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

/* Header */
.app-header {
    text-align: center;
    padding: 40px 20px 30px;
    margin-bottom: 30px;
    position: relative;
}

.app-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg, #ff6b9d, #ffafbd, #ff6b9d);
    border-radius: 4px;
}

.app-header h1 {
    font-size: 3.5rem;
    margin-bottom: 15px;
    color: #880e4f;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.2);
    position: relative;
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

.app-header p {
    font-size: 1.4rem;
    opacity: 0.9;
    color: #4a148c;
    font-style: italic;
    max-width: 600px;
    margin: 0 auto;
}

/* Valentine's Message */
.valentine-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255, 107, 157, 0.3);
}

.valentine-section::before {
    content: "";
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(45deg, transparent, rgba(255, 107, 157, 0.1), transparent);
    z-index: -1;
    border-radius: 25px;
}

.valentine-section h2 {
    margin-bottom: 25px;
    color: #ad1457;
    font-size: 2.2rem;
    position: relative;
    display: inline-block;
}

.valentine-section h2::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(to right, #ff6b9d, #ffafbd);
    border-radius: 2px;
}

.valentine-message {
    font-size: 1.3rem;
    line-height: 1.8;
    text-align: left;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(255, 186, 201, 0.1);
    border-radius: 15px;
}

.valentine-message p {
    margin: 18px 0;
    color: #4a148c;
    text-align: center;
}

.valentine-message p:first-child {
    font-size: 1.5rem;
    font-weight: bold;
    color: #880e4f;
    text-align: center;
}

/* Timeline */
.timeline-section {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.timeline-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #e91e63;
}

.timeline-container {
    display: flex;
    overflow-x: auto;
    gap: 30px;
    padding: 20px 0;
}

.timeline-item {
    min-width: 300px;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.timeline-date {
    font-weight: bold;
    color: #e91e63;
    margin-bottom: 10px;
}

.timeline-content h3 {
    color: #d81b60;
    margin-bottom: 10px;
}

.timeline-img {
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.timeline-img:hover {
    transform: scale(1.05);
}



/* Love Letters */
.letters-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255, 107, 157, 0.3);
}

.letters-section::before {
    content: "";
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(45deg, transparent, rgba(255, 107, 157, 0.1), transparent);
    z-index: -1;
    border-radius: 25px;
}

.letters-section h2 {
    text-align: center;
    margin-bottom: 35px;
    color: #ad1457;
    font-size: 2.2rem;
    position: relative;
    display: inline-block;
}

.letters-section h2::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(to right, #ff6b9d, #ffafbd);
    border-radius: 2px;
}

.letters-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    padding: 10px;
}

.letter-card {
    background: linear-gradient(145deg, #ffffff, #ffebee);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 107, 157, 0.2);
}

.letter-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, #ff6b9d, #ffafbd);
}

.letter-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    background: linear-gradient(145deg, #fff5f7, #ffffff);
}

.letter-card h3 {
    color: #880e4f;
    margin-bottom: 15px;
    font-size: 1.5rem;
    position: relative;
    z-index: 1;
}

.letter-card p {
    color: #7b1fa2;
    font-size: 1.1rem;
    position: relative;
    z-index: 1;
}

.letter-card::after {
    content: "💌";
    position: absolute;
    bottom: 15px;
    right: 15px;
    font-size: 1.8rem;
    opacity: 0.3;
    z-index: 0;
}

/* Love Letter Display */
.letter-display {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    position: relative;
}

.love-letter {
    position: relative;
    width: 100%;
    max-width: 600px;
    perspective: 1000px;
    margin-top: 60px;
}

.letter-paper {
    background: linear-gradient(to bottom, #fffdf6, #fffef9, #fffdf6);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    position: relative;
    z-index: 2;
    border: 1px solid #f0d9e3;
    min-height: 350px;
}

.letter-paper::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: repeating-linear-gradient(
        #f0d9e3,
        #f0d9e3 2px,
        transparent 2px,
        transparent 20px
    );
    border-radius: 8px 8px 0 0;
    opacity: 0.7;
}

.letter-content {
    position: relative;
    z-index: 1;
}

.letter-content h3 {
    color: #880e4f;
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.8rem;
    position: relative;
    padding-bottom: 10px;
}

.letter-content h3::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(to right, #ff6b9d, #ffafbd);
    border-radius: 1px;
}

.letter-content p {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #4a148c;
    text-align: left;
    margin-bottom: 30px;
    font-family: 'Georgia', 'Times New Roman', serif;
}

.signature {
    text-align: right;
    font-style: italic;
    color: #7b1fa2;
    margin-top: 30px;
    font-size: 1.1rem;
}

.letter-envelope {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    transform: translateY(15px);
}

.envelope-front {
    position: relative;
    width: 100%;
    height: 100%;
    background: #e91e63;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(233, 30, 99, 0.3);
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 300px solid transparent;
    border-right: 300px solid transparent;
    border-bottom: 170px solid #c2185b;
    z-index: 2;
    transform-origin: bottom;
    transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.letter-open .envelope-flap {
    transform: rotateX(180deg);
}

.envelope-body {
    position: absolute;
    top: 170px;
    left: 0;
    width: 100%;
    height: calc(100% - 170px);
    background: #c2185b;
    z-index: 1;
}

.heart-seal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    color: #ffd54f;
    text-shadow: 0 0 10px rgba(0,0,0,0.2);
    z-index: 3;
}

.close-letter-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #e91e63, #ad1457);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(233, 30, 99, 0.4);
    transition: all 0.3s ease;
    z-index: 10;
}

.close-letter-btn:hover {
    background: linear-gradient(135deg, #d81b60, #880e4f);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(233, 30, 99, 0.6);
}




/* Falling Hearts */
.heart {
    position: absolute;
    font-size: 28px;
    pointer-events: none;
    z-index: 100;
    animation: fall linear forwards;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
}

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

/* Additional heart variations */
.heart.heart-large {
    font-size: 36px;
    animation-duration: 6s;
}

.heart.heart-small {
    font-size: 18px;
    animation-duration: 4s;
}


/* Responsive Design */
@media (max-width: 768px) {
    .app-header h1 {
        font-size: 2.5rem;
    }

    .app-header p {
        font-size: 1.2rem;
    }

    .main-app {
        padding: 15px;
    }

    .valentine-section,
    .letters-section,
    .quote-section {
        padding: 25px;
    }

    .valentine-section h2,
    .letters-section h2,
    .quote-section h2 {
        font-size: 1.8rem;
    }

    .valentine-message {
        font-size: 1.1rem;
        padding: 15px;
    }

    .letters-container {
        grid-template-columns: 1fr; /* Stack letter cards vertically on mobile */
        gap: 20px;
    }

    .letter-card {
        padding: 20px;
        margin-bottom: 15px;
    }

    #quote-display {
        font-size: 1.2rem;
        padding: 20px;
    }

    #new-quote-btn {
        width: 100%;
        padding: 14px;
    }


}

@media (max-width: 480px) {
    .app-header {
        padding: 30px 15px 20px;
    }

    .app-header h1 {
        font-size: 2rem;
    }

    .app-header p {
        font-size: 1rem;
    }

    .valentine-section,
    .letters-section,
    .quote-section {
        padding: 20px;
    }

    .valentine-section h2,
    .letters-section h2,
    .quote-section h2 {
        font-size: 1.6rem;
    }

    .valentine-message {
        font-size: 1rem;
    }

    .letter-card h3 {
        font-size: 1.3rem;
    }

    .letter-card p {
        font-size: 1rem;
    }

    #quote-display {
        font-size: 1.1rem;
        padding: 15px;
    }

    #new-quote-btn {
        padding: 12px;
        font-size: 1rem;
    }
}