/* 3D Vector QR Studio & Scan Animation Engine */
:root {
  color-scheme: dark;
  --bg-dark: #07090e;
  --bg-panel: rgba(14, 18, 29, 0.78);
  --bg-card: rgba(22, 28, 45, 0.65);
  --bg-card-hover: rgba(30, 39, 62, 0.85);
  --bg-input: rgba(10, 14, 23, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(0, 243, 255, 0.5);
  --accent-cyan: #00f3ff;
  --accent-pink: #ff007f;
  --accent-emerald: #10b981;
  --accent-gold: #ffd700;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-ui);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(0, 243, 255, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(255, 0, 127, 0.07) 0%, transparent 40%);
}

/* Navbar */
header.studio-navbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--bg-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #00f3ff, #ff007f);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 243, 255, 0.15);
  border: 1px solid rgba(0, 243, 255, 0.35);
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-pill {
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-main);
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-pill:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-pill.btn-gradient {
  background: linear-gradient(135deg, #00f3ff, #ff007f);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(0, 243, 255, 0.35);
}

.btn-pill.btn-emerald {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.35);
}

/* Studio Layout Grid */
.studio-main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 24px 60px;
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 32px;
}

@media (max-width: 1024px) {
  .studio-main {
    grid-template-columns: 1fr;
  }
}

/* Left Sidebar Controls */
.config-column {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.panel-card {
  background: var(--bg-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.panel-title {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.text-field, .select-field {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}

.text-field:focus, .select-field:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 243, 255, 0.2);
}

/* Vector Library Grid */
.vector-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.vector-chip {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.vector-chip:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.vector-chip.active {
  background: rgba(0, 243, 255, 0.15);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(0, 243, 255, 0.3);
}

.vector-icon-preview {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vector-icon-preview svg {
  width: 100%;
  height: 100%;
}

.vector-chip-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Custom Vector Upload Row */
.upload-vector-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px dashed rgba(0, 243, 255, 0.35);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.upload-vector-row:hover {
  background: var(--bg-card-hover);
}

/* Right Stage Container */
.stage-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* The Vector QR Display Card */
.qr-stage-card {
  width: 100%;
  max-width: 520px;
  background: var(--bg-panel);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.qr-canvas-box {
  width: 320px;
  height: 320px;
  background: #ffffff;
  border-radius: 20px;
  padding: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.qr-canvas-box:hover {
  transform: scale(1.02);
  box-shadow: 0 20px 50px rgba(0, 243, 255, 0.25);
}

#vector-qr-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Laser Scanline on QR */
#stage-laser-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #00f3ff, transparent);
  box-shadow: 0 0 16px #00f3ff;
  display: none;
  z-index: 5;
}

/* 3D Vector Scan Animation Overlay (Directly on top of QR code) */
#scan-3d-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 19, 0.88);
  backdrop-filter: blur(12px);
  border-radius: 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Hologram Result HUD Card on Scan */
.scan-result-hud {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: rgba(14, 18, 29, 0.92);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 243, 255, 0.4);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  z-index: 20;
  display: none;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
  animation: slideUp 0.4s ease;
}

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

.hud-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-url-box {
  background: rgba(0, 0, 0, 0.4);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  color: #a5f3fc;
  word-break: break-all;
}

.hud-actions {
  display: flex;
  gap: 10px;
}

/* Camera Scanner Modal */
#camera-scanner-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  background: #000;
  display: none;
}

#camera-scanner-modal.active {
  display: block;
}

#cam-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#cam-proc-canvas {
  display: none;
}

.cam-reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 260px;
  height: 260px;
  border: 2px dashed rgba(0, 243, 255, 0.5);
  border-radius: 20px;
  pointer-events: none;
}

/* Toast */
#studio-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: #ffffff;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

#studio-toast.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
