/**
 * Product 360 Rotator Styles
 */

.theunframer-product-360-rotator {
    width: 60%;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1rem;
}

.product-360-container {
    position: relative;
    width: 100%;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.product-360-viewer {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 aspect ratio */
    overflow: hidden;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.product-360-viewer:active {
    cursor: grabbing;
}

.product-360-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
}

/* Loading Indicator */
.product-360-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    z-index: 10;
    transition: opacity 0.3s ease;
}

.product-360-loading .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e9ecef;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: rotate360 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes rotate360 {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.product-360-loading p {
    margin: 0;
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Controls */
.product-360-controls {
    padding: 1.5rem;
    background: #ffffff;
    border-top: 1px solid #e9ecef;
}

/* Hint */
.product-360-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: #6c757d;
    font-size: 0.9rem;
    transition: opacity 0.3s ease;
}

.product-360-hint svg {
    width: 24px;
    height: 24px;
    color: #007bff;
    animation: dragAnimation 1.5s ease-in-out infinite;
}

@keyframes dragAnimation {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(8px);
    }
}

/* Navigation Controls */
.product-360-navigation {
    width: 100%;
}

/* Scrubber */
.product-360-scrubber {
    flex: 1;
    position: relative;
}

.scrubber-track {
    position: relative;
    width: 100%;
    height: 12px;
    background: #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    overflow: visible;
}

.scrubber-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    border-radius: 6px;
    pointer-events: none;
    transition: width 0.1s ease;
}

.scrubber-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background: #ffffff;
    border: 3px solid #007bff;
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.1s ease;
    z-index: 2;
}

.scrubber-handle:hover,
.scrubber-handle:focus {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    outline: none;
}

.scrubber-handle.dragging {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.scrubber-handle:focus {
    border-color: #0056b3;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* Responsive Design */
@media (max-width: 768px) {
    .theunframer-product-360-rotator {
        width: 90%;
        padding: 1rem 0.5rem;
    }

    .product-360-viewer {
        padding-bottom: 100%; /* 1:1 aspect ratio on mobile */
    }

    .product-360-controls {
        padding: 1rem;
    }

    .product-360-hint {
        font-size: 0.85rem;
    }

    .product-360-hint svg {
        width: 20px;
        height: 20px;
    }

    .scrubber-handle {
        width: 20px;
        height: 20px;
        border-width: 2px;
    }

    .scrubber-track {
        height: 10px;
    }
}

/* WordPress Editor Specific Styles */
.block-editor-block-list__block .theunframer-product-360-rotator {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* Full Width Alignment */
.theunframer-product-360-rotator.alignfull {
    width: 100%;
    max-width: 100%;
}

.theunframer-product-360-rotator.alignwide {
    width: 100%;
    max-width: 840px;
}
