/* ============================================================================
   NIZHARA IMAGE MODAL - NEW SYSTEM
   Simple and reliable image modal overlay
   ============================================================================ */

/* Modal Overlay */
.nizhara-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.nizhara-image-modal.active {
    display: flex;
    opacity: 1;
}

/* Modal Content Container */
.nizhara-modal-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

/* Modal Image */
.nizhara-modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    transition: transform 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Close Button */
.nizhara-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.nizhara-modal-close:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.nizhara-modal-close svg {
    width: 24px;
    height: 24px;
    color: #333;
}

/* Navigation Buttons */
.nizhara-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 0.8;
}

.nizhara-modal-nav:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
    opacity: 1;
}

.nizhara-modal-nav.prev {
    left: 30px;
}

.nizhara-modal-nav.next {
    right: 30px;
}

.nizhara-modal-nav svg {
    width: 28px;
    height: 28px;
    color: #333;
}

/* Image Counter */
.nizhara-modal-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Body scroll lock */
.nizhara-modal-open {
    overflow: hidden !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nizhara-modal-close {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
    
    .nizhara-modal-close svg {
        width: 20px;
        height: 20px;
    }
    
    .nizhara-modal-nav {
        width: 50px;
        height: 50px;
    }
    
    .nizhara-modal-nav.prev {
        left: 15px;
    }
    
    .nizhara-modal-nav.next {
        right: 15px;
    }
    
    .nizhara-modal-nav svg {
        width: 24px;
        height: 24px;
    }
    
    .nizhara-modal-counter {
        bottom: 20px;
        font-size: 14px;
        padding: 8px 16px;
    }
    
    .nizhara-modal-content {
        max-width: 98vw;
        max-height: 98vh;
    }
}

@media (max-width: 480px) {
    .nizhara-modal-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
    
    .nizhara-modal-close svg {
        width: 18px;
        height: 18px;
    }
    
    .nizhara-modal-nav {
        width: 45px;
        height: 45px;
    }
    
    .nizhara-modal-nav.prev {
        left: 10px;
    }
    
    .nizhara-modal-nav.next {
        right: 10px;
    }
    
    .nizhara-modal-nav svg {
        width: 20px;
        height: 20px;
    }
    
    .nizhara-modal-counter {
        bottom: 15px;
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* Animation for modal entrance */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.nizhara-image-modal.active .nizhara-modal-content {
    animation: modalFadeIn 0.3s ease-out;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .nizhara-modal-close,
    .nizhara-modal-nav {
        background: #ffffff;
        border: 2px solid #000000;
    }
    
    .nizhara-modal-close svg,
    .nizhara-modal-nav svg {
        color: #000000;
    }
    
    .nizhara-modal-counter {
        background: #000000;
        border: 2px solid #ffffff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .nizhara-image-modal,
    .nizhara-modal-image,
    .nizhara-modal-close,
    .nizhara-modal-nav {
        transition: none;
    }
    
    .nizhara-image-modal.active .nizhara-modal-content {
        animation: none;
    }
}