/** Reset and Base Configuration */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body,
html {
    height: 100%;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0a;
    overflow: hidden;
    color: #ffffff;
    font-weight: 300;
}

/** Loader */

#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loader.hidden {
    opacity: 0;
    visibility: hidden;
}

#loader.force-hidden {
    display: none !important;
}

.loader-content {
    text-align: center;
    color: #ffffff;
    transform: scale(0.735);
}

.loader-spinner {
    width: 36.75px;
    height: 36.75px;
    border: 1.47px solid rgba(255, 255, 255, 0.1);
    border-top: 1.47px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 14.7px;
}

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

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

.loader-content p {
    font-size: 10.29px;
    letter-spacing: 1.47px;
    text-transform: uppercase;
}

#container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

/** Three.js Canvas */

#canvas-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/** Navigation Crosshair */

#crosshair {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    transform: translate(-20%, -20%);
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

#crosshair.active {
    opacity: 1;
}

#crosshair::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: crosshairPulse 2s infinite;
}

@keyframes crosshairPulse {
    0% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.2;
        transform: translate(-50%, -50%) scale(1.2);
    }

    100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }
}

/** Museum Logo */

#logo {
    position: absolute;
    top: 30px;
    left: 30px;
    z-index: 10;
    font-weight: 500;
    letter-spacing: 1.155px;
    backdrop-filter: blur(15px);
    background-color: rgba(255, 255, 255, 0.12);
    padding: 6.93px 10.395px;
    border-radius: 4.62px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0px 2.31px 8.6625px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.logo-text {
    font-size: 8.085px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.logo-text::after {
    content: '•';
    margin: 0 4.62px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 5.775px;
    display: inline-block;
}

.logo-subtitle {
    font-size: 5.775px;
    opacity: 0.75;
    letter-spacing: 0.86625px;
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

/** Navigation Controls */

#navigation-controls {
    position: absolute;
    bottom: 30px;
    right: 30px;
    backdrop-filter: blur(20px);
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6.0375px;
    padding: 9.66px 10.8675px;
    z-index: 10;
    min-width: 120.75px;
    box-shadow: 0px 2.415px 9.05625px rgba(0, 0, 0, 0.2);
}

.control-group h4 {
    color: #ffffff;
    font-size: 6.9px;
    font-weight: 600;
    margin-bottom: 6.9px;
    text-align: center;
    letter-spacing: 0.69px;
    text-transform: uppercase;
}

.key-hints {
    display: flex;
    align-items: center;
    gap: 4.6px;
    margin-bottom: 4.6px;
    flex-wrap: wrap;
}

.key {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 2.875px;
    padding: 2.875px 4.6px;
    font-size: 5.75px;
    font-weight: 600;
    color: #ffffff;
    min-width: 13.8px;
    text-align: center;
    box-shadow: 0 1.15px 3.45px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.key:active,
.key.active {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0.575px 1.725px rgba(0, 0, 0, 0.4), 0 0 4.6px rgba(255, 255, 255, 0.3);
    transform: translateY(0.575px);
}

.key-hints span:not(.key) {
    font-size: 5.75px;
    color: rgba(255, 255, 255, 0.85);
    flex: 1;
}

/** SVG Icons in Keys */

.key svg {
    display: block;
    margin: 0 auto;
    width: 14px;
    height: 14px;
}

/** Status Indicator */

#status-indicator {
    position: absolute;
    top: 40px;
    right: 40px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 16px;
    z-index: 10;
    font-size: 12px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    gap: 12px;
}

.status-item:last-child {
    margin-bottom: 0;
}

.status-label {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

#movement-mode,
#position-display {
    color: #ffffff;
    font-weight: 500;
}

/** Enhanced Navigation Map */

#navigation-map {
    position: absolute;
    bottom: 30px;
    left: 30px;
    width: 90px;
    height: 90px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.3);
}

#navigation-map::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.map-indicator {
    width: 10px;
    height: 10px;
    background: #4ade80;
    border: 2px solid #ffffff;
    border-radius: 50%;
    position: relative;
    z-index: 1;
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.6);
}

.map-indicator::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    width: 20px;
    height: 20px;
    border: 1px solid rgba(74, 222, 128, 0.4);
    border-radius: 50%;
    animation: mapPulse 2s infinite;
}

@keyframes mapPulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(2);
    }
}

/** Artwork Info */

.info-panel {
    position: absolute;
    top: 50%;
    left: 40px;
    transform: translateY(-50%);
    width: 300px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 25px;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.info-panel.show {
    opacity: 1;
    visibility: visible;
}

.info-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffffff;
}

.info-content p {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.8);
}

.info-content p:last-child {
    margin-bottom: 0;
    margin-top: 15px;
    font-size: 13px;
    line-height: 1.7;
}

/** Interaction Hints */

#interaction-hints {
    position: absolute;
    top: 50%;
    right: 40px;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.hint {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    font-size: 11px;
    letter-spacing: 1.5px;
    opacity: 0.8;
    transition: all 0.3s ease;
    font-weight: 400;
    text-transform: uppercase;
}

.hint:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(-5px);
}

.hint .icon {
    font-size: 16px;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

/** Video Modal */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(20, 20, 20, 0.98) 100%);
    backdrop-filter: blur(20px);
    transition: all 0.4s ease;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1000px;
    background: linear-gradient(145deg, #111 0%, #222 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

#video-player {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 20px;
}

/** Modal States */

.modal.show {
    display: block;
    animation: modalFadeIn 0.4s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/** Additional Effects */

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

/** Custom Cursor for Hotspots */

.hotspot-cursor {
    cursor: pointer;
}

/** Mobile Controls */

#mobile-joystick {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

#mobile-joystick:active {
    opacity: 1;
}

#mobile-look-area {
    pointer-events: auto;
}

/** Hide Mobile Controls on Desktop */

@media (min-width: 769px) {

    #mobile-joystick,
    #mobile-look-area {
        display: none !important;
    }
}

/** Enhanced Responsive */

@media (max-width: 768px) {

    /** Prevent zoom on mobile */

    * {
        touch-action: pan-y;
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
    }

    #logo {
        top: 15px;
        left: 15px;
        padding: 10px 14px;
    }

    .logo-text {
        font-size: 12px;
    }

    .logo-subtitle {
        font-size: 9px;
    }

    #navigation-map {
        bottom: 15px;
        left: 15px;
        width: 70px;
        height: 70px;
    }

    #navigation-controls {
        display: none !important;
    }

    .control-group h4 {
        font-size: 11px;
    }

    .key {
        padding: 4px 6px;
        font-size: 9px;
    }

    .key-hints span:not(.key) {
        font-size: 9px;
    }

    #interaction-hints {
        right: 20px;
        gap: 12px;
    }

    .hint {
        padding: 10px 14px;
        font-size: 10px;
        gap: 10px;
    }

    .hint .icon {
        font-size: 14px;
    }

    .modal-content {
        width: 95%;
        margin: 20px;
        border-radius: 15px;
    }

    .info-panel {
        left: 20px;
        width: calc(100vw - 40px);
        max-width: 350px;
        padding: 20px;
    }

    .info-content h3 {
        font-size: 18px;
    }

    .info-content p {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 98%;
        margin: 10px;
        border-radius: 12px;
    }

    .close-btn {
        top: 15px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    #interaction-hints {
        right: 15px;
    }

    .hint {
        padding: 8px 12px;
        font-size: 9px;
    }
}

/** Background Particle Effects */

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    33% {
        transform: translateY(-10px) rotate(5deg);
    }

    66% {
        transform: translateY(5px) rotate(-5deg);
    }
}

/** Accessibility Improvements */

@media (prefers-reduced-motion: reduce) {

    .loader-spinner,
    .map-indicator::before,
    * {
        animation: none !important;
        transition: none !important;
    }
}

/** High Contrast Mode */

@media (prefers-contrast: high) {

    #logo,
    .hint,
    .modal-content {
        border: 2px solid #ffffff;
        background: #000000;
    }

    .loader-content p,
    .logo-text,
    .hint {
        color: #ffffff;
        text-shadow: none;
    }
}

/** Depth Effects */

.depth-effect {
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.3),
        0 8px 16px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/** Smooth Animations for Interactive Elements */

.interactive {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.interactive:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}