/* Navigation buttons are only visible when overlay is active */
.overlay-container:not(.visible) #left-nav,
.overlay-container:not(.visible) #right-nav {
    visibility: hidden;
}

.overlay-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.overlay-container.visible {
    visibility: visible;
}

#overlay-image {
    max-height: 80%;
    max-width: 80%;
    object-fit: contain;
    z-index: 1001;
}

#close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1002;
}

#left-nav, #right-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1002;

    /*
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    font-size: 2rem;
    padding: 10px 15px;
    cursor: pointer;
    */

    /*
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 2rem;
    padding: 15px 18px;
    cursor: pointer;
    z-index: 1002;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    */
    
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.6);
    color: white;
    font-size: 2rem;
    padding: 12px 16px;
    cursor: pointer;
    z-index: 1002;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    
}

#left-nav {
    left: 20px;
}

#right-nav {
    right: 20px;
}

#left-nav:hover, #right-nav:hover {
    /*filter: brightness(0.8);
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.1);
    */

    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.9);
    transform: translateY(-50%) scale(1.1);

}

#counter {
    position: absolute;
    bottom: 20px;
    z-index: 1002;

    /* Modded style selected from AI options */
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 14px;
    color: #ffffff;
    background: #695848;
    padding: 6px 12px;
    border-radius: 16px;
    border: 1px solid #695848;
    font-weight: 500;

}
.Image-Bank {
    padding-top: 10px;
    width: 80%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    justify-self: center;
}

.image-container {
    position: relative; /* This is correct */
    width: 100%;
    margin-bottom: 5px;
    overflow: hidden; /* Add this */
}

.bank-thumb {
    width: 100%;
    transition: filter 0.3s ease;
    display: block; /* Ensure it's a block element */
}

/* FIXED: Image button styling */
.image-button {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 2; /* Button should be above the thumbnail but below magnifying glass */
    padding: 0; /* Remove any default padding */
}

.magnifying-glass {
    position: absolute;
    top: 50%;
    left: 50%;
    height: 10%;
    width: 10%;
    transform: translate(-50%, -50%);
    z-index: 3; /* Magnifying glass should be above the button */
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Important: allows clicks to pass through to button */
}

.image-container:hover .bank-thumb {
    filter: brightness(0.6);
}

.image-container:hover .magnifying-glass {
    opacity: 1;
}


/* Rest of your existing CSS... */
.Back {
    margin-top: 15px;
    margin-bottom: 5px;
    font-size: 1.0rem;
    text-decoration: none;
    color: #000000;
    font-family: "Canela";
}

#arrow {
    border-right: 2px solid black;
    border-bottom: 2px solid black;
    width: 7px;
    height: 7px;
    transform: rotate(135deg);
    margin-top: -2px;
    display: inline-block;
    vertical-align: middle;
    margin-left: 14px;
    margin-right: 5px;
}

.gallery-title {
    font-family: "Canela", serif;
    font-size: 2.2rem;
    color: #55452f;
    text-align: left;
    margin-top: 10px;
    margin-bottom: 10px;
    margin-left: 10%;
    letter-spacing: 1px;
    font-weight: bold;
}

footer {
    margin-top: 10px;
}

@media (min-width: 1367px) {
    .Image-Bank {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 10px;
        margin-bottom: 10px;
    }
    
    .image-container {
        margin: 0;
    }
    
    .bank-thumb {
        width: 100%;
        margin: 0;
        aspect-ratio: 1 / 1;
        object-fit: cover;
    }
}