body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column; /* Stack navbar and main content vertically */
    justify-content: flex-start; /* Align content to the top */
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #ffe0e6, #e6e0ff, #e0ffe6, #e0f6ff, #fffee0); /* All faint color gradients */
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite; /* Slower and smoother animation */
    color: #333;
    position: relative; /* For absolute positioning of children */
}

@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.navbar {
    width: 100%;
    background: linear-gradient(135deg, #ffe0e6, #e6e0ff, #e0ffe6, #e0f6ff, #fffee0); /* All faint color gradients */
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite; /* Slower and smoother animation */
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 30; /* Ensure navbar is on top */
    position: sticky;
    top: 0;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 40px; /* Space between nav items */
}

.nav-item a {
    text-decoration: none;
    color: #333; /* Changed to black */
    font-size: 1.2em;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.nav-item a:hover {
    background-color: rgba(0,0,0,0.1); /* Darker hover effect on light gradient */
    transform: translateY(-2px);
}

/* Responsive adjustments for smaller screens (e.g., mobile) */
@media (max-width: 767px) {
    .navbar {
        padding: 10px 0;
    }

    .nav-list {
        gap: 15px; /* Reduced gap for navbar items on mobile */
    }

    .nav-item a {
        font-size: 1em; /* Smaller font size for nav links */
        padding: 6px 10px;
    }

    .countdown-overlay {
        bottom: 10px; /* Closer to bottom on mobile */
        right: 10px; /* Closer to right on mobile */
        padding: 10px;
        gap: 10px;
    }

    .countdown-overlay .countdown-item {
        padding: 10px 15px;
        min-width: 200px; /* Smaller minimum width for countdown items */
        border-radius: 8px; /* Slightly smaller border-radius */
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    }

    .countdown-overlay .countdown-item p {
        font-size: 0.9em; /* Smaller font size for countdown text */
        gap: 8px;
    }

    .countdown-overlay .countdown-item span {
        font-size: 0.9em; /* Smaller font size for countdown numbers */
    }

    .countdown-icon {
        width: 40px; /* Smaller icons on mobile */
        height: 40px;
        margin-right: 5px;
        margin-left: 5px;
    }

    .button-group {
        flex-direction: column; /* Stack buttons vertically on mobile */
        gap: 15px;
        top: 60%; /* Adjust vertical position */
        left: 50%;
        transform: translate(-50%, -50%);
    }

    #showCaringMessages,
    #showPhotoAlbumBtn {
        padding: 12px 25px;
        font-size: 1.1em;
        width: 180px; /* Fixed width for buttons */
    }

    .modal-content {
        max-width: 90%; /* Make modals responsive */
        padding: 20px;
    }

    #albumPasswordInput {
        width: calc(100% - 16px); /* Adjust input width */
        padding: 8px;
    }

    .modal-content button {
        padding: 8px 15px;
        font-size: 0.9em;
    }

    .bullet-screen-container {
        font-size: 0.9em; /* Smaller font size for bullet screen messages */
    }
}

/* Styles for time.html */
/* The following styles are now handled by time.css */
/*
.time-content {
    flex-grow: 1; 
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 20px;
}

#currentTimeDisplay {
    font-size: 3em; 
    font-weight: bold;
    color: black; 
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); 
    background-color: rgba(255, 255, 255, 0.7); 
    padding: 20px 40px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
*/

/* New styles for countdown overlay */
.countdown-overlay {
    position: absolute;
    bottom: 20px; /* Position to the bottom */
    right: 20px; /* Position to the right */
    transform: none; /* Remove transform that centered it vertically */
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 25; /* Above bullet screen, below navbar */
    padding: 20px;
    background-color: transparent; /* Remove background */
    border-radius: 0; /* Remove border-radius */
    box-shadow: none; /* Remove box-shadow */
}

.countdown-overlay .countdown-item {
    background-color: rgba(255, 255, 255, 0.9); /* Light background for each item */
    border: 1px solid rgba(187, 222, 251, 0.7); /* Lighter blue border */
    border-radius: 12px; /* More rounded corners */
    padding: 15px 20px; /* Adjust padding to match image */
    margin-bottom: 0; /* Remove extra margin, controlled by gap in overlay */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05); /* Subtle shadow */
    text-align: left; /* Align text to the left as in image */
    min-width: 250px; /* Ensure consistent width and match image feel */
    height: auto; /* Allow height to adjust content */
    position: relative; /* For customDateIcon positioning */
    overflow: visible; /* Allow content to overflow if needed */
    line-height: normal; /* Restore normal line height */
}

.countdown-overlay .countdown-item p {
    margin: 0; /* Remove default paragraph margin */
    font-size: 1.1em;
    display: flex;
    align-items: center;
    justify-content: center; /* Center content (text, icon, number) */
    gap: 10px; /* Space between items */
    position: static; /* Remove relative position */
    height: auto; /* Restore auto height */
    width: auto; /* Restore auto width */
}

.countdown-overlay .countdown-item span {
    font-weight: bold;
    color: #2196f3;
    margin-right: 0; /* No explicit margin needed here, controlled by gap */
    position: static; /* Remove absolute positioning */
    top: auto;
    right: auto;
    transform: none;
    font-size: 1.1em; /* Restore original font size */
    white-space: normal; /* Restore normal white-space */
}

.countdown-overlay .countdown-item #customDateIcon {
    margin-left: 0; /* Adjust margin based on new flex layout and gap */
    cursor: pointer;
    color: #2196f3;
    font-size: 1.2em;
    position: static; /* Remove absolute positioning */
    top: auto;
    right: auto;
    transform: none;
    z-index: auto; /* Remove z-index */
}

.countdown-icon {
    width: 60px; /* Adjust size as needed */
    height: 60px; /* Adjust size as needed */
    object-fit: contain; /* Ensure the entire image is visible */
    vertical-align: middle;
    margin-right: 10px; /* Add margin to the right of the image */
    margin-left: 10px; /* Add margin to the left of the image */
    display: inline-block; /* Treat as block for width/height, but inline for flow */
}

/* Remove .countdown-icon-full specific styles */
.countdown-icon-full {
    /* These styles are no longer needed for acquaintanceIcon when it's a small icon */
    display: none; /* Hide if this class is accidentally still applied */
}

/* Remove old sidebar and main-content styles */
.sidebar,
.sidebar h2,
.container,
.main-content {
    display: none; /* Hide or remove these elements completely */
}

.countdown-item p {
    /* Resetting some general countdown-item p styles from global if they conflict */
    margin: 0;
}

.countdown-item #customDateInput {
    /* Ensure hidden input does not affect layout */
    display: none;
}

.button-group {
    display: flex;
    gap: 20px; /* Space between buttons */
    position: absolute; /* Position relative to body */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Center horizontally and vertically */
    z-index: 20; /* Above bullet screen, below countdown overlay */
}

#showCaringMessages {
    padding: 15px 30px;
    font-size: 1.2em;
    color: white;
    background: linear-gradient(to right, #ff8a80, #ff80ab); /* Pink gradient */
    border: none;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

#showCaringMessages:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.bullet-screen-container {
    position: fixed; /* Cover the entire viewport */
    top: 0;
    left: 0;
    width: 100vw; /* Full viewport width */
    height: 100vh; /* Full viewport height */
    pointer-events: none; /* Allows clicks to pass through to elements below */
    overflow: hidden;
    z-index: 5; /* Below other content, above background */
}

.caring-message {
    position: absolute;
    white-space: nowrap;
    animation: floatUp 10s linear forwards; /* Animation duration and type */
    opacity: 0;
    font-size: 1.2em;
    font-weight: bold;
}

@keyframes floatUp {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-50%);
        opacity: 0;
    }
}

#showPhotoAlbumBtn {
    padding: 15px 30px;
    font-size: 1.2em;
    color: white;
    background: linear-gradient(to right, #4CAF50, #8BC34A); /* Green gradient for album */
    border: none;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

#showPhotoAlbumBtn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 40; /* Sit on top, higher than other content */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex; /* Show the modal */
}

.modal-content {
    background-color: #fefefe;
    margin: auto; /* Center the modal vertically and horizontally */
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
    text-align: center;
    max-width: 500px;
    position: relative;
}

/* User Profile Modal Specific Styles */
.profile-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.avatar-placeholder-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #3f51b5;
    background-color: #f0f0f0;
}

.profile-details p {
    font-size: 1.1em;
    color: #555;
    margin: 0;
}

.profile-details span {
    font-weight: bold;
    color: #333;
}

#profileUploadAvatarBtn {
    padding: 10px 20px;
    background: linear-gradient(to right, #4CAF50, #8BC34A); /* Green gradient */
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

#profileUploadAvatarBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.2);
}


.modal-content h2 {
    color: #424242;
    margin-top: 0;
    margin-bottom: 20px;
}

#albumPasswordInput {
    width: calc(100% - 20px);
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
}

.error-message {
    color: red;
    font-size: 0.9em;
    margin-bottom: 10px;
    height: 1.2em; /* Reserve space to prevent layout shift */
}

.modal-content button {
    padding: 10px 20px;
    margin: 5px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

#albumPasswordSubmitBtn {
    background-color: #2196f3;
    color: white;
}

#albumPasswordSubmitBtn:hover {
    background-color: #0b7dda;
}

#closeAlbumPasswordModal {
    background-color: #f44336;
    color: white;
}

#closeAlbumPasswordModal:hover {
    background-color: #da190b;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
    justify-items: center;
}

.photo-grid img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
