/**
 * Marzipano Viewer Custom Styles
 * Styling for hotspots, navigation markers, and UI controls
 */

/* ==========================================================================
   Marzipano Container
   ========================================================================== */

#panorama_viewer {
    width: 100%;
    height: 100%;
    background: #000;
}

.marzipano-hotspot-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ==========================================================================
   Navigation Hotspots
   ========================================================================== */

.marzipano-hotspot {
    position: absolute;
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    transform-origin: center;
    user-select: none;
    -webkit-user-select: none;
}

.hotspot-navigation {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    font-size: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.hotspot-navigation:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.hotspot-navigation:active {
    transform: scale(0.95);
}

/* Icon styles within hotspots */
.hotspot-navigation i {
    pointer-events: none;
}

/* ==========================================================================
   Hotspot Types
   ========================================================================== */

.hotspot-navigation.round {
    border-radius: 50%;
}

.hotspot-navigation.square {
    border-radius: 8px;
}

.hotspot-navigation.round_outline {
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   Hotspot Animations
   ========================================================================== */

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.marzipano-hotspot[data-animation="pulse"] {
    animation: pulse 2s infinite;
}

.marzipano-hotspot[data-animation="bounce"] {
    animation: bounce 1.5s infinite;
}

.marzipano-hotspot[data-animation="rotate"] i {
    animation: rotate 3s linear infinite;
}

/* ==========================================================================
   Loading Indicator
   ========================================================================== */

.marzipano-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 30px;
    border-radius: 10px;
}

.marzipano-loading.active {
    display: flex;
}

.marzipano-loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.marzipano-loading-text {
    color: #fff;
    margin-top: 15px;
    font-size: 14px;
    text-align: center;
}

/* ==========================================================================
   Scene Title Overlay
   ========================================================================== */

.marzipano-scene-title {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    z-index: 100;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.marzipano-scene-title.hidden {
    opacity: 0;
}

/* ==========================================================================
   Control Buttons
   ========================================================================== */

.marzipano-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

.marzipano-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.marzipano-button:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.marzipano-button:active {
    transform: scale(0.95);
}

.marzipano-button.active {
    background: #4CAF50;
    color: #fff;
}

/* Fullscreen button */
.marzipano-fullscreen-btn {
    font-size: 22px;
}

/* Auto-rotate button */
.marzipano-autorotate-btn {
    font-size: 20px;
}

/* ==========================================================================
   Mobile Optimizations
   ========================================================================== */

@media (max-width: 768px) {
    .hotspot-navigation {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    .marzipano-scene-title {
        font-size: 16px;
        padding: 12px 20px;
        top: 10px;
        left: 10px;
    }
    
    .marzipano-controls {
        bottom: 15px;
        right: 15px;
    }
    
    .marzipano-button {
        width: 55px;
        height: 55px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .hotspot-navigation {
        width: 55px;
        height: 55px;
        font-size: 26px;
    }
    
    .marzipano-scene-title {
        font-size: 14px;
        padding: 10px 15px;
    }
    
    .marzipano-button {
        width: 50px;
        height: 50px;
        font-size: 22px;
    }
}

/* ==========================================================================
   Tooltip
   ========================================================================== */

.marzipano-hotspot[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    white-space: nowrap;
    margin-bottom: 10px;
    pointer-events: none;
    z-index: 1000;
}

.marzipano-hotspot[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    margin-bottom: 5px;
}

/* ==========================================================================
   Scene Transition Effects
   ========================================================================== */

.marzipano-scene-transition {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
    z-index: 50;
}

.marzipano-scene-transition.active {
    opacity: 1;
}

/* ==========================================================================
   Error States
   ========================================================================== */

.marzipano-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(220, 53, 69, 0.9);
    color: #fff;
    padding: 20px 30px;
    border-radius: 8px;
    text-align: center;
    z-index: 1000;
    max-width: 400px;
}

.marzipano-error-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.marzipano-error-message {
    font-size: 14px;
    line-height: 1.5;
}

/* ==========================================================================
   Compatibility with Existing UI
   ========================================================================== */

/* Ensure Marzipano works with existing header_vt and control elements */
.header_vt {
    z-index: 200;
}

.fullscreen_control,
.list_control,
.list_slider {
    z-index: 150;
}

/* Hide default Marzipano controls if they exist */
.marzipano-viewer-default-controls {
    display: none !important;
}
