/* Base Reset & Variables */
:root {
    --bg-dark: #050914;
    --primary-neon: #00f3ff;
    --accent-orange: #ff5722;
    --glass-bg: rgba(5, 9, 20, 0.7);
    --glass-border: rgba(0, 243, 255, 0.3);
    --panel-shadow: 0 0 20px rgba(0, 243, 255, 0.2);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-body);
}

body {
    overflow: hidden;
    background-color: var(--bg-dark);
    color: #fff;
    height: 100vh;
    width: 100vw;
}

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

/* Hide default Pannellum info box (bottom left) */
.pnlm-panorama-info {
    display: none !important;
}

/* Glassmorphism utility */
.cyber-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--panel-shadow);
}

/* Header UI */
.app-header {
    position: absolute;
    top: 30px;
    left: 0;
    width: 100%;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    pointer-events: none;
}

.logo-container {
    pointer-events: auto;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.logo-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.4);
}

/* Glitch Title */
.main-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: #ffffff;
    margin-bottom: 6px;
    position: relative;
    text-transform: uppercase;
    text-shadow: 0 0 10px var(--primary-neon);
}

.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    pointer-events: none;
}

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 var(--accent-orange);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 var(--primary-neon);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(20px, 9999px, 85px, 0);
    }

    5% {
        clip: rect(61px, 9999px, 14px, 0);
    }

    10% {
        clip: rect(31px, 9999px, 5px, 0);
    }

    15% {
        clip: rect(89px, 9999px, 34px, 0);
    }

    20% {
        clip: rect(10px, 9999px, 73px, 0);
    }

    25% {
        clip: rect(48px, 9999px, 25px, 0);
    }

    30% {
        clip: rect(77px, 9999px, 91px, 0);
    }

    35% {
        clip: rect(15px, 9999px, 45px, 0);
    }

    40% {
        clip: rect(54px, 9999px, 81px, 0);
    }

    45% {
        clip: rect(96px, 9999px, 12px, 0);
    }

    50% {
        clip: rect(39px, 9999px, 66px, 0);
    }

    55% {
        clip: rect(72px, 9999px, 38px, 0);
    }

    60% {
        clip: rect(27px, 9999px, 94px, 0);
    }

    65% {
        clip: rect(81px, 9999px, 57px, 0);
    }

    70% {
        clip: rect(8px, 9999px, 21px, 0);
    }

    75% {
        clip: rect(65px, 9999px, 79px, 0);
    }

    80% {
        clip: rect(42px, 9999px, 50px, 0);
    }

    85% {
        clip: rect(92px, 9999px, 33px, 0);
    }

    90% {
        clip: rect(18px, 9999px, 86px, 0);
    }

    95% {
        clip: rect(59px, 9999px, 9px, 0);
    }

    100% {
        clip: rect(34px, 9999px, 62px, 0);
    }
}

.sub-title {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.highlight-text {
    color: var(--accent-orange);
    font-weight: 700;
    text-shadow: 0 0 8px rgba(255, 87, 34, 0.5);
}

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

.menu-btn {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    /* Tech style uses less circles */
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: var(--primary-neon);
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.1);
}

.menu-btn:hover {
    background: rgba(0, 243, 255, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
    color: #fff;
    border-color: #fff;
}

/* Modal Panels */
.modal-panel {
    position: absolute;
    top: 100px;
    right: 3rem;
    width: 320px;
    max-height: calc(100vh - 180px);
    z-index: 200;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    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 var(--glass-border);
}

.panel-header h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-neon);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.close-btn {
    background: none;
    border: none;
    color: var(--primary-neon);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

.close-btn:hover {
    color: #fff;
    transform: rotate(90deg);
}

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

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

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

.panel-content::-webkit-scrollbar-thumb {
    background: var(--primary-neon);
    border-radius: 2px;
}

/* 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.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: #ddd;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.scene-item-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--primary-neon);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.scene-item-btn:hover {
    background: rgba(0, 243, 255, 0.05);
    color: #fff;
    padding-left: 1.5rem;
}

.scene-item-btn:hover::before {
    transform: scaleY(1);
}

.scene-item-btn.active {
    background: rgba(0, 243, 255, 0.1);
    border-color: rgba(0, 243, 255, 0.3);
    color: #fff;
    padding-left: 1.5rem;
}

.scene-item-btn.active::before {
    transform: scaleY(1);
    background: var(--accent-orange);
}

/* Bottom Scene Title */
.scene-title-overlay {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    width: max-content;
}

.current-scene {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--primary-neon);
    padding: 0.8rem 2.5rem;
    border-radius: 4px;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
    animation: fadeInUp 0.6s ease;
    position: relative;
    white-space: nowrap;
    text-align: center;
    width: max-content;
}

.current-scene::before,
.current-scene::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border: 2px solid var(--accent-orange);
}

.current-scene::before {
    top: -2px;
    left: -2px;
    border-right: none;
    border-bottom: none;
}

.current-scene::after {
    bottom: -2px;
    right: -2px;
    border-left: none;
    border-top: none;
}

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

.loader {
    text-align: center;
}

.loader-text {
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--primary-neon);
    margin-bottom: 20px;
    letter-spacing: 5px;
    font-family: 'BatmanForeverAlternate', 'Outfit', sans-serif;
    text-transform: uppercase;
}

.loader-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}

.loader-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 50%;
    background: linear-gradient(90deg, var(--primary-neon), var(--accent-orange));
    animation: loadingBar 1s infinite ease-in-out alternate;
}

/* Keyframes */
@keyframes loadingBar {
    0% {
        left: 0;
    }

    100% {
        left: 50%;
    }
}

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

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Animations for Pannellum Hotspots */
.custom-hotspot {
    height: 24px;
    width: 24px;
    background: rgba(0, 243, 255, 0.4);
    border-radius: 50%;
    border: 2px solid var(--primary-neon);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.6);
    cursor: pointer;
    animation: cyberPulse 2s infinite;
}

.custom-hotspot:hover {
    background: var(--accent-orange);
    border-color: #fff;
    box-shadow: 0 0 20px var(--accent-orange);
    transform: scale(1.1);
}

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

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

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

/* Custom Hotspot Label */
.hotspot-label {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(5, 9, 20, 0.95);
    color: #fff;
    padding: 6px 12px;
    font-family: var(--font-heading);
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    border: 1px solid var(--primary-neon);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

/* Bottom Control Bar */
.control-bar {
    position: absolute;
    bottom: 30px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    border-radius: 8px;
    gap: 0.5rem;
}

.control-btn {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: #fff;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: rgba(0, 243, 255, 0.15);
    border-color: var(--primary-neon);
    color: var(--primary-neon);
    transform: translateY(-2px);
}

.control-divider {
    width: 1px;
    height: 24px;
    background: var(--glass-border);
    margin: 0 4px;
}

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

    .logo-container {
        padding: 6px 16px;
        text-align: center;
        max-width: 70vw;
    }

    .main-title {
        font-size: 0.85rem;
        white-space: normal;
        text-align: center;
    }

    .sub-title {
        font-size: 0.7rem;
        text-align: center;
        margin-top: 2px;
        display: block;
    }

    .nav-menu {
        position: absolute;
        top: 10px;
        right: 10px;
        gap: 8px;
    }

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

    .modal-panel {
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 75vh;
        border-radius: 20px 20px 0 0;
        border-bottom: none;
    }

    .panel-content {
        max-height: calc(75vh - 70px);
    }

    .scene-title-overlay {
        bottom: 30px;
    }

    .current-scene {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }

    .control-bar {
        bottom: 30px;
        right: 20px;
        padding: 0.4rem;
    }

    .control-btn {
        width: 36px;
        height: 36px;
    }

}