/* SplatVault Dark Studio Theme */
:root {
  --bg: #0b1120;
  --surface: #111827;
  --surface-2: #1e293b;
  --border: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-hover: #0ea5e9;
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); font-size: 0.9rem; }

/* Navbar */
.navbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: rgba(17, 24, 39, 0.9);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(10px);
}
.brand { font-size: 1.2rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.brand span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 16px; }

/* Buttons & Inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); cursor: pointer;
  font-size: 0.9rem; font-weight: 500; transition: 0.15s;
}
.btn:hover { background: #2b3950; text-decoration: none; }
.btn-primary { background: var(--accent); color: #0b1120; border-color: var(--accent); font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }
.btn-danger:hover { background: var(--danger); color: white; }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn.active { background: var(--accent); color: #0b1120; border-color: var(--accent); }

input, select, textarea {
  width: 100%; padding: 9px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: #0f172a; color: var(--text);
  font-size: 0.9rem; font-family: inherit;
}
label { display: flex; flex-direction: column; gap: 5px; font-size: 0.85rem; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Layout */
.container { max-width: 1280px; margin: 0 auto; padding: 24px; }
.centered-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }

/* Hero */
.hero {
  padding: 64px 24px; text-align: center;
  background: radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.18), transparent 65%);
  border-bottom: 1px solid var(--border);
}
.hero h1 { font-size: clamp(2rem, 4vw, 3.2rem); margin: 0 0 12px; }
.hero p { max-width: 680px; margin: 0 auto 24px; color: var(--muted); font-size: 1.05rem; }

/* Grid & Scene Cards */
.scene-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px;
}
.scene-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: transform 0.15s, border-color 0.15s;
}
.scene-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.scene-thumb {
  aspect-ratio: 16 / 10; background: linear-gradient(135deg, #1e293b, #0f172a);
  display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
}
.scene-thumb img { width: 100%; height: 100%; object-fit: cover; }
.badge {
  position: absolute; top: 8px; right: 8px; padding: 3px 8px; border-radius: 99px;
  background: rgba(15, 23, 42, 0.85); border: 1px solid var(--border);
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
}
.scene-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.scene-title { font-weight: 600; font-size: 1rem; color: var(--text); }
.scene-meta { font-size: 0.8rem; color: var(--muted); display: flex; justify-content: space-between; }

/* Library Layout */
.library-layout { display: grid; grid-template-columns: 240px 1fr; gap: 20px; }
@media (max-width: 820px) { .library-layout { grid-template-columns: 1fr; } }
.folder-item {
  padding: 8px 12px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
}
.folder-item:hover, .folder-item.active { background: var(--surface-2); color: var(--accent); }
.quota-bar { height: 8px; background: #0f172a; border-radius: 99px; overflow: hidden; margin: 6px 0; }
.quota-fill { height: 100%; background: var(--accent); }
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 28px;
  text-align: center; cursor: pointer; transition: 0.15s;
}
.dropzone.dragover { border-color: var(--accent); background: rgba(56, 189, 248, 0.08); }

/* Modals & Alerts */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(2, 6, 23, 0.78);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; }
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 0.9rem; }
.alert-error { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.4); color: #fecaca; }
.alert-success { background: rgba(34, 197, 94, 0.15); border: 1px solid rgba(34, 197, 94, 0.4); color: #bbf7d0; }

/* Player Viewport & Floating HUD */
.player-page { overflow: hidden; height: 100vh; width: 100vw; position: relative; }
#viewport { position: fixed; inset: 0; width: 100vw; height: 100vh; }
#hotspots-layer { position: fixed; inset: 0; pointer-events: none; z-index: 15; }
.hotspot-pin {
  position: absolute; transform: translate(-50%, -50%); pointer-events: auto;
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff;
  background: var(--accent); color: #0b1120; font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.6); transition: transform 0.15s;
}
.hotspot-pin:hover { transform: translate(-50%, -50%) scale(1.18); }

.hud-top {
  position: fixed; top: 14px; left: 14px; right: 14px; z-index: 25;
  display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none;
}
.hud-top > * { pointer-events: auto; }
.hud-pill {
  background: rgba(15, 23, 42, 0.82); backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 14px;
  display: flex; align-items: center; gap: 10px;
}
.hud-bottom {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 25;
  background: rgba(15, 23, 42, 0.86); backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px;
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 95vw;
}
.side-drawer {
  position: fixed; top: 68px; right: 14px; bottom: 76px; width: 320px; z-index: 30;
  background: rgba(15, 23, 42, 0.92); backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: 12px; padding: 16px;
  overflow-y: auto; display: none; flex-direction: column; gap: 14px;
}
.side-drawer.open { display: flex; }
.hotspot-card {
  position: fixed; bottom: 82px; left: 16px; width: 320px; z-index: 30;
  background: rgba(15, 23, 42, 0.94); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; display: none;
}
.hotspot-card.open { display: block; }
.loading-overlay {
  position: fixed; inset: 0; background: rgba(11, 17, 32, 0.9); z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
.measure-readout {
  position: fixed; top: 68px; left: 16px; z-index: 25;
  background: rgba(15, 23, 42, 0.88); border: 1px solid var(--accent);
  border-radius: 8px; padding: 8px 12px; font-size: 0.85rem; display: none;
}
