/* Image Zoom Styles */

/* Zoomable image cursor */
.zoomable-image {
    cursor: zoom-in;
    transition: transform 0.2s;
}

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

/* Modal styles */
.image-zoom-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

/* Modal content */
.image-zoom-content {
    position: relative;
    margin: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    max-width: 100vw;
    max-height: 100vh;
    animation: zoom 0.3s ease;
    /* Make sure the content area is clickable for closing */
    cursor: pointer;
}

/* Animation for zooming in */
@keyframes zoom {
    from {transform: scale(0.8); opacity: 0;}
    to {transform: scale(1); opacity: 1;}
}

/* Zoomed image */
.image-zoom-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    cursor: default; /* Override the pointer cursor from parent */
    z-index: 10001; /* Ensure image is above the content area */
}

/* Close button */
.image-zoom-close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    z-index: 10000;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
}

.image-zoom-close:hover,
.image-zoom-close:focus {
    color: #bbb;
    text-decoration: none;
    background-color: rgba(255, 255, 255, 0.2);
}

/* Responsive adjustments */
@media only screen and (max-width: 700px) {
    .image-zoom-img {
        max-width: 95%;
        max-height: 95%;
    }
    
    .image-zoom-close {
        top: 10px;
        right: 10px;
        font-size: 30px;
    }
}

/* Accessibility - focus styles */
.zoomable-image:focus,
.image-zoom-close:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}
