/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    overflow: hidden;
    /* Hide scrollbars, VR fills viewport */
    background-color: #000;
    color: #fff;
    height: 100vh;
    width: 100vw;
}

/* VR Panorama Container */
#panorama-container {
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    /* Below UI elements */
}

/* Glassmorphism utility */
.glass {
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Header UI */
.app-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    pointer-events: none;
    /* Let clicks pass through except on child elements */
}

.logo-container {
    pointer-events: auto;
    background: rgba(10, 10, 10, 0.7);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.logo-container:hover {
    transform: translateY(-2px);
}

.main-title {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #ffffff;
    margin-bottom: 4px;
}

.sub-title {
    font-size: 0.9rem;
    color: #a0a0a0;
    font-weight: 400;
}

/* Navigation Buttons */
.nav-menu {
    display: flex;
    gap: 1rem;
    pointer-events: auto;
}

.menu-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.menu-btn:hover {
    background: rgba(50, 50, 50, 0.8);
    transform: scale(1.05);
}

.menu-btn:active {
    transform: scale(0.95);
}

/* Modal Panels */
.modal-panel {
    position: absolute;
    top: 100px;
    right: 3rem;
    width: 320px;
    max-height: calc(100vh - 180px);
    z-index: 90;
    background: rgba(15, 15, 15, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    animation: slideInRight 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.panel-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.close-btn {
    background: none;
    border: none;
    color: #a0a0a0;
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: #fff;
}

.panel-content {
    padding: 1rem;
    overflow-y: auto;
}

/* Custom Scrollbar for panel */
.panel-content::-webkit-scrollbar {
    width: 6px;
}

.panel-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.panel-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Scene List Items */
.scene-list {
    list-style: none;
}

.scene-item-btn {
    width: 100%;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: #ddd;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.scene-item-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(4px);
}

.scene-item-btn.active {
    background: rgba(64, 156, 255, 0.2);
    border-color: rgba(64, 156, 255, 0.5);
    color: #fff;
    border-left: 3px solid #409cff;
}

/* Bottom Scene Title */
.scene-title-overlay {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    pointer-events: none;
}

.current-scene {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.6s ease;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #409cff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-overlay span {
    font-size: 1.1rem;
    color: #ccc;
    letter-spacing: 1px;
}

/* Keyframes */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Animations for Pannellum Hotspots */
.custom-hotspot {
    height: 22px;
    width: 22px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    animation: hotspotPulse 2s infinite;
}

.custom-hotspot:hover {
    transform: scale(1.2);
    background: #409cff;
}

@keyframes hotspotPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

/* Responsive constraints */
@media (max-width: 768px) {
    .app-header {
        padding: 12px;
        flex-direction: column;
        align-items: flex-end;
        justify-content: flex-start;
        gap: 12px;
    }

    .logo-container {
        padding: 8px 14px;
        text-align: right;
        max-width: 80vw;
    }

    .main-title {
        font-size: 1.0rem;
    }

    .sub-title {
        font-size: 0.75rem;
    }

    .menu-btn {
        width: 40px;
        height: 40px;
    }

    .menu-btn svg {
        width: 18px;
        height: 18px;
    }

    .modal-panel {
        top: 120px;
        right: 1rem;
        left: 1rem;
        width: auto;
    }

    .scene-title-overlay {
        bottom: 5.5rem;
        /* Move up to prevent overlap with Pannellum default UI */
    }

    .current-scene {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
    }
}

/* Custom Hotspot Label */
.hotspot-label {
    position: absolute;
    top: -34px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    opacity: 0.9;
}