/* style.css - Complete 360° Viewer Styles with Enhanced Preloader */

/* OPTIMIZED Universal Theme Detection */
:root {
    --modal-bg-color: #f5f7fa;
    --modal-content-bg: #ffffff;
    --text-color: #333;
    --border-color: rgba(0, 0, 0, 0.1);
    --animation-timing: cubic-bezier(0.4, 0, 0.2, 1);
    --gpu-acceleration: translateZ(0);
}

@media (prefers-color-scheme: dark) {
    :root {
        --modal-bg-color: #2c2c2e;
        --modal-content-bg: #1c1c1e;
        --text-color: #ffffff;
        --border-color: rgba(255, 255, 255, 0.1);
    }
}

.universal-dark-mode {
    --modal-bg-color: #2c2c2e;
    --modal-content-bg: #434345;
    --text-color: #ffffff;
    --border-color: rgba(255, 255, 255, 0.1);
}

.universal-light-mode {
    --modal-bg-color: #f5f7fa;
    --modal-content-bg: #ffffff;
    --text-color: #333;
    --border-color: rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    will-change: auto;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    margin: 0;
    padding: 0;
}

/* ─── PRELOADER ─────────────────────────────────────────── */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    transition: opacity 1s ease;
    contain: layout style paint;
}

@media (prefers-color-scheme: dark) {
    #preloader { background: #1a1a1a; }
    .loading-text { color: #ffffff; }
    .progress-container { background-color: #333333; }
    .logo-section img { filter: brightness(0) invert(1); }
}

.universal-dark-mode #preloader { background: #1a1a1a; }
.universal-dark-mode .loading-text { color: #ffffff; }
.universal-dark-mode .progress-container { background-color: #333333; }
.universal-dark-mode .logo-section img { filter: brightness(0) invert(1); }

#preloader.active { display: flex; }

.view360-loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    padding: 2rem;
    width: 100%;
    max-width: 600px;
}

.logo-section {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-section img {
    width: auto;
    height: 50px;
    object-fit: contain;
    filter: brightness(0) saturate(100%);
}

.loading-text {
    font-size: 1.75rem;
    color: #3d3d3d;
    font-weight: 600;
    letter-spacing: 0.02em;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    text-align: center;
    white-space: nowrap;
    margin-top: -0.5rem;
}

.progress-container {
    width: 100%;
    max-width: 400px;
    height: 12px;
    background-color: #d5d5d5;
    border-radius: 50px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    background: #688e9c;
    width: 0%;
    border-radius: 50px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-bar::after { display: none; }

@media (max-width: 768px) {
    .view360-loader-content { gap: 2rem; padding: 1.5rem; max-width: 90%; }
    .logo-section img { height: 40px; }
    .loading-text { font-size: 1.25rem; letter-spacing: 0.01em; }
    .progress-container { width: 85%; max-width: 350px; height: 10px; }
}

@media (max-width: 480px) {
    .view360-loader-content { gap: 1.5rem; padding: 1rem; max-width: 95%; }
    .logo-section img { height: 35px; }
    .loading-text { font-size: 1rem; letter-spacing: 0; }
    .progress-container { width: 90%; max-width: 300px; height: 8px; }
}

.view360-wave-text { display: none; }
.view360-fade-out { opacity: 0; pointer-events: none; }

/* ─── MAIN CONTAINER ─────────────────────────────────────── */
.view360-main-container { text-align: center; padding: 2rem; }
.view360-subtitle { color: #666; margin-bottom: 2rem; font-size: 1.1rem; }
.view360-model-selector { margin-bottom: 1rem; }
.view360-model-selector select {
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 14px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    transition: all var(--animation-timing) 0.3s;
}

.view-360-btn {
    background: linear-gradient(90deg, #bd0023, #e4002b);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--animation-timing) 0.3s;
    box-shadow: 0 10px 30px rgba(185, 89, 39, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    transform: var(--gpu-acceleration);
}

.view-360-btn:hover {
    transform: translateY(-3px) var(--gpu-acceleration);
    box-shadow: 0 15px 40px rgba(185, 89, 39, 0.4);
}

/* ─── MODAL ──────────────────────────────────────────────── */
.view360-modal {
    background: transparent;
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    will-change: transform, opacity;
    transition: background-color var(--animation-timing) 0.3s;
    contain: layout style paint;
}

.view360-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.view360-modal-content {
    position: relative;
    width: 95%;
    height: 90%;
    max-width: 1200px;
    background: var(--modal-bg-color);
    border-radius: 20px;
    overflow: visible;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    transition: background-color var(--animation-timing) 0.3s;
    will-change: transform;
    contain: layout style;
}

@media (prefers-color-scheme: dark) {
    .view360-modal-content {
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

.universal-dark-mode .view360-modal-content {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.model-viewer-container {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
    background: var(--modal-content-bg);
    transition: background-color var(--animation-timing) 0.3s;
    transform: var(--gpu-acceleration);
    contain: layout style paint;
}

model-viewer {
    width: 100%;
    height: 100%;
    background-color: var(--modal-content-bg);
    --poster-color: transparent;
    --progress-mask: rgba(255, 255, 255, 0.2);
    transition: background-color var(--animation-timing) 0.3s;
    transform: var(--gpu-acceleration);
    will-change: transform;
    contain: layout style paint;
}

/* ─── CLOSE BUTTON ───────────────────────────────────────── */
.view360-close {
    position: absolute;
    top: 20px;
    right: 20px;
    cursor: pointer;
    z-index: 1001;
    background: transparent;
    color: #666666;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--animation-timing) 0.3s;
    box-shadow: none;
    border: 2px solid #666666;
    font-size: 20px;
    transform: var(--gpu-acceleration);
}

@media (prefers-color-scheme: dark) {
    .view360-close { background: transparent; color: #ffffff; border: 2px solid rgba(255, 255, 255, 0.8); box-shadow: none; }
    .view360-close:hover { background: rgba(255, 255, 255, 0.1); color: #ffffff; border: 2px solid rgba(255, 255, 255, 1); }
}

.universal-dark-mode .view360-close { background: transparent; color: #ffffff; border: 2px solid rgba(255, 255, 255, 0.8); box-shadow: none; }
.universal-dark-mode .view360-close:hover { background: rgba(255, 255, 255, 0.1); color: #ffffff; border: 2px solid rgba(255, 255, 255, 1); }

.view360-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 1);
    transform: scale(1.1) var(--gpu-acceleration);
}

.tooltip-active .view360-close {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.view360-modal:has(.view360-tooltip-container.show) .view360-close,
.view360-modal-content:has(.view360-tooltip-container.show) .view360-close {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* ─── HOTSPOT ─────────────────────────────────────────────── */
.hotspot {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(146, 139, 126);
    box-shadow: rgb(146, 139, 126) 0px 0px 0px 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--animation-timing) 0.3s;
    cursor: pointer;
    z-index: 100;
    transform: var(--gpu-acceleration);
    will-change: transform, opacity;
    backface-visibility: hidden;
    pointer-events: auto;
    opacity: 1;
    contain: layout style;
    touch-action: manipulation;
}

@media (prefers-color-scheme: dark) {
    .hotspot { background: rgba(44, 44, 46, 0.95); border: 1px solid rgba(255, 255, 255, 0.3); box-shadow: rgba(255, 255, 255, 0.3) 0px 0px 0px 0.5px; }
    .hotspot::before { background: rgb(255, 255, 255); }
    .hotspot.active { background: rgb(255, 255, 255); color: rgb(44, 44, 46); }
    .hotspot.active::after { color: rgb(44, 44, 46); }
}

.universal-dark-mode .hotspot { background: rgba(44, 44, 46, 0.95); border: 1px solid rgba(255, 255, 255, 0.3); box-shadow: rgba(255, 255, 255, 0.3) 0px 0px 0px 0.5px; }
.universal-dark-mode .hotspot::before { background: rgb(255, 255, 255); }
.universal-dark-mode .hotspot.active { background: rgb(255, 255, 255); color: rgb(44, 44, 46); }
.universal-dark-mode .hotspot.active::after { color: rgb(44, 44, 46); }

.hotspot::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgb(47, 47, 47);
    border-radius: 50%;
}

.hotspot.active { color: rgb(255, 255, 255); background: rgb(47, 47, 47); }
.hotspot.active::before { display: none; }
.hotspot.active::after {
    content: '×';
    position: absolute;
    color: rgb(146, 139, 126);
    font-size: 15px;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.hotspot.disabled { opacity: 0.5 !important; pointer-events: none !important; cursor: not-allowed !important; }
.hotspot:not(.disabled) { transition: opacity 0.3s ease, transform 0.2s ease; }
.hotspot.disabled::after { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(128, 128, 128, 0.3); border-radius: 50%; pointer-events: none; }
.hotspot { pointer-events: auto; cursor: pointer; z-index: 1000; }

@media (max-width: 768px), (pointer: coarse) {
    .hotspot { min-width: 20px; min-height: 20px; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
    .hotspot:active { transform: scale(0.95); }
    .hotspot:focus { outline: 2px solid #007AFF; outline-offset: 2px; }
}

@media (max-width: 768px) {
    model-viewer { touch-action: pan-x pan-y; }
    model-viewer .hotspot { touch-action: manipulation; }
}

/* ─── TOOLTIP — positioned by JS near hotspot ─────────────── */
.view360-tooltip-container {
    position: fixed;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.97);
    color: var(--text-color);
    border-radius: 12px;
    padding: 12px 16px;
    min-width: 220px;
    max-width: 300px;
    width: max-content;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    pointer-events: none;
    will-change: opacity;
    top: 0;
    left: 0;
}

@media (prefers-color-scheme: dark) {
    .view360-tooltip-container {
        background: rgba(44, 44, 46, 0.97);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    }
}

.universal-dark-mode .view360-tooltip-container {
    background: rgba(44, 44, 46, 0.97);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.view360-tooltip-container.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Arrow pointing RIGHT → tooltip is on left of hotspot */
.view360-tooltip-container::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 8px 0 8px 8px;
    border-style: solid;
    border-color: transparent transparent transparent rgba(255, 255, 255, 0.97);
}

@media (prefers-color-scheme: dark) {
    .view360-tooltip-container::after {
        border-color: transparent transparent transparent rgba(44, 44, 46, 0.97);
    }
}

.universal-dark-mode .view360-tooltip-container::after {
    border-color: transparent transparent transparent rgba(44, 44, 46, 0.97);
}

/* Arrow pointing LEFT → tooltip is on right of hotspot */
.view360-tooltip-container.arrow-left::after {
    right: auto;
    left: -8px;
    border-width: 8px 8px 8px 0;
    border-color: transparent rgba(255, 255, 255, 0.97) transparent transparent;
}

@media (prefers-color-scheme: dark) {
    .view360-tooltip-container.arrow-left::after {
        border-color: transparent rgba(44, 44, 46, 0.97) transparent transparent;
    }
}

.universal-dark-mode .view360-tooltip-container.arrow-left::after {
    border-color: transparent rgba(44, 44, 46, 0.97) transparent transparent;
}

.view360-tooltip-content { text-align: left; position: relative; }

.view360-tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
    gap: 8px;
}

.view360-tooltip-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.3;
    flex: 1;
    margin: 0;
}

.view360-tooltip-description {
    font-size: 12px;
    color: var(--text-color);
    opacity: 0.8;
    line-height: 1.5;
    margin: 0;
}

.view360-tooltip-close {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-left: 4px;
    position: relative;
    box-shadow: none;
}

.view360-tooltip-close:hover { background: none; transform: scale(1.2); opacity: 0.7; }
.view360-tooltip-close:active { transform: scale(1.1); }

@media (prefers-color-scheme: dark) {
    .view360-tooltip-close { background: none; border: none; box-shadow: none; color: rgba(255, 255, 255, 0.9); }
    .view360-tooltip-close:hover { background: none; box-shadow: none; opacity: 0.6; }
}

.universal-dark-mode .view360-tooltip-close { background: none; border: none; box-shadow: none; color: rgba(255, 255, 255, 0.9); }
.universal-dark-mode .view360-tooltip-close:hover { background: none; box-shadow: none; opacity: 0.6; }

.view360-tooltip-close .close-icon { line-height: 1; font-weight: normal; font-size: 18px; }
.view360-tooltip-close:hover .close-icon { color: #999; }
.universal-dark-mode .view360-tooltip-close:hover .close-icon { color: rgba(255, 255, 255, 0.6); }

@media (max-width: 768px) {
    .view360-tooltip-container { min-width: 180px; max-width: 240px; padding: 10px 12px; }
    .view360-tooltip-title { font-size: 13px; }
    .view360-tooltip-description { font-size: 11px; }
}

@media (max-width: 480px) {
    .view360-tooltip-container { min-width: 160px; max-width: 200px; padding: 8px 10px; }
    .view360-tooltip-title { font-size: 12px; }
    .view360-tooltip-description { font-size: 10px; }
}

/* ─── AR BUTTON ───────────────────────────────────────────── */
.view-space-btn {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: #f3f3f3;
    color: #272729;
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--animation-timing) 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 100;
    transform: var(--gpu-acceleration);
    width: auto;
    min-width: auto;
    height: auto;
}

.view-space-btn img { transition: all var(--animation-timing) 0.3s; will-change: filter; flex-shrink: 0; }
.view-space-btn span { white-space: nowrap; display: inline-block; visibility: visible; opacity: 1; }

@media (prefers-color-scheme: dark) {
    .view-space-btn { background: rgba(44, 44, 46, 0.95); color: #ffffff; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); }
    .view-space-btn:hover { background: rgba(58, 58, 60, 1); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); }
}

.universal-dark-mode .view-space-btn { background: rgba(44, 44, 46, 0.95); color: #ffffff; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); }
.universal-dark-mode .view-space-btn:hover { background: rgba(58, 58, 60, 1); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); }
.view-space-btn:hover { background: white; transform: translateY(-2px) var(--gpu-acceleration); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15); }

/* ─── BOTTOM NAV ──────────────────────────────────────────── */
.view360-bottom-nav {
    position: absolute;
    bottom: 50%;
    right: 0px;
    transform: translateX(-50%) var(--gpu-acceleration);
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #f3f3f3;
    border-radius: 20px;
    padding: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 100;
    border: 1px solid var(--border-color);
    transition: all var(--animation-timing) 0.3s;
    width: fit-content;
    min-width: auto;
    max-width: 90vw;
}

@media (prefers-color-scheme: dark) {
    .view360-bottom-nav { background: rgba(44, 44, 46, 0.95); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); }
}

.universal-dark-mode .view360-bottom-nav { background: rgba(44, 44, 46, 0.95); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); }

.view360-nav-tab {
    background: transparent;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border-radius: 20px;
    transition: all var(--animation-timing) 0.3s;
    color: var(--text-color);
    white-space: nowrap;
}

.view360-nav-tab:hover { background: rgba(0, 0, 0, 0.05); }

@media (prefers-color-scheme: dark) {
    .view360-nav-tab:hover { background: rgba(255, 255, 255, 0.1); }
}

.universal-dark-mode .view360-nav-tab:hover { background: rgba(255, 255, 255, 0.1); }
.view360-nav-tab.active { background: #666666; color: white; }

/* ─── HOTSPOT BUTTONS ─────────────────────────────────────── */
.view360-hotspot-buttons {
    position: absolute;
    bottom: 20px;
    left: 30%;
    right: auto;
    max-width: calc(100% - 520px);
    transform: none;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: scroll;
    overflow-y: hidden;
    justify-content: flex-start;
    width: auto;
    gap: 4px;
    background: #f3f3f3;
    border-radius: 25px;
    padding: 8px 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 100;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.view360-hotspot-buttons::-webkit-scrollbar { display: none; }

@media (prefers-color-scheme: dark) {
    .view360-hotspot-buttons { background: rgba(44, 44, 46, 0.95); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); }
}

.universal-dark-mode .view360-hotspot-buttons { background: rgba(44, 44, 46, 0.95); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); }

.hotspot-point-btn {
    background: transparent;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    border-radius: 20px;
    transition: all var(--animation-timing) 0.3s;
    color: #272729;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.hotspot-point-btn:hover { background: rgba(0, 0, 0, 0.05); transform: translateY(-1px); }

@media (prefers-color-scheme: dark) {
    .hotspot-point-btn:hover { background: rgba(255, 255, 255, 0.1); }
    .hotspot-point-btn { color: #ffffff; }
    .hotspot-point-btn.active { background: #888888; color: #ffffff; }
}

.universal-dark-mode .hotspot-point-btn:hover { background: rgba(255, 255, 255, 0.1); }
.universal-dark-mode .hotspot-point-btn { color: #ffffff; }
.universal-dark-mode .hotspot-point-btn.active { background: #888888; color: #ffffff; }

.hotspot-point-btn.active { background: #666666; color: white; box-shadow: 0 2px 8px rgba(0 0 0 / 30%); }
.hotspot-point-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── LED BUTTON ──────────────────────────────────────────── */
.led-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #f3f3f3;
    color: #333;
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--animation-timing) 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: none;
    align-items: center;
    gap: 8px;
    z-index: 100;
}

@media (prefers-color-scheme: dark) {
    .led-btn { background: rgba(44, 44, 46, 0.95); color: #ffffff; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); }
    .led-btn:hover { background: rgba(58, 58, 60, 1); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); }
}

.universal-dark-mode .led-btn { background: rgba(44, 44, 46, 0.95); color: #ffffff; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); }
.universal-dark-mode .led-btn:hover { background: rgba(58, 58, 60, 1); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); }

#led-view-button.force-hidden { display: none; visibility: hidden; pointer-events: none; }

.led-btn .lighting-icon { filter: brightness(0) saturate(100%); }

@media (prefers-color-scheme: dark) {
    .led-btn .lighting-icon { filter: brightness(0) invert(1); }
}

.universal-dark-mode .led-btn .lighting-icon { filter: brightness(0) invert(1); }

/* ─── QR MODAL ────────────────────────────────────────────── */
.view360-qr-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    transition: background-color var(--animation-timing) 0.3s;
}

@media (prefers-color-scheme: dark) { .view360-qr-modal { background-color: rgba(0, 0, 0, 0.9); } }
.universal-dark-mode .view360-qr-modal { background-color: rgba(0, 0, 0, 0.9); }
.view360-qr-modal.active { display: flex; align-items: center; justify-content: center; }

.view360-qr-modal-content {
    background: var(--modal-content-bg);
    color: var(--text-color);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    max-width: 320px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    position: relative;
    transition: all var(--animation-timing) 0.3s;
}

@media (prefers-color-scheme: dark) {
    .view360-qr-modal-content { box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4); border: 1px solid rgba(255, 255, 255, 0.1); }
}

.universal-dark-mode .view360-qr-modal-content { box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4); border: 1px solid rgba(255, 255, 255, 0.1); }

.view360-qr-close {
    position: absolute; top: 12px; right: 16px;
    color: var(--text-color); font-size: 20px; font-weight: normal;
    cursor: pointer; z-index: 2001; background: transparent;
    width: 24px; height: 24px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--animation-timing) 0.2s; border: none; line-height: 1;
}

.view360-qr-title { font-size: 1.25rem; color: var(--text-color); margin-bottom: 0.75rem; font-weight: 600; letter-spacing: -0.02em; }

.view360-qr-description {
    color: var(--text-color); opacity: 0.8; margin-bottom: 1.5rem;
    font-size: 0.9rem; line-height: 1.4; max-width: 240px;
    margin-left: auto; margin-right: auto;
}

.qr-code-container { margin: 1.5rem auto; padding: 0; background: transparent; border: none; display: flex; justify-content: center; }

/* ─── INSTRUCTION OVERLAY ─────────────────────────────────── */
@media (max-width: 768px) { #instruction-overlay { display: none; } }

.instruction-overlay {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    display: none; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 900; opacity: 0;
    transition: opacity 0.5s ease; pointer-events: none;
}

.instruction-overlay.show { display: flex; opacity: 1; }
.instruction-overlay.hide { opacity: 0; }
.instruction-content { padding: 0; background: transparent; }

.instruction-text {
    display: flex; align-items: center; gap: 12px;
    font-size: 16px; font-weight: 500; color: #fefdfd;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.6);
}

.instruction-icon { font-size: 24px; display: flex; align-items: center; justify-content: center; font-weight: 700; }

@media (prefers-color-scheme: dark) {
    .instruction-overlay { background: rgba(0, 0, 0, 0.7); }
    .instruction-content { background: transparent; }
    .instruction-text { color: #ffffff; font-weight: 700; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9), 0 0 25px rgba(0, 0, 0, 0.7); }
}

.universal-dark-mode .instruction-overlay { background: rgba(0, 0, 0, 0.7); }
.universal-dark-mode .instruction-content { background: transparent; }
.universal-dark-mode .instruction-text { color: #ffffff; font-weight: 700; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9), 0 0 25px rgba(0, 0, 0, 0.7); }

@media (max-width: 768px) {
    .instruction-content { padding: 0; margin: 0; background: transparent; }
    .instruction-text { font-size: 14px; font-weight: 700; }
    .instruction-icon { font-size: 20px; font-weight: 700; }
}

@media (max-width: 480px) {
    .instruction-content { padding: 0; margin: 0; background: transparent; }
    .instruction-text { font-size: 13px; font-weight: 700; text-align: center; flex-direction: column; gap: 8px; }
}

/* ─── HOTSPOT BUTTONS DARK MODE ───────────────────────────── */
@media (prefers-color-scheme: dark) {
    .view360-hotspot-buttons { background: rgba(44, 44, 46, 0.95); border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); }
}

.universal-dark-mode .view360-hotspot-buttons { background: rgba(44, 44, 46, 0.95); border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); }

/* ─── RESPONSIVE — 481px to 768px ────────────────────────── */
@media (min-width: 481px) and (max-width: 768px) {
    .view360-modal-content { width: 100%; height: 83%; border-radius: 20px; }
    .view360-close { top: 15px; right: 15px; width: 25px; height: 25px; }
    .tooltip-active .view360-close { opacity: 0; visibility: hidden; pointer-events: none; }

    .view360-bottom-nav {
        position: fixed; bottom: 50%; right: 0px;
        transform: translateX(-50%) var(--gpu-acceleration);
        width: auto; max-width: calc(100vw - 20px); min-width: auto;
        display: flex; justify-content: center; gap: 2px;
        background: rgba(255, 255, 255, 0.95); border-radius: 10px; padding: 6px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); z-index: 100;
        border: 1px solid var(--border-color); backdrop-filter: blur(10px);
        overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; -ms-overflow-style: none;
    }

    .view360-bottom-nav::-webkit-scrollbar { display: none; }

    .view360-nav-tab {
        flex: 0 0 auto; padding: 12px 10px; font-size: 12px; font-weight: 500;
        text-align: center; white-space: nowrap; min-width: auto; border-radius: 18px;
        transition: all var(--animation-timing) 0.3s; color: var(--text-color);
        background: transparent; border: none; cursor: pointer; overflow: visible; text-overflow: clip;
    }

    .view360-nav-tab:hover { background: rgba(0, 0, 0, 0.05); }
    .universal-dark-mode .view360-nav-tab:hover { background: rgba(255, 255, 255, 0.1); }
    .view360-nav-tab.active { background: #666666; color: white; transform: scale(1.02) var(--gpu-acceleration); }

    .hotspot { width: 20px; height: 20px; box-shadow: 0 0 0 12px transparent; }
    .led-btn { top: 10px; left: 20px; padding: 10px 18px; font-size: 13px; }

    .view360-hotspot-buttons {
        bottom: 10px; left: 30%; right: auto; max-width: calc(100% - 375px);
        width: auto; justify-content: flex-start; overflow-x: scroll; overflow-y: hidden; padding: 8px 12px; gap: 4px;
    }

    .hotspot-point-btn { flex-shrink: 0; padding: 5px 10px; font-size: 11px; }
    .view-space-btn { position: absolute; bottom: 10px; left: 20px; padding: 10px 15px; font-size: 12px; }
}

/* ─── RESPONSIVE — 480px and below ───────────────────────── */
@media (max-width: 480px) {
    .view360-bottom-nav {
        position: fixed; top: 15px; bottom: auto; left: 50%; right: auto;
        transform: translateX(-50%); width: auto; max-width: calc(100vw - 100px); min-width: auto;
        display: flex; flex-direction: row; justify-content: center; gap: 2px;
        background: #f3f3f3; border-radius: 25px; padding: 4px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); z-index: 100;
        border: 1px solid var(--border-color); backdrop-filter: blur(10px);
        overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; -ms-overflow-style: none;
    }

    .view360-nav-tab {
        flex: 0 0 auto; padding: 10px 16px; font-size: 11px; font-weight: 500;
        text-align: center; white-space: nowrap; min-width: auto; border-radius: 20px;
        transition: all var(--animation-timing) 0.3s; color: var(--text-color);
        background: transparent; border: none; cursor: pointer;
    }

    .view360-close { position: absolute; top: 20px; right: 20px; width: 25px; height: 25px; z-index: 1001; }

    .led-btn {
        position: absolute; top: 60px; right: 15px; left: auto;
        padding: 10px; font-size: 13px; border-radius: 10px; width: 40px; height: 40px;
        display: flex; align-items: center; justify-content: center;
    }

    .led-btn span, .led-btn .led-text { display: none; }
    .led-btn img, .led-btn svg, .led-btn .led-icon { display: block; width: 20px; height: 20px; }

    .view360-modal-content .view360-hotspot-buttons,
    .model-viewer-container .view360-hotspot-buttons {
        position: fixed; bottom: 70px; left: 15px; right: 15px;
        max-width: calc(100% - 30px); width: auto; justify-content: flex-start;
        overflow-x: scroll; overflow-y: hidden; padding: 5px 10px; border-radius: 25px; background: #f3f3f3;
    }

    .hotspot-point-btn { flex-shrink: 0; padding: 7px 10px; font-size: 11px; white-space: nowrap; }

    .view360-modal-content .view-space-btn,
    .model-viewer-container .view-space-btn {
        position: fixed; bottom: calc(120px + 2dvh); left: 15px; right: 15px; transform: none;
        width: calc(100% - 30px); max-width: none; height: auto; min-height: auto;
        padding: 8px 15px; display: flex; flex-direction: row; align-items: center;
        justify-content: center; gap: 10px; background: #666666; color: #ffffff;
        border: 1px solid var(--border-color); border-radius: 15px; font-size: 14px; font-weight: 600;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); white-space: nowrap;
        overflow: visible; opacity: 1; visibility: visible; z-index: 100;
    }

    .view360-modal-content .view-space-btn img,
    .model-viewer-container .view-space-btn img { width: 24px; height: 24px; min-width: 24px; min-height: 24px; flex-shrink: 0; display: block; }

    .view360-modal-content .view-space-btn span,
    .model-viewer-container .view-space-btn span {
        display: inline; font-size: 14px; line-height: 1.2; visibility: visible; opacity: 1;
        font-weight: 600; white-space: nowrap; overflow: visible; flex-shrink: 0; color: inherit;
    }

    .view360-modal-content .view-space-btn:hover,
    .model-viewer-container .view-space-btn:hover { background: #666666; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); transform: translateY(-1px); }

    .view360-modal-content { width: 100%; height: 100%; border-radius: 0; }

    .view360-nav-tab.active { background: #666666; color: white; transform: scale(1.02); }
    .view360-nav-tab:hover { background: rgba(0, 0, 0, 0.05); }

    #ar-icon { filter: brightness(0) invert(1) !important; }
    .led-btn .lighting-icon { filter: brightness(0) saturate(100%) !important; }

    @media (prefers-color-scheme: dark) {
        .view360-nav-tab:hover { background: rgba(255, 255, 255, 0.1); }
        .view360-nav-tab.active { background: #e4002b; color: white; }
        .led-btn .lighting-icon { filter: brightness(0) saturate(100%) !important; }
        .view360-modal-content .view360-hotspot-buttons,
        .model-viewer-container .view360-hotspot-buttons { background: rgba(44, 44, 46, 0.95); border: 1px solid rgba(255, 255, 255, 0.1); }
        .hotspot-point-btn { color: #ffffff; }
        .hotspot-point-btn.active { background: #888888; color: #ffffff; }
    }

    .universal-dark-mode .view360-nav-tab:hover { background: rgba(255, 255, 255, 0.1); }
    .universal-dark-mode .view360-nav-tab.active { background: #666666; color: white; }
    .universal-dark-mode .led-btn .lighting-icon { filter: brightness(0) saturate(100%) !important; }
    .universal-dark-mode .view360-modal-content .view360-hotspot-buttons,
    .universal-dark-mode .model-viewer-container .view360-hotspot-buttons { background: rgba(44, 44, 46, 0.95); border: 1px solid rgba(255, 255, 255, 0.1); }
    .universal-dark-mode .hotspot-point-btn { color: #ffffff; }
    .universal-dark-mode .hotspot-point-btn.active { background: #888888; color: #ffffff; }
}

/* ─── RESPONSIVE — 360px and below ───────────────────────── */
@media (max-width: 360px) {
    .view360-bottom-nav { max-width: calc(100vw - 80px); padding: 3px; }
    .view360-nav-tab { padding: 8px 12px; font-size: 10px; }

    .view360-modal-content .view360-hotspot-buttons,
    .model-viewer-container .view360-hotspot-buttons {
        left: 15px; right: 15px; max-width: calc(100% - 20px); width: auto;
        justify-content: flex-start; overflow-x: scroll; padding: 6px 8px;
    }

    .hotspot-point-btn { flex-shrink: 0; padding: 8px 8px; font-size: 11px; white-space: nowrap; }

    .view360-modal-content .view-space-btn,
    .model-viewer-container .view-space-btn { bottom: 50px; padding: 8px 14px; font-size: 13px; }

    .view360-modal-content .view-space-btn img,
    .model-viewer-container .view-space-btn img { width: 22px; height: 22px; }

    .view360-modal-content .view-space-btn span,
    .model-viewer-container .view-space-btn span { font-size: 13px; }

    .led-btn { top: 60px; right: 15px; padding: 8px; width: 36px; height: 36px; }
    .led-btn img, .led-btn svg, .led-btn .led-icon { width: 18px; height: 18px; }

    @media (prefers-color-scheme: dark) {
        .led-btn { background: rgba(255, 255, 255, 0.95); color: #ffffff; }
        .led-btn img, .led-btn svg, .led-btn .led-icon { filter: brightness(0) invert(1); }
        .led-btn .lighting-icon { filter: brightness(0) saturate(100%); }
        .view360-modal-content .view360-hotspot-buttons,
        .model-viewer-container .view360-hotspot-buttons { background: rgba(44, 44, 46, 0.95); border: 1px solid rgba(255, 255, 255, 0.1); }
        .hotspot-point-btn { color: #ffffff; }
    }

    .universal-dark-mode .led-btn { background: rgba(255, 255, 255, 0.95); color: #ffffff; }
    .universal-dark-mode .led-btn img, .universal-dark-mode .led-btn svg, .universal-dark-mode .led-btn .led-icon { filter: brightness(0) invert(0); }
    .universal-dark-mode .led-btn .lighting-icon { filter: brightness(0) saturate(100%); }
    .universal-dark-mode .view360-modal-content .view360-hotspot-buttons,
    .universal-dark-mode .model-viewer-container .view360-hotspot-buttons { background: rgba(44, 44, 46, 0.95); border: 1px solid rgba(255, 255, 255, 0.1); }
    .universal-dark-mode .hotspot-point-btn { color: #ffffff; }
}