﻿/* Modal backdrop and layout */
.modal {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.75); /* dark dim background */
    backdrop-filter: blur(2px);
    padding: 20px; /* Prevents image from touching edges */
    box-sizing: border-box;
}

/* Modal content wrapper to center image */
.modal-content-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 80vh;
}

/* The image itself */
.modal-content {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
    animation: zoomIn 0.3s ease-out;
}

/* Close button (X) */
.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #ffffff;
    font-size: 30px;
    font-weight: bold;
    background-color: rgba(0, 0, 0, 0.4);
    padding: 6px 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease;
}

    .close:hover {
        background-color: rgba(255, 255, 255, 0.2);
    }

/* Smooth zoom-in animation */
@keyframes zoomIn {
    from {
        transform: scale(0.85);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Gallery thumbnails */
.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    padding: 10px;
}

.gallery-thumbnail {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .gallery-thumbnail:hover {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

/* Modal nav arrows */
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0 15px;
    z-index: 1001;
}

    .modal-nav:hover {
        color: #ccc;
    }

    .modal-nav.prev {
        left: 10px;
    }

    .modal-nav.next {
        right: 10px;
    }
