/* Ultra Optimize Renk Değişim Sistemi - CSS Enhancements */

/* Product container optimizations */
.product-image {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    /* GPU acceleration için */
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

/* Main image optimizations */
.main-image {
    transition: all 0.3s ease;
    /* GPU acceleration */
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

/* Hover effects */
.product-card:hover .main-image {
    transform: scale(1.02);
}

/* Loading placeholder */
.image-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Smooth transitions for color changes */
.color-transition-container {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
}

.color-transition-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 15px;
    /* Ultra smooth transitions */
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

/* Performance optimizations */
.product-card {
    /* Container query support */
    contain: layout style paint;
    /* GPU layer creation */
    transform: translateZ(0);
}

/* Preload indicator */
.preload-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.preload-indicator.loaded {
    opacity: 1;
}

.preload-indicator.loading {
    background: #FF9800;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Color rotation status indicator */
.rotation-status {
    position: absolute;
    bottom: 5px;
    left: 5px;
    font-size: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.rotation-status.active {
    opacity: 1;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .color-transition-image {
        transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    
    .product-card:hover .main-image {
        transform: none; /* Disable hover effects on mobile */
    }
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
    .color-transition-image,
    .main-image {
        transition: none !important;
        animation: none !important;
    }
    
    .loading-shimmer {
        animation: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .preload-indicator {
        border: 1px solid currentColor;
    }
    
    .rotation-status {
        border: 1px solid white;
    }
}
