/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(20, 20, 20, 0.95);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    color: white;
    font-family: var(--font-primary);
    max-width: 300px;
    width: 80%;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#loading-text {
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: 500;
}

#loading-details {
    font-size: 0.9rem;
    color: var(--muted-text-color);
    margin-top: 10px;
}

.progress-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 10px;
}

#progress-bar {
    width: 0%;
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

:root {
    --primary-color: #C67583;
    --secondary-color: #D4A5A5;
    --accent-color: #8B4C5C;
    --text-color: #333333;
    --muted-text-color: #6B6B6B;
    --border-color: #E0E0E0;
    --results-bg: rgba(255, 255, 255, 0.95);
    --font-primary: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-text: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    font-family: var(--font-text);
    overflow: hidden;
}

#container {
    position: relative;
    width: 100%;
    height: 100%;
}

#panorama {
    width: 100%;
    height: 100%;
    z-index: 1;
}

#logo {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 3;
    max-width: 140px;
    height: auto;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
    transition: all 0.2s ease;
    opacity: 0.95;
}

#logo:hover {
    transform: scale(1.05);
    opacity: 1;
}

#map {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 300px;
    height: 200px;
    z-index: 2;
    border: 3px solid white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Responsive logo sizing */
@media (max-width: 768px) {
    #logo {
        max-width: 70px;
        top: 15px;
        left: 15px;
    }

    #map {
        width: 200px;
        height: 150px;
        bottom: 15px;
        right: 15px;
    }
}

@media (max-width: 480px) {
    #logo {
        max-width: 55px;
        top: 12px;
        left: 12px;
    }

    #map {
        width: 150px;
        height: 120px;
        bottom: 80px;
        right: 10px;
    }
}

#controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    background: rgba(0, 0, 0, 0.55);
    padding: 12px 24px;
    border-radius: 999px;
    color: white;
    display: flex;
    gap: 15px;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

button {
    cursor: pointer;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 999px;
    font-weight: 600;
    font-family: var(--font-primary);
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

button:hover {
    background: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#btn-share {
    background: var(--primary-color);
    color: white;
}

#btn-share:hover {
    background: var(--accent-color);
    box-shadow: 0 2px 12px rgba(198, 117, 131, 0.4);
}

#frame-display {
    font-family: var(--font-primary);
    font-weight: 500;
    letter-spacing: 0.5px;
}

.custom-hotspot {
    height: 120px;
    width: 120px;
    background-image: url('ui/SVG/chevron-up.svg');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    transition: transform 0.2s, filter 0.2s;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.custom-hotspot:hover {
    transform: scale(1.15);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.7));
}

/* Flip the back arrow visually */
.hotspot-prev {
    transform: rotate(180deg);
}

.hotspot-prev:hover {
    transform: rotate(180deg) scale(1.15);
}

/* Debug info text under arrows */
.custom-tooltip span {
    display: block;
    position: absolute;
    top: 130px; /* Below the arrow */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #00ff00;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-family: monospace;
    white-space: nowrap;
    pointer-events: none;
    line-height: 1.3;
    text-align: left;
}