/**
 * Smart 360 Degree Viewer - CSS
 * 
 * @package Pretpot_Elementor_Kit
 */

/* ============================================
   VIEWER CONTAINER
   ============================================ */
.pretpot-360-viewer-wrapper {
    position: relative;
    width: 100%;
}

.pretpot-360-viewer {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 8px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    touch-action: pan-y pinch-zoom;
}

.pretpot-360-viewer.is-dragging {
    cursor: grabbing !important;
}

.pretpot-360-viewer.is-zoomed {
    cursor: move;
}

.pretpot-360-viewer.is-loading {
    cursor: wait;
}

/* ============================================
   CANVAS
   ============================================ */
.pretpot-360-canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pretpot-360-canvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pretpot-360-viewer.is-zoomed .pretpot-360-canvas {
    cursor: move;
}

/* ============================================
   LOADING STATE
   ============================================ */
.pretpot-360-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.pretpot-360-viewer.is-loaded .pretpot-360-loading {
    opacity: 0;
    pointer-events: none;
}

.pretpot-360-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 15px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: #000;
    border-radius: 50%;
    animation: pretpot-360-spin 1s linear infinite;
}

@keyframes pretpot-360-spin {
    to { transform: rotate(360deg); }
}

.pretpot-360-loading-text {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.pretpot-360-loading-progress {
    width: 200px;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.pretpot-360-progress-bar {
    width: 0;
    height: 100%;
    background: #000;
    transition: width 0.3s ease;
}

/* ============================================
   360° BADGE
   ============================================ */
.pretpot-360-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 20;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.pretpot-360-badge svg {
    animation: pretpot-360-rotate 3s linear infinite;
}

@keyframes pretpot-360-rotate {
    to { transform: rotate(360deg); }
}

.pretpot-360-viewer.badge-fade .pretpot-360-badge {
    opacity: 0;
}

/* ============================================
   CONTROLS
   ============================================ */
.pretpot-360-controls {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    z-index: 20;
}

.pretpot-360-control-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #000;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.pretpot-360-control-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #007bff;
}

.pretpot-360-control-btn:active {
    transform: scale(0.95);
}

.pretpot-360-control-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================
   HOTSPOTS
   ============================================ */
.pretpot-360-hotspots-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15;
}

.pretpot-360-hotspot {
    position: absolute;
    width: 32px;
    height: 32px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    transition: all 0.3s ease;
    z-index: 1;
}

.pretpot-360-hotspot::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(0, 123, 255, 0.2);
    animation: pretpot-360-pulse 2s ease-out infinite;
}

@keyframes pretpot-360-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.pretpot-360-hotspot:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.pretpot-360-hotspot i,
.pretpot-360-hotspot svg {
    font-size: 16px;
    color: #000;
    z-index: 1;
}

.pretpot-360-hotspot.is-active {
    background: #007bff;
}

.pretpot-360-hotspot.is-active i,
.pretpot-360-hotspot.is-active svg {
    color: #fff;
}

/* ============================================
   TOOLTIP
   ============================================ */
.pretpot-360-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
    white-space: nowrap;
    max-width: 250px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 100;
}

.pretpot-360-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #000;
}

.pretpot-360-tooltip.is-visible {
    opacity: 1;
}

.pretpot-360-tooltip-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.pretpot-360-tooltip-content {
    font-size: 12px;
    opacity: 0.9;
    white-space: normal;
}

/* ============================================
   DRAG HINT
   ============================================ */
.pretpot-360-drag-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(0, 0, 0, 0.4);
    font-size: 14px;
    font-weight: 500;
    opacity: 1;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 5;
}

.pretpot-360-viewer.has-interacted .pretpot-360-drag-hint {
    opacity: 0;
}

.pretpot-360-drag-hint svg {
    animation: pretpot-360-bounce 2s ease-in-out infinite;
}

@keyframes pretpot-360-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ============================================
   FULLSCREEN MODE
   ============================================ */
.pretpot-360-viewer.is-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

/* ============================================
   REDUCED MOTION MODE
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .pretpot-360-viewer.respect-reduced-motion * {
        animation: none !important;
        transition: none !important;
    }
    
    .pretpot-360-viewer.respect-reduced-motion .pretpot-360-canvas {
        transition: none !important;
    }
}

/* ============================================
   EMPTY STATE
   ============================================ */
.pretpot-360-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    background: #f5f5f5;
    border: 2px dashed #ddd;
    border-radius: 8px;
    color: #999;
    font-size: 16px;
}

/* ============================================
   FALLBACK
   ============================================ */
.pretpot-360-fallback {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */
@media (max-width: 768px) {
    .pretpot-360-viewer {
        height: 400px;
    }
    
    .pretpot-360-badge {
        top: 10px;
        right: 10px;
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .pretpot-360-controls {
        bottom: 10px;
        gap: 6px;
        padding: 6px;
    }
    
    .pretpot-360-control-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .pretpot-360-tooltip {
        max-width: 200px;
        font-size: 12px;
        padding: 10px 14px;
    }
    
    .pretpot-360-hotspot {
        width: 28px;
        height: 28px;
    }
    
    .pretpot-360-hotspot i,
    .pretpot-360-hotspot svg {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .pretpot-360-viewer {
        height: 300px;
    }
    
    .pretpot-360-drag-hint {
        font-size: 12px;
    }
    
    .pretpot-360-controls {
        flex-wrap: wrap;
        justify-content: center;
        max-width: 90%;
    }
}

/* ============================================
   TOUCH FEEDBACK
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    .pretpot-360-control-btn:active {
        background: rgba(0, 0, 0, 0.2);
    }
    
    .pretpot-360-hotspot:active {
        transform: translate(-50%, -50%) scale(0.95);
    }
}

/* ============================================
   HIGH DPI DISPLAYS
   ============================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .pretpot-360-canvas {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */
@media (prefers-color-scheme: dark) {
    .pretpot-360-viewer {
        background: #1a1a1a;
    }
    
    .pretpot-360-spinner {
        border-color: rgba(255, 255, 255, 0.1);
        border-top-color: #fff;
    }
    
    .pretpot-360-loading-text {
        color: #aaa;
    }
    
    .pretpot-360-progress-bar {
        background: #fff;
    }
    
    .pretpot-360-controls {
        background: rgba(0, 0, 0, 0.9);
    }
    
    .pretpot-360-control-btn {
        color: #fff;
    }
    
    .pretpot-360-control-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #007bff;
    }
    
    .pretpot-360-drag-hint {
        color: rgba(255, 255, 255, 0.4);
    }
    
    .pretpot-360-empty {
        background: #1a1a1a;
        border-color: #333;
        color: #666;
    }
}