/* Pure JavaScript Virtual Tour Styles */

.pure-virtual-tour {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 50vh;
}

/* Loading Screen */
.tour-loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    z-index: 100;
    font-size: 16px;
}

.loader {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Panorama Container */
.panorama-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.panorama-canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

/* In-scene Navigation Arrows */
.scene-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 18;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.45);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.scene-arrow:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.7);
    transform: translateY(-50%) scale(1.05);
}

.scene-arrow:active {
    transform: translateY(-50%) scale(1.0);
}

.scene-arrow .icon {
    font-size: 22px;
    line-height: 1;
}

.scene-arrow-left { left: 16px; }
.scene-arrow-right { right: 16px; }

/* Avoid covering top controls on hover reveal */
.pure-virtual-tour:hover .scene-thumbnails,
.pure-virtual-tour:hover .tour-controls { opacity: 1; }

/* Control Bar */
.tour-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.4), transparent);
    backdrop-filter: blur(10px);
    z-index: 20;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pure-virtual-tour:hover .tour-controls {
    opacity: 1;
}

/* Touch devices: show controls when tapping anywhere */
.pure-virtual-tour.controls-visible .tour-controls,
.pure-virtual-tour.controls-visible .scene-thumbnails {
    opacity: 1;
}

.controls-left,
.controls-center,
.controls-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    user-select: none;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.control-btn:active {
    transform: translateY(0);
}

.control-btn.active {
    background: rgba(74, 144, 226, 0.8);
    border-color: rgba(74, 144, 226, 1);
}

.control-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.control-btn .icon {
    font-size: 18px;
    line-height: 1;
}

/* Scene Info */
.scene-info {
    display: flex;
    flex-direction: column;
    margin-left: 15px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.scene-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 2px;
}

.scene-counter {
    font-size: 12px;
    opacity: 0.8;
}

/* Scene Thumbnails */
.scene-thumbnails {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.6), transparent);
    padding: 20px;
    z-index: 15;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pure-virtual-tour:hover .scene-thumbnails {
    opacity: 1;
}

.thumbnails-wrapper {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.thumbnails-wrapper::-webkit-scrollbar {
    height: 4px;
}

.thumbnails-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.thumbnails-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.thumbnail-item {
    position: relative;
    min-width: 120px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.thumbnail-item:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.thumbnail-item.active {
    border-color: #4a90e2;
    box-shadow: 0 0 20px rgba(74, 144, 226, 0.5);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumbnail-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.6), transparent);
    color: white;
    padding: 8px 10px 6px;
    font-size: 12px;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Scene Description Panel */
.scene-description {
    position: absolute;
    top: 80px;
    right: 20px;
    max-width: 320px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    color: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
    z-index: 25;
    pointer-events: none;
}

.scene-description.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.description-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #4a90e2;
}

.description-text {
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}

.description-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.description-close:hover {
    opacity: 1;
}

/* Hotspots */
.hotspots-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
}

.hotspot {
    position: absolute;
    pointer-events: auto;
    cursor: pointer;
    z-index: 12;
    transform: translate(-50%, -50%);
}

.hotspot-marker {
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, rgba(74, 144, 226, 0.9), rgba(74, 144, 226, 0.6));
    border: 3px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    animation: pulse-hotspot 2s infinite;
    backdrop-filter: blur(5px);
    position: relative;
}

.hotspot-marker::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
}

@keyframes pulse-hotspot {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

.hotspot-label {
    position: absolute;
    top: -45px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    backdrop-filter: blur(10px);
}

.hotspot-label::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid rgba(0, 0, 0, 0.8);
}

.hotspot:hover .hotspot-label {
    opacity: 1;
}

.hotspot:hover .hotspot-marker {
    transform: scale(1.1);
    border-color: #4a90e2;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .tour-controls {
        padding: 10px 15px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .pure-virtual-tour { min-height: 55vh; }
    .panorama-container { min-height: 55vh; }

    .controls-left,
    .controls-center,
    .controls-right {
        gap: 6px;
    }
    
}