/* Modal Lightbox Styles */

/* Dark overlay background */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Show modal when active */
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal container */
.modal-container {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

/* Scale up animation when modal is active */
.modal-overlay.active .modal-container {
    transform: scale(1);
}

/* Modal content */
.modal-content {
    position: relative;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 100%;
}

/* Modal image */
.modal-image {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Close button */
.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    z-index: 10001;
    padding: 0;
}

.modal-close:hover {
    background-color: #fff;
    transform: rotate(90deg);
}

.modal-close:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Cancel button */
.modal-cancel {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 255, 255, 0.95);
    border: 2px solid #333;
    border-radius: 25px;
    padding: 10px 20px;
    cursor: pointer;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    z-index: 10001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-cancel:hover {
    background-color: #fff;
    border-color: #000;
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.modal-cancel:active {
    transform: translateX(-50%) translateY(0);
}

.modal-cancel:focus {
    outline: 2px solid #333;
    outline-offset: 2px;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .modal-container {
        max-width: 95%;
    }

    .modal-close {
        top: -35px;
        right: -5px;
        width: 35px;
        height: 35px;
        font-size: 20px;
        background-color: rgba(255, 255, 255, 0.95);
    }

    .modal-image {
        max-height: 85vh;
    }

    .modal-cancel {
        bottom: 15px;
        padding: 8px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .modal-container {
        max-width: 98%;
    }

    .modal-close {
        top: -30px;
        right: -10px;
        width: 30px;
        height: 30px;
        font-size: 18px;
    }

    .modal-image {
        max-height: 80vh;
    }

    .modal-cancel {
        bottom: 10px;
        padding: 6px 14px;
        font-size: 12px;
    }
}