/* Color Palette & Base Variables */
:root {
    --bg-color: #fff0f5; /* Lavender Blush - very soft background */
    --primary-pink: #ffb6c1; /* Light Pink */
    --contrast-pink: #d81b60; /* Deep Rose for contrast/text */
    --text-main: #4a4a4a; /* Warm grey for readability */
    --white: #ffffff;
}

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

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(var(--primary-pink) 1px, transparent 1px);
    background-size: 30px 30px; /* Cute subtle polka dot pattern */
    font-family: 'Poppins', sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Navigation */
nav {
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: flex-end;
    max-width: 800px;
}

.nav-link {
    text-decoration: none;
    background-color: var(--contrast-pink);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 10px rgba(216, 27, 96, 0.3);
}

.nav-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(216, 27, 96, 0.4);
}

/* Typography */
h1, h2, .handwriting {
    font-family: 'Dancing Script', cursive;
    color: var(--contrast-pink);
}

/* Main Container */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 20px;
    text-align: center;
}

/* Status Messages (Waiting / Finished) */
.status-message h1 {
    font-size: 3rem;
    margin-bottom: 10px;
}
.status-message p {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

/* Polaroid Styling */
/* --- UPDATED POLAROID STYLING --- */
.polaroid {
    background: var(--white);
    padding: 15px 15px 25px 15px; /* Balanced padding that grows */
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    border-radius: 4px;
    max-width: 350px;
    width: 100%;
    position: relative;
    animation: floatIn 0.8s ease-out;
    transform: rotate(-2deg);
    
    /* New: Flexbox ensures the container stretches with long text */
    display: flex;
    flex-direction: column;
}

.polaroid img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background-color: #eee;
    border: 1px solid #f0f0f0;
}

.note {
    /* Removed absolute positioning */
    width: 100%;
    text-align: center;
    font-size: 1.4rem; /* Slightly smaller for better fit */
    color: var(--text-main);
    margin-top: 15px; /* Adds space between the photo and the text */
    line-height: 1.3; /* Better readability for longer paragraphs */
}

.time-badge {
    position: absolute;
    top: -15px;
    right: -15px;
    background: var(--contrast-pink);
    color: var(--white);
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(216, 27, 96, 0.3);
    transform: rotate(5deg);
}

.come-back-text {
    margin-top: 40px;
    font-size: 0.95rem;
    color: #777;
    font-style: italic;
    background: rgba(255, 255, 255, 0.6);
    padding: 10px 20px;
    border-radius: 20px;
}

/* Archive Grid */
.archive-header {
    text-align: center;
    margin-bottom: 30px;
}
.archive-header h1 {
    font-size: 3.5rem;
}
.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
    padding-bottom: 50px;
}
.archive-grid .polaroid {
    animation: none; /* Disable animation in grid */
    transform: rotate(0deg); /* Straighten them out for the grid */
    margin: 0 auto;
}

/* Animations */
@keyframes floatIn {
    0% { opacity: 0; transform: translateY(30px) rotate(-5deg); }
    100% { opacity: 1; transform: translateY(0) rotate(-2deg); }
}
/* --- NEW STYLES TO ADD TO THE BOTTOM OF YOUR CSS --- */

/* Floating Hearts Background */
.hearts-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allows clicking through the hearts */
    z-index: -1; /* Keeps them behind the main content */
    overflow: hidden;
}

.heart {
    position: absolute;
    bottom: -10%;
    font-size: 2rem;
    animation: floatUp 10s linear infinite;
    opacity: 0.5;
}

/* Randomizing the hearts' starting positions and animation speeds */
.heart:nth-child(1) { left: 10%; animation-duration: 12s; animation-delay: 0s; }
.heart:nth-child(2) { left: 30%; animation-duration: 9s; animation-delay: 2s; font-size: 1.5rem; }
.heart:nth-child(3) { left: 50%; animation-duration: 14s; animation-delay: 4s; font-size: 2.5rem; }
.heart:nth-child(4) { left: 70%; animation-duration: 10s; animation-delay: 1s; }
.heart:nth-child(5) { left: 85%; animation-duration: 11s; animation-delay: 3s; font-size: 1.2rem; }
.heart:nth-child(6) { left: 95%; animation-duration: 13s; animation-delay: 5s; font-size: 2rem; }

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

/* Affirmation Gate (First Load) */
.affirmation-box {
    background: rgba(255, 255, 255, 0.9);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(216, 27, 96, 0.15);
    text-align: center;
    max-width: 400px;
    animation: floatIn 0.8s ease-out;
}

.affirmation-box h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.affirmation-box p {
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.btn-primary {
    background-color: var(--contrast-pink);
    color: var(--white);
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
    box-shadow: 0 5px 15px rgba(216, 27, 96, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(216, 27, 96, 0.4);
    background-color: #c2185b; /* Slightly darker rose */
}

/* Big Central Archive Button (End of 24hrs) */
.big-archive-btn {
    text-decoration: none;
    display: inline-block;
    background: linear-gradient(135deg, var(--contrast-pink), var(--primary-pink));
    color: white;
    font-family: 'Dancing Script', cursive;
    font-size: 2.5rem;
    padding: 20px 50px;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(216, 27, 96, 0.4);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: pulse 2s infinite;
}

.big-archive-btn:hover {
    transform: scale(1.1);
    animation: none; /* Stops pulsing when she hovers over it */
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 10px 25px rgba(216, 27, 96, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 15px 35px rgba(216, 27, 96, 0.6); }
    100% { transform: scale(1); box-shadow: 0 10px 25px rgba(216, 27, 96, 0.4); }
}

/* End of Day Message Card */
.end-of-day-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(216, 27, 96, 0.1);
    text-align: center;
    max-width: 550px;
    animation: floatIn 1s ease-out;
}

.end-of-day-card h1 {
    font-size: 3rem;
    margin-bottom: 10px;
}

.end-of-day-card p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    line-height: 1.6;
    color: var(--text-main);
}