/* ============================================
   360° Photo Viewer Widget - Base Styles
   ============================================ */

.unlockafe-360-viewer {
    position: relative;
    width: 100%;
    min-height: 200px;
    height: 500px;
    overflow: hidden;
    background: #000;
    border-radius: 8px;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

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

.unlockafe-360-viewer .viewer-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.unlockafe-360-viewer .viewer-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
    z-index: 1;
}

.unlockafe-360-viewer .viewer-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 2;
}

.unlockafe-360-viewer .viewer-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    text-align: center;
    color: #ffffff;
    pointer-events: none;
}

.unlockafe-360-viewer .viewer-loading p {
    margin: 1rem 0 0 0;
    font-size: 1rem;
    font-weight: 500;
}

.unlockafe-360-viewer .loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

.unlockafe-360-viewer.loaded .viewer-loading {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.unlockafe-360-viewer.loaded .viewer-placeholder {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* ============================================
   Controls
   ============================================ */

.unlockafe-360-viewer .viewer-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.unlockafe-360-viewer.no-controls .viewer-controls {
    display: none;
}

.unlockafe-360-viewer .viewer-controls button {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
}

.unlockafe-360-viewer .viewer-controls button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.unlockafe-360-viewer .viewer-controls button:active {
    transform: scale(0.95);
}

.unlockafe-360-viewer .viewer-controls button.active {
    background: rgba(102, 126, 234, 0.8);
    color: #ffffff;
}

/* ============================================
   Style 1 - Standard
   ============================================ */

.unlockafe-360-viewer.viewer-style-1 {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* ============================================
   Style 2 - Fullscreen
   ============================================ */

.unlockafe-360-viewer.viewer-style-2 {
    border-radius: 0;
    height: 100vh;
}

.unlockafe-360-viewer.viewer-style-2 .viewer-controls {
    bottom: 30px;
    right: 30px;
}

/* ============================================
   Style 3 - Minimal
   ============================================ */

.unlockafe-360-viewer.viewer-style-3 {
    background: transparent;
    border: 1px solid #e5e7eb;
}

.unlockafe-360-viewer.viewer-style-3 .viewer-controls {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.unlockafe-360-viewer.viewer-style-3 .viewer-controls button {
    background: rgba(0, 0, 0, 0.05);
    color: #333333;
}

.unlockafe-360-viewer.viewer-style-3 .viewer-controls button:hover {
    background: rgba(0, 0, 0, 0.1);
}

.unlockafe-360-viewer.viewer-style-3 .viewer-controls button.active {
    background: #667eea;
    color: #ffffff;
}

/* ============================================
   Fullscreen Mode
   ============================================ */

.unlockafe-360-viewer.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    border-radius: 0;
}

.unlockafe-360-viewer.fullscreen .viewer-btn-fullscreen i::before {
    content: "\f066"; /* fa-compress */
}

/* ============================================
   Touch Indicators
   ============================================ */

.unlockafe-360-viewer .touch-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    z-index: 5;
    transition: opacity 0.3s ease;
}

.unlockafe-360-viewer.touching .touch-indicator {
    opacity: 1;
}

/* ============================================
   Responsive Design - Tablet (≤768px)
   ============================================ */

@media (max-width: 768px) {
    .unlockafe-360-viewer {
        height: 400px;
    }

    .unlockafe-360-viewer .viewer-controls {
        bottom: 15px;
        right: 15px;
        padding: 8px;
        gap: 8px;
    }

    .unlockafe-360-viewer .viewer-controls button {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .unlockafe-360-viewer .viewer-loading p {
        font-size: 0.9rem;
    }

    .unlockafe-360-viewer .loading-spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
}

/* ============================================
   Responsive Design - Mobile (≤480px)
   ============================================ */

@media (max-width: 480px) {
    .unlockafe-360-viewer {
        height: 300px;
        border-radius: 6px;
    }

    .unlockafe-360-viewer .viewer-controls {
        bottom: 10px;
        right: 10px;
        padding: 6px;
        gap: 6px;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .unlockafe-360-viewer .viewer-controls button {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .unlockafe-360-viewer .viewer-loading {
        padding: 0 1rem;
    }

    .unlockafe-360-viewer .viewer-loading p {
        font-size: 0.85rem;
    }

    .unlockafe-360-viewer .loading-spinner {
        width: 35px;
        height: 35px;
        border-width: 3px;
    }
}

/* ============================================
   Loading States
   ============================================ */

.unlockafe-360-viewer.loading .viewer-canvas {
    opacity: 0;
}

.unlockafe-360-viewer.loaded .viewer-canvas {
    opacity: 1;
    transition: opacity 0.5s ease;
}

/* ============================================
   Error State
   ============================================ */

.unlockafe-360-viewer.error .viewer-loading {
    color: #ef4444;
}

.unlockafe-360-viewer.error .viewer-loading p::before {
    content: "⚠ ";
}


