.section-project {
    background-color: lightblue;
    height: auto;
    padding-top: 5rem;
}

/* Tabs Navigation */
.tabs-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    /* Allow wrapping on small screens */
    margin-bottom: 20px;
    gap: 10px;
    padding: 10px;
}

/* Buttons */
.tab-button {
    background-color: white;
    border: 1px solid #ccc;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: bold;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    flex: 1;
    /* Allow buttons to take equal space */
    min-width: 120px;
    /* Prevent too small buttons */
    text-align: center;
}

/* Active Button */
.tab-button.active {
    background-color: #0050a0;
    /* accessible blue */
    color: #ffffff;
    border-color: #0050a0;
}

.tab-button:hover {
    background-color: #004494;
    /* darker hover blue */
    color: #ffffff;
}

/* Hide inactive tab content */
.project-image-container {
    display: none;
}

.project-image-container.active-tab {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    row-gap: 3rem;
    column-gap: 2rem;
    max-width: 1400px;
    width: 90vw;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

/* Container Styling */
/* .project-image-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    overflow-y: hidden;
    box-sizing: border-box;
} */

/* Common Styles for All Images */
/* .project-image img {
    object-fit: cover;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    transition: transform 0.3s ease;
    cursor: pointer;
} */

.project-image img {
    object-fit: cover;
    width: 100%;
    height: auto;

    min-height: 100%;

    border-radius: 8px;
    transition: transform 0.3s ease, opacity 0.5s ease-in-out;
    cursor: pointer;
    background-color: #f2f2f2;

    opacity: 0;

}


.project-image img[loading="lazy"]:not([src=""]) {
    opacity: 1;
}

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

.project-image img:hover {
    transform: scale(1.05);
    /* Slight zoom on hover */
}

/* Vertical Images */
.project-image.vertical {
    aspect-ratio: 3 / 4;
    overflow-y: hidden;
    /* Maintain a 3:4 aspect ratio */
}

/* Horizontal Images */
.project-image.horizontal {
    aspect-ratio: 4 / 3;
    overflow-y: hidden;
    /* Maintain a 4:3 aspect ratio */
}

/* Responsive Behavior */
@media (max-width: 1200px) {
    .project-image-container {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        /* Adjust number of columns for smaller screens */
    }

    .project-image-container.active-tab {

        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
}

@media (max-width: 768px) {

    .project-image-container.active-tab {

        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .tabs-nav {
        flex-direction: row;
        /* Stack buttons */
        align-items: center;
        /* Center items */
        gap: 5px;
    }

    .tab-button {
        width: 100%;
        /* Full width */
        max-width: 300px;
        /* Prevent extreme stretching */
        padding: 12px;
    }
}

@media (max-width: 600px) {
    .project-image-container {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        /* Smaller minimum size for mobile screens */
    }

    .project-image-container.active-tab {

        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .tabs-nav {
        overflow-x: auto;
        /* Allow horizontal scrolling if needed */
        white-space: nowrap;
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        padding: 5px;
        gap: 1rem;
    }

    .tab-button {
        flex: unset;
        width: auto;
        /* Auto-size based on content */
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* Modal Carousel */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    position: relative;
    max-width: 80%;
    max-height: 80%;
    text-align: center;

}

.modal-content img {
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 30px;
    color: white;
    cursor: pointer;
}

.prev,
.next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 30px;
    color: white;
    background: rgba(0, 0, 0, 0.6);
    /* Dark semi-transparent background */
    border: none;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 50%;
    /* Circular button */
    transition: background 0.3s ease;
}

/* Make arrows more visible on hover */
.prev:hover,
.next:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Positioning */
.prev {
    left: 15px;
}

.next {
    right: 15px;
}