/* Styles for the Fullscreen Image Gallery Overlay */

.gallery-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Semi-transparent black background */
    backdrop-filter: blur(5px); /* Optional: blur the background content */
    z-index: 1050; /* Above navbar and all other content */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
}

.gallery-overlay.active {
    opacity: 1;
    visibility: visible;
}

.gallery-fullscreen-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain; /* Ensure image fits within the view while maintaining aspect ratio */
    transform: scale(0.8); /* Initial scale for animation */
    opacity: 0; /* Initial opacity for animation */
    transition: transform 0.4s ease-out, opacity 0.4s ease-out;
}

.gallery-overlay.active .gallery-fullscreen-img {
    transform: scale(1); /* Scale up when active */
    opacity: 1; /* Fade in when active */
}

.close-gallery {
    position: absolute;
    top: 30px;
    right: 40px;
    font-size: 3rem;
    color: #fff;
    cursor: pointer;
    transition: transform 0.3s ease-in-out, color 0.3s ease-in-out;
    z-index: 1060; /* Above image and arrows */
}

.close-gallery:hover {
    color: #dc3545; /* Red on hover */
    transform: rotate(90deg);
}

.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 4rem; /* Larger arrows */
    cursor: pointer;
    padding: 10px 15px;
    background-color: rgba(0, 0, 0, 0.3); /* Slightly transparent background for arrows */
    border-radius: 5px;
    user-select: none; /* Prevent text selection */
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
    z-index: 1055; /* Above image, below close button */
}

.gallery-nav-btn:hover {
    background-color: rgba(0, 0, 0, 0.6);
    color: #007bff; /* Blue on hover */
}

.gallery-prev {
    left: 20px;
}

.gallery-next {
    right: 20px;
}

/* Animation for image change within the gallery */
.gallery-fullscreen-img.animate-in {
    animation: fadeInScale 0.4s ease-out forwards;
}

@keyframes fadeInScale {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}
.gallery-fullscreen-img.animate-out {
    animation: fadeOutScale 0.4s ease-in forwards;
}

@keyframes fadeOutScale {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0.8);
        opacity: 0;
    }
}