/* 🌟 360° PRODUCT VIEWER STYLES */

.product-360-viewer {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-medium);
}

.product-360-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 Aspect Ratio */
}

.product-360-container {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, var(--gray-light) 0%, var(--white) 100%);
}

.product-360-image-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, var(--white) 0%, var(--gray-light) 100%);
}

.product-360-image-container:active {
    cursor: grabbing;
}

#product360Image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.1s ease-out;
    user-select: none;
    pointer-events: none;
}

/* Zoom Lens */
.zoom-lens {
    position: absolute;
    width: 100px;
    height: 100px;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.1);
    backdrop-filter: blur(5px);
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: lens-pulse 2s ease-in-out infinite;
    z-index: 10;
}

@keyframes lens-pulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
    }
}

/* Loading Spinner */
.loading-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    z-index: 100;
    transition: opacity 0.3s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-light);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin360 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin360 {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    color: var(--gray-elegant);
    font-size: 0.9rem;
    text-align: center;
}

/* Viewer Controls */
.viewer-controls {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: var(--blur-medium);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-medium);
}

.rotation-controls,
.zoom-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.control-btn {
    background: none;
    border: none;
    color: var(--charcoal);
    padding: 0.8rem;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.control-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0;
    transition: var(--transition);
    transform: scale(0);
}

.control-btn:hover::before {
    opacity: 1;
    transform: scale(1);
}

.control-btn:hover {
    color: var(--white);
    transform: scale(1.1);
}

.control-btn.active {
    background: var(--primary-color);
    color: var(--white);
    animation: active-pulse 2s ease-in-out infinite;
}

@keyframes active-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7); }
    50% { box-shadow: 0 0 0 10px rgba(212, 175, 55, 0); }
}

.control-btn i {
    position: relative;
    z-index: 1;
    font-size: 0.9rem;
}

/* Zoom Slider */
.zoom-slider-container {
    position: relative;
    margin: 0 0.5rem;
}

#zoomSlider {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

#zoomSlider::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

#zoomSlider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

#zoomSlider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

/* Progress Indicator */
.progress-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--glass-bg);
    backdrop-filter: var(--blur-medium);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.progress-bar {
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-luxury);
    transition: width 0.3s ease;
    border-radius: 2px;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6));
    animation: progress-shine 2s ease-in-out infinite;
}

@keyframes progress-shine {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

.frame-counter {
    font-size: 0.8rem;
    color: var(--charcoal);
    font-weight: 500;
    white-space: nowrap;
}

/* Rotation Hint */
.rotation-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-elegant);
    font-size: 0.9rem;
    text-align: center;
    pointer-events: none;
    z-index: 50;
    transition: opacity 0.3s ease;
}

.rotation-hint i {
    font-size: 2rem;
    animation: hand-wave 1.5s ease-in-out infinite;
}

@keyframes hand-wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

/* Fullscreen Styles */
.product-360-viewer:fullscreen {
    background: var(--charcoal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-360-viewer:fullscreen .product-360-wrapper {
    max-width: 90vw;
    max-height: 90vh;
    padding-bottom: 0;
    aspect-ratio: 4/3;
}

.product-360-viewer:fullscreen .product-360-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .viewer-controls {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem;
        bottom: 10px;
    }
    
    .rotation-controls,
    .zoom-controls {
        gap: 0.3rem;
    }
    
    .control-btn {
        padding: 0.6rem;
    }
    
    .control-btn i {
        font-size: 0.8rem;
    }
    
    #zoomSlider {
        width: 60px;
    }
    
    .progress-indicator {
        bottom: 80px;
        padding: 0.4rem 0.8rem;
    }
    
    .progress-bar {
        width: 80px;
    }
    
    .frame-counter {
        font-size: 0.7rem;
    }
    
    .rotation-hint {
        font-size: 0.8rem;
    }
    
    .rotation-hint i {
        font-size: 1.5rem;
    }
    
    .zoom-lens {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 480px) {
    .product-360-wrapper {
        padding-bottom: 100%; /* Square aspect ratio on small screens */
    }
    
    .viewer-controls {
        bottom: 5px;
        padding: 0.5rem 1rem;
    }
    
    .progress-indicator {
        bottom: 60px;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-up {
    animation: slideUp 0.4s ease-out;
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes slideUp {
    0% { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* High Performance Mode */
.product-360-viewer.performance-mode #product360Image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.product-360-viewer.performance-mode .control-btn {
    transition: none;
}

.product-360-viewer.performance-mode .progress-fill {
    transition: none;
}