/**
 * Lightweight Image Modal - Performance Optimized CSS
 * Minimal CSS, maksimum performans
 */

.image-modal-lite {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    display: flex !important;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, z-index 0s 0.3s;
    will-change: opacity;
    pointer-events: none;
}

.image-modal-lite.active {
    opacity: 1;
    z-index: 99999;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.3s ease, visibility 0.3s ease, z-index 0s 0s;
}

.image-modal-lite .modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    z-index: 0;
    transition: backdrop-filter 0.3s ease, opacity 0.4s ease;
    
    /* Subtle gradient overlay for premium look */
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.15), transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.1), transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(58, 123, 213, 0.1), transparent 50%);
    background-color: rgba(0, 0, 0, 0.75);
}

.image-modal-lite .modal-content-wrapper {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-lite .modal-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 90vh;
}

.image-modal-lite .modal-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6),
                0 0 80px rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease,
                opacity 0.3s ease;
    touch-action: pan-x pan-y pinch-zoom;
    user-select: none;
    -webkit-user-select: none;
    background: #fff;
}

.image-modal-lite.active .modal-image {
    transform: scale(1) translateY(0);
}

.image-modal-lite .modal-image:hover {
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.7),
                0 0 100px rgba(255, 255, 255, 0.15);
}

/* Close button */
.image-modal-lite .modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.image-modal-lite .modal-close:hover {
    color: #fff;
    transform: rotate(90deg) scale(1.15);
    background: rgba(255, 68, 68, 0.9);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 5px 20px rgba(255, 68, 68, 0.4);
}

/* Navigation buttons */
.image-modal-lite .modal-prev,
.image-modal-lite .modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 2;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 55px;
    height: 55px;
}

.image-modal-lite .modal-prev {
    left: 20px;
}

.image-modal-lite .modal-next {
    right: 20px;
}

.image-modal-lite .modal-prev:hover {
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    transform: translateY(-50%) translateX(-5px) scale(1.1);
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.3);
}

.image-modal-lite .modal-next:hover {
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    transform: translateY(-50%) translateX(5px) scale(1.1);
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.3);
}

/* Counter */
.image-modal-lite .modal-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    z-index: 2;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.image-modal-lite .modal-counter:hover {
    background: rgba(0, 0, 0, 0.85);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .image-modal-lite .modal-backdrop {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
    
    .image-modal-lite .modal-content-wrapper {
        max-width: 100%;
        max-height: 100%;
        padding: 0;
    }
    
    .image-modal-lite .modal-image-container {
        max-height: 100vh;
        width: 100%;
    }
    
    .image-modal-lite .modal-image {
        max-height: 100vh;
        width: 100%;
        border-radius: 0;
        box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5),
                    0 0 60px rgba(255, 255, 255, 0.08);
    }
    
    .image-modal-lite .modal-close {
        top: 10px;
        right: 10px;
        width: 44px;
        height: 44px;
        background: rgba(0, 0, 0, 0.75);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        color: #fff;
    }
    
    .image-modal-lite .modal-close:hover {
        background: rgba(255, 68, 68, 0.9);
        transform: rotate(90deg) scale(1.1);
    }
    
    .image-modal-lite .modal-prev,
    .image-modal-lite .modal-next {
        width: 44px;
        height: 44px;
        background: rgba(0, 0, 0, 0.75);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        color: #fff;
        font-size: 24px;
    }
    
    .image-modal-lite .modal-prev:hover,
    .image-modal-lite .modal-next:hover {
        background: rgba(255, 255, 255, 0.95);
        color: #000;
    }
    
    .image-modal-lite .modal-prev {
        left: 5px;
    }
    
    .image-modal-lite .modal-next {
        right: 5px;
    }
    
    .image-modal-lite .modal-counter {
        bottom: 15px;
        font-size: 13px;
        padding: 8px 16px;
        background: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
    
    /* Touch için daha büyük tıklama alanı */
    .image-modal-lite .modal-prev::after,
    .image-modal-lite .modal-next::after {
        content: '';
        position: absolute;
        top: -10px;
        right: -10px;
        bottom: -10px;
        left: -10px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .image-modal-lite .modal-close {
        width: 40px;
        height: 40px;
    }
    
    .image-modal-lite .modal-prev,
    .image-modal-lite .modal-next {
        width: 40px;
        height: 40px;
    }
    
    .image-modal-lite .modal-counter {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* Landscape mode on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .image-modal-lite .modal-image-container {
        max-height: 100vh;
    }
    
    .image-modal-lite .modal-image {
        max-height: 100vh;
    }
    
    .image-modal-lite .modal-counter {
        bottom: 5px;
    }
}

/* Performance optimizations */
.image-modal-lite * {
    -webkit-tap-highlight-color: transparent;
}

.image-modal-lite svg {
    pointer-events: none;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

