/**
 * Arzpaya Plugin Popup Image - Frontend Styles
 * 
 * @package ArzpayaPluginPopupImg
 * @since 1.0.0
 */

/* Container */
.arzpaya-popup-img-container {
    display: inline-block;
    width: 100%;
    max-width: 100%;
}

/* Wrapper */
.arzpaya-popup-img-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    cursor: pointer;
}

/* Image */
.arzpaya-popup-img-wrapper img,
.arzpaya-popup-img-wrapper picture img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: block;
}

/* Overlay */
.arzpaya-popup-img-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 8px;
    pointer-events: none;
}

.arzpaya-popup-img-wrapper:hover .arzpaya-popup-img-overlay {
    opacity: 1;
}

.arzpaya-popup-img-wrapper:hover img,
.arzpaya-popup-img-wrapper:hover picture img {
    filter: brightness(0.7);
}

/* Zoom Icon */
.arzpaya-popup-zoom-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    transition: all 0.3s ease;
    cursor: pointer;
    pointer-events: auto;
    outline: none;
}

.arzpaya-popup-zoom-icon:hover,
.arzpaya-popup-zoom-icon:focus {
    background: white;
    transform: scale(1.1);
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

.arzpaya-popup-zoom-icon svg {
    width: 24px;
    height: 24px;
}

/* Error Message */
.arzpaya-popup-img-error {
    padding: 10px;
    background-color: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    color: #c33;
    margin: 10px 0;
}

/* Modal */
.arzpaya-popup-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.arzpaya-popup-modal-content {
    position: relative;
    padding: 20px;
    width: fit-content;
    max-width: 90%;
    height: fit-content;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.arzpaya-popup-modal-img {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: arzpayaPopupModalZoom 0.3s ease;
    display: block;
}

@keyframes arzpayaPopupModalZoom {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Close Button */
.arzpaya-popup-modal-close {
    position: absolute;
    top: 20px;
    left: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
    margin: 0;
    border: none;
    outline: none;
}

.arzpaya-popup-modal-close:hover,
.arzpaya-popup-modal-close:focus {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* RTL Support */
[dir="rtl"] .arzpaya-popup-modal-close {
    left: auto;
    right: 30px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .arzpaya-popup-zoom-icon {
        width: 40px;
        height: 40px;
    }
    
    .arzpaya-popup-zoom-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .arzpaya-popup-modal-close {
        top: 10px;
        left: 10px;
        width: 40px;
        height: 40px;
        font-size: 30px;
    }
    
    [dir="rtl"] .arzpaya-popup-modal-close {
        left: auto;
        right: 10px;
    }
    
    .arzpaya-popup-modal-content {
        padding: 10px;
        max-width: 95%;
    }
    
    .arzpaya-popup-modal-img {
        max-height: 85vh;
    }
}

