/* General Gallery Item Styling */
.gallery-item {
    background-color: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 200px; /* Fixed height for consistency */
    object-fit: cover; /* Ensures images/videos cover the area */
    display: block;
    cursor: pointer;
}

/* Styles for the tabs */
.tab-container {
    border-bottom: 1px solid #ccc;
    margin-bottom: 20px;
    /* Hide the tab container if you only have one "tab" now */
    display: none; /* Hide the entire tab bar */
}

.tab-buttons {
    display: flex;
}

.tab-button {
    padding: 10px 15px;
    cursor: pointer;
    border: none;
    background-color: transparent;
    font-size: 1em;
    color: #555;
    border-bottom: 2px solid transparent;
    transition: color 0.3s ease, border-bottom-color 0.3s ease;
}

.tab-button.active {
    color: #28a745;
    border-bottom-color: #28a745;
}

.tab-button:hover {
    color: #333;
}

/* Styles for the tab content */
.tab-content {
    display: none;
    padding-top: 20px;
}

.tab-content.active {
    display: block;
}

/* Daily Album Styling */
.daily-album {
    background-color: #eef;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    padding: 20px;
    position: relative;
}

.daily-album h3 {
    color: #333;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5em;
    display: flex;
    align-items: center;
}

.daily-album h3 i {
    margin-right: 10px;
    color: #28a745;
}

.daily-album-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* --- MODIFIED CSS FOR INITIAL STATE (SHOWS 4) --- */

/* Default (Initial) State: Show the first 4 items, hide from the 5th onwards */
.daily-album-content .gallery-item:nth-child(n+5) {
    display: none;
}
/* Ensure the first 4 are visible by default and when returning to this state */
.daily-album-content .gallery-item:nth-child(-n+4) {
    display: flex; /* Ensure they are displayed */
}

/* 'All' State: Show all items */
.daily-album[data-current-view="all"] .daily-album-content .gallery-item {
    display: flex !important; /* Use !important to override previous display:none */
}
/* --- END MODIFIED CSS --- */


.view-more-button {
    display: block;
    width: fit-content;
    margin: 20px auto 0 auto;
    background-color: #28a745;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.view-more-button:hover {
    background-color: #1e7e34;
}

.view-more-button.hidden {
    display: none;
}

/* Styles for the image modal overlay */
#imageModal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
}

/* Modal Content (the image/video) */
.modal-content-container {
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90%;
    max-width: 900px;
    position: relative;
}

#modalImage,
#modalVideo {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    margin: 0 50px;
}
#modalVideo {
    width: auto;
}

/* Caption of Modal Image */
#caption {
    margin: 10px auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 5px 0;
    font-size: 1.1em;
}

/* Add Animation */
.modal-content-container, #caption {
    -webkit-animation-name: zoom;
    -webkit-animation-duration: 0.6s;
    animation-name: zoom;
    animation-duration: 0.6s;
}

@-webkit-keyframes zoom {
    from {-webkit-transform:scale(0)}
    to {-webkit-transform:scale(1)}
}

@keyframes zoom {
    from {transform:scale(0)}
    to {transform:scale(1)}
}

/* The Close Button */
.modal-close-button {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 1001;
}

.modal-close-button:hover,
.modal-close-button:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Navigation Buttons */
.modal-nav-button {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    padding: 16px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    -webkit-user-select: none;
    background-color: rgba(0,0,0,0.5);
    z-index: 1001;
}

.modal-nav-button:hover {
    background-color: rgba(0,0,0,0.8);
}

.prev-button {
    left: 0;
    border-radius: 3px 0 0 3px;
}

.next-button {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.modal-nav-button.hidden {
    display: none;
}

/* Responsive adjustments */
@media only screen and (max-width: 768px){
    .modal-nav-button {
        font-size: 16px;
        padding: 12px;
    }
    #modalImage, #modalVideo {
        margin: 0 30px;
    }
}
@media only screen and (max-width: 500px){
    #modalImage, #modalVideo {
        width: 90%;
        margin: 0;
    }
    .modal-nav-button {
        padding: 8px;
        font-size: 14px;
    }
    .modal-content-container {
        width: 95%;
    }
}
