/* ============================================
   CMS Virtual Tour - Premium Dark Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ── */
:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #0f0f23;
    --bg-card: #141432;
    --bg-card-hover: #1a1a40;
    --bg-surface: #1e1e3f;
    --bg-input: #12122a;
    --bg-glass: rgba(20, 20, 50, 0.7);

    --border-color: rgba(100, 100, 255, 0.1);
    --border-glow: rgba(0, 212, 255, 0.3);

    --text-primary: #e8e8f0;
    --text-secondary: #9090b8;
    --text-muted: #606088;
    --text-accent: #00d4ff;

    --accent-cyan: #00d4ff;
    --accent-purple: #7b2ff7;
    --accent-pink: #ff2d8a;
    --accent-green: #00e676;
    --accent-orange: #ff9100;
    --accent-red: #ff4757;

    --gradient-primary: linear-gradient(135deg, #00d4ff, #7b2ff7);
    --gradient-card: linear-gradient(145deg, rgba(20, 20, 50, 0.9), rgba(15, 15, 35, 0.95));
    --gradient-hover: linear-gradient(145deg, rgba(30, 30, 70, 0.9), rgba(20, 20, 50, 0.95));
    --gradient-danger: linear-gradient(135deg, #ff4757, #ff2d8a);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.15);
    --shadow-glow-strong: 0 0 30px rgba(0, 212, 255, 0.25);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Reset ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-surface);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

/* ── Background Grid ── */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(0, 212, 255, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(123, 47, 247, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(255, 45, 138, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-purple);
}

/* ── Header / Navbar ── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: rgba(10, 10, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.navbar-brand .brand-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.navbar-brand span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.navbar-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-normal);
}

.navbar-nav a:hover,
.navbar-nav a.active {
    color: var(--text-primary);
    background: var(--bg-surface);
}

.navbar-nav a.active {
    color: var(--accent-cyan);
    box-shadow: inset 0 -2px 0 var(--accent-cyan);
}

/* ── Main Content ── */
.main-content {
    position: relative;
    z-index: 1;
    padding: 88px 24px 24px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ── Page Header ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
}

.page-header h1 i {
    margin-right: 12px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Stats Cards ── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition-normal);
}

.stat-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-icon.cyan { background: rgba(0, 212, 255, 0.15); color: var(--accent-cyan); }
.stat-icon.purple { background: rgba(123, 47, 247, 0.15); color: var(--accent-purple); }
.stat-icon.pink { background: rgba(255, 45, 138, 0.15); color: var(--accent-pink); }
.stat-icon.green { background: rgba(0, 230, 118, 0.15); color: var(--accent-green); }

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--gradient-danger);
    color: #fff;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.4);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-surface);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

/* ── Tour Cards Grid ── */
.tours-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.tour-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    position: relative;
}

.tour-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
}

.tour-card-thumbnail {
    width: 100%;
    height: 180px;
    background: var(--bg-surface);
    position: relative;
    overflow: hidden;
}

.tour-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.tour-card:hover .tour-card-thumbnail img {
    transform: scale(1.05);
}

.tour-card-thumbnail .placeholder-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: var(--text-muted);
}

.tour-card-body {
    padding: 20px;
}

.tour-card-body h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.tour-card-body p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tour-card-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.tour-card-meta span {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.tour-card-meta span i {
    color: var(--accent-cyan);
    font-size: 0.7rem;
}

.tour-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Modal ── */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* ── Forms ── */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    outline: none;
}

.form-control:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239090b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ── File Upload Area ── */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: var(--bg-input);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.05);
}

.upload-area i {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.upload-area p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.upload-area .upload-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Toast Notifications ── */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 280px;
    animation: slideInRight 0.3s ease;
    backdrop-filter: blur(10px);
}

.toast.success { border-left: 3px solid var(--accent-green); }
.toast.error { border-left: 3px solid var(--accent-red); }
.toast.info { border-left: 3px solid var(--accent-cyan); }

.toast i {
    font-size: 1.1rem;
}

.toast.success i { color: var(--accent-green); }
.toast.error i { color: var(--accent-red); }
.toast.info i { color: var(--accent-cyan); }

.toast p {
    font-size: 0.85rem;
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 0.8rem;
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: block;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ── Editor Layout ── */
.editor-layout {
    display: flex;
    height: calc(100vh - 64px);
    margin-top: 64px;
}

.editor-sidebar {
    width: 300px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.editor-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.editor-sidebar-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
}

.editor-scene-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.scene-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 4px;
    border: 1px solid transparent;
}

.scene-item:hover {
    background: var(--bg-card);
}

.scene-item.active {
    background: var(--bg-card);
    border-color: var(--accent-cyan);
    box-shadow: var(--shadow-glow);
}

.scene-item-thumb {
    width: 48px;
    height: 32px;
    border-radius: 4px;
    background: var(--bg-surface);
    overflow: hidden;
    flex-shrink: 0;
}

.scene-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scene-item-info {
    flex: 1;
    min-width: 0;
}

.scene-item-info h4 {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scene-item-info span {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.scene-item-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.scene-item:hover .scene-item-actions {
    opacity: 1;
}

/* ── Editor Main Area ── */
.editor-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
    flex-wrap: wrap;
}

.editor-toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.editor-viewer {
    flex: 1;
    position: relative;
    background: #000;
    overflow: hidden;
}

.editor-viewer #pano {
    width: 100%;
    height: 100%;
}

/* ── Editor Right Panel ── */
.editor-panel {
    width: 320px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.editor-panel-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.editor-panel-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.editor-panel-header p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.editor-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.panel-section {
    margin-bottom: 20px;
}

.panel-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.panel-section-header h4 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

/* ── Hotspot List in Panel ── */
.hotspot-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.hotspot-list-item:hover {
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
}

.hotspot-type-badge {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hotspot-type-badge.link {
    background: rgba(0, 212, 255, 0.15);
    color: var(--accent-cyan);
}

.hotspot-type-badge.info {
    background: rgba(123, 47, 247, 0.15);
    color: var(--accent-purple);
}

.hotspot-list-item-info {
    flex: 1;
    min-width: 0;
}

.hotspot-list-item-info h5 {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hotspot-list-item-info span {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ── Viewer Styles ── */
.viewer-container {
    width: 100%;
    height: 100vh;
    position: relative;
    overflow: hidden;
    background: #000;
}

.viewer-container #pano-viewer {
    width: 100%;
    height: 100%;
}

/* ── Floating Scene Bar & Small Header Container ── */
.viewer-floating-wrapper {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 50vw;
    max-width: 50vw;
    pointer-events: none;
    transition: all 0.3s ease;
}

/* Plain Tour Title Above Container (No Container Box, Small White Text) */
.tour-title-plain {
    pointer-events: auto;
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

/* Single Unified Floating Card Container */
.viewer-floating-card {
    pointer-events: auto;
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 6px 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.viewer-floating-card:has(.viewer-scene-bar.hidden) {
    gap: 0;
}

/* Collapsible Scene Bar (Only Thumbnails Hide) */
.viewer-scene-bar {
    max-height: 95px;
    opacity: 1;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.viewer-scene-bar.hidden {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
}

/* Bottom Control Row (Inline: Toggle Hide + Fullscreen + Sound) */
.viewer-bottom-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding-top: 0;
}

.btn-small-control,
.scene-toggle-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    transition: all 0.2s ease;
}

.btn-small-control:hover,
.scene-toggle-btn:hover {
    background: rgba(0, 212, 255, 0.25);
    border-color: var(--accent-cyan);
    color: #fff;
    transform: scale(1.08);
}

/* ── Custom Viewer Logo Overlay ── */
.viewer-logo-container {
    position: fixed;
    z-index: 150;
    pointer-events: none;
    transition: all 0.3s ease;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

.viewer-logo-container img {
    display: block;
    max-width: 250px;
    height: auto;
    object-fit: contain;
}

.viewer-logo-container.logo-pos-top-left {
    top: 20px;
    left: 20px;
}

.viewer-logo-container.logo-pos-top-center {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.viewer-logo-container.logo-pos-top-right {
    top: 20px;
    right: 20px;
}

.viewer-scene-bar-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 2px;
    width: 100%;
}

.viewer-scene-thumb {
    flex-shrink: 0;
    width: 96px;
    height: 62px;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    background: var(--bg-surface);
}

.viewer-scene-thumb.active {
    border-color: #ff3333;
    box-shadow: 0 0 15px rgba(255, 51, 51, 0.5);
}

.viewer-scene-thumb:hover {
    border-color: #ff6666;
    transform: translateY(-2px);
}

.viewer-scene-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.viewer-scene-thumb-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2px 4px;
    background: transparent;
    font-size: 0.65rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 2px rgba(0, 0, 0, 0.8);
}

.viewer-controls {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.viewer-controls button {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: rgba(10, 10, 26, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    font-size: 0.9rem;
}

.viewer-controls button:hover {
    background: var(--bg-surface);
    border-color: var(--accent-cyan);
}

/* ── Hotspot Styles (in viewer) ── */
.hotspot-marker {
    cursor: pointer;
}

.hotspot-link,
.hotspot-info-marker {
    transform: scale(var(--hs-scale, 1.0));
    transition: transform 0.2s ease;
    transform-origin: center center;
}

.hotspot-marker:hover .hotspot-link,
.hotspot-marker:hover .hotspot-info-marker {
    transform: scale(var(--hs-scale, 1.0));
}

.hotspot-link {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111122;
    font-size: 1rem;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}



.hotspot-link::after,
.hotspot-info-marker::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    animation: ripple 2s infinite;
}

.hotspot-custom-icon {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
}

.hotspot-custom-icon img {
    width: 32px !important;
    height: 32px !important;
    object-fit: contain !important;
    background: transparent !important;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6));
}

.hotspot-top-title {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 0.68rem;
    font-weight: 600;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 2px 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 10;
}

.hotspot-marker:hover .hotspot-info-popup {
    opacity: 1;
    visibility: visible;
    pointer-events: none;
    transform: translateX(-50%) translateY(0);
}

.hotspot-info-marker:hover .hotspot-info-popup {
    pointer-events: auto;
}

.hotspot-link .link-tooltip-popup {
    min-width: 180px;
    max-width: 240px;
    padding: 3px;
    text-align: center;
}

.link-thumb-container {
    position: relative;
    width: 100%;
    border-radius: 4px;
    overflow: hidden;
    display: block;
}

.hotspot-link .link-tooltip-popup img {
    max-height: 110px;
    width: 100%;
    object-fit: cover;
    display: block;
    margin: 0;
    vertical-align: bottom;
}

.link-thumb-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4px 6px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.2) 70%, transparent);
    font-size: 0.68rem;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.hotspot-info-marker {
    width: 38px;
    height: 38px;
    background: rgba(235, 40, 40, 0.9);
    border: 2px solid #ff3333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.95rem;
    position: relative;
    box-shadow: 0 4px 15px rgba(255, 50, 50, 0.4);
}

.hotspot-info-marker::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(255, 50, 50, 0.8);
    animation: ripple 2s infinite;
}

.hotspot-info-popup {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 6px 8px;
    min-width: 200px;
    max-width: 280px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 50;
    color: #ffffff;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

/* Tetap melayang/floating terbuka saat di-klik (class .active) */
.hotspot-info-popup.active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateX(-50%) translateY(0) !important;
}

.hotspot-info-popup h4 {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 2px;
    color: #ffffff;
    padding-right: 14px;
    line-height: 1.2;
}

.hotspot-info-popup p {
    font-size: 0.78rem;
    color: #ffffff;
    line-height: 1.3;
    margin: 0;
}

.hotspot-info-popup img:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

/* ── Floating Media Lightbox Modal ── */
.media-lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 5, 15, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.25s ease;
}

.media-lightbox-overlay.active {
    display: flex;
}

.media-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.media-lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 212, 255, 0.2);
    border: 1px solid var(--border-glow);
    animation: slideUp 0.3s ease;
}

.media-lightbox-close {
    position: absolute;
    top: -48px;
    right: 0;
    background: rgba(20, 20, 50, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.media-lightbox-close:hover {
    background: var(--accent-red);
    color: #fff;
    transform: scale(1.1);
}

.hotspot-info-popup .close-popup {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
}

/* ── Crosshair (for placement mode) ── */
.crosshair-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    display: none;
}

.crosshair-overlay.active {
    display: block;
    pointer-events: auto;
    cursor: crosshair;
}

.crosshair-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
}

.crosshair-center::before,
.crosshair-center::after {
    content: '';
    position: absolute;
    background: var(--accent-cyan);
}

.crosshair-center::before {
    width: 2px;
    height: 100%;
    left: 50%;
    transform: translateX(-50%);
}

.crosshair-center::after {
    width: 100%;
    height: 2px;
    top: 50%;
    transform: translateY(-50%);
}

/* ── Editor Hotspot Marker (removable) ── */
.editor-hotspot-marker {
    position: relative;
    cursor: pointer;
}

.editor-hotspot-marker .delete-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-red);
    color: #fff;
    border: none;
    font-size: 0.55rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}

.editor-hotspot-marker:hover .delete-btn {
    display: flex;
}

/* ── Placement Mode Indicator ── */
.placement-indicator {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    background: rgba(0, 212, 255, 0.15);
    border: 1px solid var(--accent-cyan);
    border-radius: var(--radius-lg);
    padding: 10px 24px;
    display: none;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(10px);
}

.placement-indicator.active {
    display: flex;
}

.placement-indicator i {
    color: var(--accent-cyan);
    animation: blink 1s infinite;
}

.placement-indicator span {
    font-size: 0.85rem;
    font-weight: 600;
}

/* ── Loading ── */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ── Animations ── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes pulseHotspot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(0, 212, 255, 0); }
}

@keyframes ripple {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .editor-layout {
        flex-direction: column;
    }

    .editor-sidebar {
        width: 100%;
        height: auto;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .editor-panel {
        width: 100%;
        height: auto;
        max-height: 300px;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }

    .tours-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Floating Bottom Scene Bar for Mobile */
    .viewer-floating-wrapper {
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
        bottom: 8px !important;
    }

    .viewer-floating-card {
        padding: 4px 6px !important;
        border-radius: 6px !important;
    }

    .viewer-scene-bar {
        max-height: 75px !important;
    }

    .viewer-scene-bar-inner {
        gap: 8px !important;
        padding: 2px !important;
    }

    .viewer-scene-thumb {
        width: 72px !important;
        height: 48px !important;
    }

    .tour-title-plain {
        font-size: 0.72rem !important;
        margin-bottom: 3px !important;
    }
}

/* ── Badge ── */
.badge {
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-cyan {
    background: rgba(0, 212, 255, 0.15);
    color: var(--accent-cyan);
}

.badge-purple {
    background: rgba(123, 47, 247, 0.15);
    color: var(--accent-purple);
}

/* ── Coordinates Display ── */
.coords-display {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
    background: var(--bg-input);
    padding: 4px 8px;
    border-radius: 4px;
}
