/* =========================================
   Ultra-Modern UI Design System for 360° Scene Tool
   ========================================= */

/* CSS Variables - Design Tokens */
:root {
    /* Brand Colors */
    --mu-maroon: #5d1f2d;
    --mu-maroon-dark: #3e1c22;
    --mu-maroon-light: #7a2838;
    --mu-gold: #feb440;
    --mu-gold-dark: #e59d2a;
    --mu-gold-light: #ffc666;
    
    /* UI Colors */
    --mu-bg: #f8f9fa;
    --mu-bg-dark: #e9ecef;
    --mu-card: #ffffff;
    --mu-border: #dee2e6;
    --mu-border-light: #e9ecef;
    
    /* Text Colors */
    --mu-text: #212529;
    --mu-text-secondary: #6c757d;
    --mu-text-tertiary: #adb5bd;
    
    /* Semantic Colors */
    --color-info: #0d6efd;
    --color-info-light: #cfe2ff;
    --color-nav: #fd7e14;
    --color-nav-light: #ffe5d0;
    --color-success: #198754;
    --color-success-light: #d1e7dd;
    --color-warning: #ffc107;
    --color-warning-light: #fff3cd;
    --color-error: #dc3545;
    --color-error-light: #f8d7da;
    
    /* Spacing Scale */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden; /* prevent horizontal overflow from fixed/absolute elements */
}

body {
    margin: 0;
    height: 100%;
    background: var(--mu-bg);
    color: var(--mu-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden; /* prevent horizontal scroll/blank space on small screens */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 600;
    line-height: 1.3;
    color: var(--mu-text);
}

h1 { font-size: 32px; letter-spacing: -0.5px; }
h2 { font-size: 24px; letter-spacing: -0.3px; }
h3 { font-size: 20px; }
h4 { font-size: 17px; }
h5 { font-size: 15px; }
h6 { font-size: 13px; }

p { margin: 0 0 var(--space-md); }

a {
    color: var(--mu-maroon);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--mu-maroon-light);
}

/* Header */
.sidebar-toggle-mobile {
    display: none;
}

.mu-top {
    background: linear-gradient(135deg, var(--mu-gold) 0%, var(--mu-gold-dark) 100%);
    color: #212529;
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}

.mu-brand {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: 18px;
    font-weight: 700;
}

.mu-brand img {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.mu-motto {
    font-style: italic;
    font-weight: 600;
    font-size: 14px;
    opacity: 0.9;
}

.mu-nav {
    background: var(--mu-maroon-dark);
    color: #fff;
    display: flex;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    box-shadow: var(--shadow-sm);
}

.mu-nav a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.mu-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.mu-nav a.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Utility Classes */
.hidden { display: none !important; }
.flex { display: flex; }
.grid { display: grid; }
.muted { color: var(--mu-text-secondary); }
.text-secondary { color: var(--mu-text-secondary); }

/* Layout Containers */
.wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.layout {
    min-height: calc(100vh - 102px);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    background: var(--mu-maroon);
    color: #fff;
    border: none;
    padding: 11px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
}

.btn:hover:not(:disabled) {
    background: var(--mu-maroon-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn.secondary {
    background: #fff;
    color: var(--mu-maroon);
    border: 1.5px solid var(--mu-border);
}

.btn.secondary:hover:not(:disabled) {
    background: var(--mu-bg);
    border-color: var(--mu-maroon);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-large {
    padding: 14px 28px;
    font-size: 16px;
}

/* Cards */
.card {
    background: var(--mu-card);
    border: 1px solid var(--mu-border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card h2 {
    margin: 0 0 var(--space-sm);
    font-size: 18px;
    color: var(--mu-text);
}

.card h3 {
    margin: 0 0 var(--space-sm);
    font-size: 16px;
}

/* Forms */
.form-row {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.form-row label {
    color: var(--mu-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}

.form-row input,
.form-row select,
.form-row textarea {
    background: var(--mu-card);
    border: 1.5px solid var(--mu-border);
    color: var(--mu-text);
    padding: 11px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: all var(--transition-fast);
    font-family: inherit;
    width: 100%;
    line-height: 1.5;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--mu-maroon);
    box-shadow: 0 0 0 3px rgba(93, 31, 45, 0.1);
}

.form-row input:hover,
.form-row select:hover,
.form-row textarea:hover {
    border-color: var(--mu-text-tertiary);
}

.form-row textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row input[type="file"] {
    cursor: pointer;
    padding: 8px;
}

.form-row input[type="file"]::file-selector-button {
    background: var(--mu-maroon);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    margin-right: var(--space-md);
    transition: all var(--transition-fast);
}

.form-row input[type="file"]::file-selector-button:hover {
    background: var(--mu-maroon-light);
}

.form-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--mu-border-light);
}

.form-actions .btn:first-child {
    order: 2;
}

/* Radio Groups */
.radio-group {
    display: flex;
    gap: var(--space-md);
}

.radio-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    border: 2px solid var(--mu-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--mu-card);
    flex: 1;
}

.radio-label:hover {
    border-color: var(--mu-maroon);
    background: var(--mu-bg);
}

.radio-label:has(input:checked) {
    border-color: var(--mu-maroon);
    background: rgba(93, 31, 45, 0.05);
    box-shadow: 0 0 0 3px rgba(93, 31, 45, 0.1);
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--mu-maroon);
}

.radio-label span {
    font-weight: 500;
    transition: font-weight var(--transition-fast);
}

.radio-label:has(input:checked) span {
    font-weight: 600;
}

/* Select Dropdowns */
.form-row select {
    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='%23212529' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

/* Editor Layout */
.editor-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-template-rows: auto 1fr;
    height: 100vh;
    overflow: hidden;
}

/* Editor Toolbar */
.editor-toolbar {
    grid-column: 1 / span 2;
    background: var(--mu-card);
    border-bottom: 1px solid var(--mu-border-light);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    box-shadow: var(--shadow-sm);
    z-index: 100;
    min-height: 64px;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding-right: var(--space-md);
    border-right: 1px solid var(--mu-border-light);
}

.toolbar-group:last-child {
    border-right: none;
    margin-left: auto;
    padding-right: 0;
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    background: #fff;
    color: var(--mu-text);
    border: 1.5px solid var(--mu-border);
    border-radius: var(--radius-md);
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
}

.tool-btn:hover:not(:disabled) {
    background: var(--mu-bg);
    border-color: var(--mu-maroon);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.tool-btn.active {
    background: var(--mu-maroon);
    color: #fff;
    border-color: var(--mu-maroon);
}

.tool-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.tool-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Editor Sidebar */
.editor-sidebar {
    background: var(--mu-card);
    border-right: 1px solid var(--mu-border-light);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: var(--space-md);
    border-bottom: 1px solid var(--mu-border-light);
    background: var(--mu-bg);
}

.sidebar-search {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--mu-border);
    border-radius: var(--radius-md);
    font-size: 13px;
    background: var(--mu-card);
    transition: all var(--transition-fast);
}

.sidebar-search:focus {
    outline: none;
    border-color: var(--mu-maroon);
    box-shadow: 0 0 0 3px rgba(93, 31, 45, 0.1);
}

/* Scene List */
.scene-list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    overflow-y: auto;
}

.scene-item {
    display: grid;
    grid-template-columns: 96px 1fr auto;
    gap: var(--space-md);
    align-items: center;
    padding: var(--space-md);
    border-bottom: 1px solid var(--mu-border-light);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.scene-item:hover {
    background: var(--mu-bg);
}

.scene-item.active {
    background: rgba(93, 31, 45, 0.05);
    border-left: 3px solid var(--mu-maroon);
}

.scene-thumb {
    width: 96px;
    height: 64px;
    background: var(--mu-bg);
    border: 1px solid var(--mu-border);
    border-radius: var(--radius-sm);
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

.scene-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.scene-title {
    color: var(--mu-text);
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scene-meta {
    font-size: 12px;
    color: var(--mu-text-secondary);
    margin: 0;
}

.scene-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    background: var(--mu-bg-dark);
    color: var(--mu-text-secondary);
    white-space: nowrap;
}

/* Editor Main Area */
.editor-main {
    position: relative;
    background: #0a1024;
    overflow: hidden;
    z-index: 1;
}

/* Hotspot Panel */
.hotspot-panel {
    position: fixed;
    top: 130px;
    right: var(--space-md);
    width: 280px;
    max-height: calc(100vh - 180px);
    background: var(--mu-card);
    border: 1px solid var(--mu-border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    z-index: 200;
}

.hotspot-panel-header {
    padding: var(--space-md);
    border-bottom: 1px solid var(--mu-border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--mu-bg);
}

.hotspot-panel-header h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.hotspot-panel-body {
    padding: var(--space-sm);
    max-height: 400px;
    overflow-y: auto;
}

.hotspot-list-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: var(--space-xs);
    border: 1px solid transparent;
}

.hotspot-list-item:hover {
    background: var(--mu-bg);
    border-color: var(--mu-border);
}

.hotspot-list-item-content {
    flex: 1;
    min-width: 0;
}

.hotspot-list-item-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hotspot-list-item-type {
    font-size: 11px;
    color: var(--mu-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hotspot-number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.hotspot-list-item.info .hotspot-number {
    background: var(--color-info);
    color: #fff;
}

.hotspot-list-item.nav .hotspot-number {
    background: var(--color-nav);
    color: #fff;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn var(--transition-base);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    width: 600px;
    max-width: 90vw;
    max-height: 85vh;
    background: var(--mu-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: slideUp var(--transition-slow);
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--mu-border-light);
    background: var(--mu-bg);
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.modal-body {
    padding: var(--space-lg);
    max-height: calc(85vh - 180px);
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--mu-border-light);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    background: var(--mu-bg);
}

/* Type Selection Cards */
.type-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin: var(--space-lg) 0;
}

.type-card {
    padding: var(--space-xl);
    border: 2px solid var(--mu-border);
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.type-card:hover {
    border-color: var(--mu-maroon);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.type-card.selected {
    border-color: var(--mu-maroon);
    background: rgba(93, 31, 45, 0.05);
}

.type-card-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-md);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.type-card.info .type-card-icon {
    background: var(--color-info-light);
    color: var(--color-info);
}

.type-card.nav .type-card-icon {
    background: var(--color-nav-light);
    color: var(--color-nav);
}

.type-card h4 {
    margin: 0 0 var(--space-sm);
}

/* Scene Grid Picker */
.scene-grid-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-md);
    max-height: 400px;
    overflow-y: auto;
    padding: 4px;
}

.scene-grid-item {
    border: 2px solid var(--mu-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
}

.scene-grid-item:hover:not(.disabled) {
    border-color: var(--mu-maroon);
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.scene-grid-item.selected {
    border-color: var(--mu-maroon);
    box-shadow: 0 0 0 3px rgba(93, 31, 45, 0.2);
}

.scene-grid-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.scene-grid-thumb {
    width: 100%;
    height: 80px;
    object-fit: cover;
    background: var(--mu-bg);
}

.scene-grid-name {
    padding: var(--space-sm);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    background: var(--mu-bg);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Hotspot Markers */
.hs-marker {
    position: absolute;
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.4));
    transition: all var(--transition-fast);
    cursor: pointer;
    z-index: 10;
}

.hs-marker:hover {
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.5));
    transform: translate(-50%, -50%) rotate(var(--rotation, 0deg)) scale(1.15) !important;
    z-index: 100;
}

.hs-marker img {
    user-select: none;
    pointer-events: none;
}

.hs-marker-number {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    background: #fff;
    border: 2px solid var(--mu-maroon);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--mu-maroon);
    box-shadow: var(--shadow-md);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: var(--space-lg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    min-width: 300px;
    max-width: 400px;
    padding: var(--space-md) var(--space-lg);
    background: var(--mu-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    animation: slideInRight var(--transition-base);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast.success {
    border-left: 4px solid var(--color-success);
}

.toast.error {
    border-left: 4px solid var(--color-error);
}

.toast.warning {
    border-left: 4px solid var(--color-warning);
}

.toast.info {
    border-left: 4px solid var(--color-info);
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: var(--mu-text-secondary);
}

/* Hotspot Instruction Tip */
.hotspot-instruction-tip {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    pointer-events: none;
    animation: fadeInScale var(--transition-base);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.hotspot-instruction-tip .tip-content {
    background: rgba(10, 16, 36, 0.95);
    backdrop-filter: blur(10px);
    color: #fff;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    border: 2px solid var(--mu-gold);
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
}

.hotspot-instruction-tip .tip-content svg {
    color: var(--mu-gold);
    flex-shrink: 0;
}

.hotspot-instruction-tip.hidden {
    display: none;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--mu-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Dashboard Specific */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

.stat-card {
    background: var(--mu-card);
    border: 1px solid var(--mu-border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--mu-maroon);
    margin: var(--space-sm) 0;
}

.stat-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--mu-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-meta {
    font-size: 12px;
    color: var(--mu-text-tertiary);
    margin-top: var(--space-sm);
}

/* Drag & Drop Zone */
.drop-zone {
    border: 2px dashed var(--mu-border);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    text-align: center;
    transition: all var(--transition-base);
    cursor: pointer;
    background: var(--mu-bg);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--mu-maroon);
    background: rgba(93, 31, 45, 0.05);
}

.drop-zone-icon {
    font-size: 48px;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.drop-zone-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--mu-text);
    margin-bottom: var(--space-sm);
}

.drop-zone-hint {
    font-size: 13px;
    color: var(--mu-text-secondary);
}

/* File Preview Grid */
.file-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--space-md);
}

.file-previews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--space-md);
}

.file-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--mu-border);
}

.file-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all var(--transition-fast);
}

.file-preview-remove:hover {
    background: var(--color-error);
}

/* Progress Bar */
.progress {
    height: 12px;
    background: var(--mu-bg-dark);
    border: 1px solid var(--mu-border);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--mu-maroon), var(--mu-gold));
    transition: width 0.3s ease;
}

/* Lists and Details */
ul, ol {
    margin: 0;
    padding-left: var(--space-lg);
}

ul li, ol li {
    margin-bottom: var(--space-sm);
}

details {
    border: 1px solid var(--mu-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    background: var(--mu-card);
}

details summary {
    cursor: pointer;
    font-weight: 600;
    user-select: none;
    padding: var(--space-sm);
    margin: calc(-1 * var(--space-md));
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

details summary:hover {
    background: var(--mu-bg);
}

details[open] summary {
    margin-bottom: var(--space-md);
    border-bottom: 1px solid var(--mu-border-light);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: var(--color-success-light);
    color: var(--color-success);
}

.badge-warning {
    background: var(--color-warning-light);
    color: var(--color-warning);
}

.badge-error {
    background: var(--color-error-light);
    color: var(--color-error);
}

.badge-info {
    background: var(--color-info-light);
    color: var(--color-info);
}

/* Divider */
.divider {
    height: 1px;
    background: var(--mu-border-light);
    margin: var(--space-lg) 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--mu-text-secondary);
}

.empty-state-icon {
    font-size: 48px;
    opacity: 0.5;
    margin-bottom: var(--space-md);
}

.empty-state-text {
    font-size: 16px;
    margin-bottom: var(--space-sm);
}

.empty-state-hint {
    font-size: 13px;
    color: var(--mu-text-tertiary);
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--mu-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--mu-border);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--mu-text-tertiary);
}

/* Hover Effects */
.hover-lift {
    transition: all var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.hover-grow {
    transition: all var(--transition-base);
}

.hover-grow:hover {
    transform: scale(1.02);
}

/* Utility Spacing */
.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }

.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

.p-xs { padding: var(--space-xs); }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }
.p-2xl { padding: var(--space-2xl); }

/* Text Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-normal { font-weight: 400; }

.text-xs { font-size: 12px; }
.text-sm { font-size: 13px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 18px; }
.text-2xl { font-size: 20px; }

/* Loading Dots Animation */
@keyframes loadingDots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.loading-dots::after {
    content: '';
    animation: loadingDots 1.5s infinite;
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Responsive */
@media (max-width: 1024px) {
    .editor-layout {
        grid-template-columns: 280px 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
    
    .type-selection {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --space-xl: 24px;
        --space-2xl: 32px;
    }
    
    /* Mobile Sidebar Toggle Button */
    .sidebar-toggle-mobile {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    
    .sidebar-toggle-mobile:hover {
        opacity: 0.8;
    }
    
    .sidebar-toggle-mobile:active {
        transform: scale(0.95);
    }
    
    /* Layout adjustments for mobile */
    .layout {
        grid-template-columns: 1fr !important;
    }
    
    /* Sidebar hidden by default on mobile */
    .sidebar {
        position: fixed;
        top: 102px;
        left: 0;
        width: 280px;
        height: calc(100vh - 102px);
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform var(--transition-base);
        box-shadow: var(--shadow-xl);
        overflow-y: auto;
    }
    
    /* Sidebar visible when toggled */
    .sidebar.open {
        transform: translateX(0);
    }
    
    /* Sidebar overlay */
    .sidebar-overlay {
        position: fixed;
        top: 102px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(2px);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: opacity var(--transition-base), visibility var(--transition-base);
    }
    
    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Close button in sidebar */
    .sidebar-close {
        display: flex !important;
        align-items: center;
        justify-content: flex-end;
        padding: var(--space-md);
        border-bottom: 1px solid var(--mu-border-light);
        margin-bottom: var(--space-md);
        margin-left: calc(-1 * var(--space-lg));
        margin-right: calc(-1 * var(--space-lg));
        padding-left: var(--space-lg);
        padding-right: var(--space-lg);
    }
    
    .sidebar-close button {
        background: var(--mu-bg);
        border: 1px solid var(--mu-border);
        border-radius: var(--radius-md);
        padding: 8px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all var(--transition-fast);
    }
    
    .sidebar-close button:hover {
        background: var(--mu-bg-dark);
        border-color: var(--mu-maroon);
    }

    /* Prevent top nav from causing horizontal overflow on small screens */
    .mu-nav {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    .mu-nav a {
        flex: 0 0 auto;
        white-space: nowrap;
    }
    
    .editor-layout {
        grid-template-columns: 1fr;
    }
    
    .editor-sidebar {
        display: none;
    }
    
    .modal {
        width: 100%;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .toolbar-group {
        flex-wrap: wrap;
    }
    
    .editor-toolbar {
        padding: var(--space-sm) var(--space-md);
    }
    
    .tool-btn {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .tool-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .hotspot-panel {
        width: 260px;
        right: var(--space-sm);
        top: 120px;
    }
    
    .radio-group {
        flex-direction: column;
    }
    
    .scene-grid-picker {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

@media (max-width: 360px) {
    /* Very small screens: reduce header content to avoid overflow */
    .mu-top {
        padding: var(--space-sm) var(--space-md);
        gap: var(--space-sm);
    }

    .mu-brand {
        gap: var(--space-sm);
        font-size: 14px;
        min-width: 0;
    }

    .mu-brand > div {
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mu-motto {
        display: none;
    }
}

@media (max-width: 480px) {
    .mu-brand {
        font-size: 16px;
    }
    
    .mu-brand .mu-motto {
        display: none;
    }
    
    h1 { font-size: 26px; }
    h2 { font-size: 20px; }
    h3 { font-size: 18px; }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .card {
        padding: var(--space-md);
    }
    
    .stat-value {
        font-size: 28px;
    }
}

/* Print Styles */
@media print {
    .mu-nav,
    .editor-toolbar,
    .editor-sidebar,
    .modal-backdrop,
    .hotspot-panel,
    .toast-container {
        display: none !important;
    }
    
    body {
        background: #fff;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Focus Visible (Accessibility) */
:focus-visible {
    outline: 2px solid var(--mu-maroon);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--mu-maroon);
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
