body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientBackground 15s ease infinite;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #333;
}

@keyframes gradientBackground {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.moments-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

/* Removed .post-moment-section styles */

.moments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.moment-item {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative; /* For delete button positioning */
}

.moment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.moment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
    border: 1px solid #eee;
}

.moment-user-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.moment-username {
    font-weight: bold;
    color: #007bff;
    font-size: 1.1em;
}

.moment-time {
    font-size: 0.85em;
    color: #888;
}

.moment-text {
    margin-bottom: 10px;
    line-height: 1.6;
    color: #333;
}

.moment-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: block; /* Remove extra space below image */
    margin-top: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Floating Action Button (FAB) */
.fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #007bff;
    color: white;
    border-radius: 50%;
    font-size: 2em;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    border: none;
    transition: background-color 0.3s ease;
}

.fab:hover {
    background-color: #0056b3;
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1001; /* Sit on top */
    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-content {
    background-color: #fefefe;
    margin: auto; /* Center the modal vertically and horizontally */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%; /* Adjust width for responsiveness */
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 15px;
    color: #333;
}

.modal-content textarea {
    width: calc(100% - 20px);
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    resize: vertical;
    font-size: 1em;
    min-height: 100px;
}

.modal-content input[type="file"] {
    border: 1px solid #ccc;
    padding: 8px;
    border-radius: 5px;
    background-color: #fff;
}

.modal-content .post-button {
    background-color: #28a745;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
}

.modal-content .post-button:hover {
    background-color: #218838;
}

.modal-content .close-button {
    background-color: #6c757d;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
}

.modal-content .close-button:hover {
    background-color: #5a6268;
}

/* Delete Button for each moment item */
.delete-moment-btn {
    position: absolute;
    bottom: 10px; /* Changed from top to bottom */
    right: 10px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.8em;
    transition: background-color 0.3s ease;
}

.delete-moment-btn:hover {
    background-color: #c82333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .moments-container {
        margin: 10px;
        padding: 15px;
    }

    .fab {
        width: 50px;
        height: 50px;
        font-size: 1.8em;
        bottom: 15px;
        right: 15px;
    }

    .modal-content {
        width: 95%;
        padding: 15px;
    }

    .modal-content textarea {
        width: calc(100% - 10px);
        min-height: 80px;
    }

    .modal-content .post-button,
    .modal-content .close-button {
        padding: 8px 12px;
        font-size: 1em;
    }

    .moment-username {
        font-size: 1em;
    }

    .moment-time {
        font-size: 0.8em;
    }

    .moment-text {
        font-size: 0.9em;
    }

    .delete-moment-btn {
        padding: 4px 8px;
        font-size: 0.7em;
    }
}
