/* StickerForge Studio • Interactive Sticker Slap & Customizer */
:root {
  --bg: #07090e;
  --panel-bg: rgba(15, 23, 42, 0.85);
  --panel-border: rgba(255, 255, 255, 0.1);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --gold: #fbbf24;
  --cyan: #00f0ff;
  --pink: #ff0080;
  --purple: #a855f7;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(0, 240, 255, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(255, 0, 128, 0.05) 0%, transparent 40%);
}

/* Header */
header.studio-header {
  height: 64px;
  background: rgba(10, 15, 28, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 50;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-title {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, #ffffff 40%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
}

.brand-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.1);
  color: var(--cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

/* Studio Workspace Layout */
.studio-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 380px;
  height: calc(100vh - 64px);
  overflow: hidden;
}

@media (max-width: 1024px) {
  .studio-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    height: auto;
    overflow: visible;
  }
}

/* Canvas Area */
.canvas-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #030508;
  overflow: hidden;
  padding: 2rem;
  user-select: none;
}

.surface-bar {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.9);
  padding: 0.35rem 0.6rem;
  border-radius: 50px;
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(8px);
}

.surface-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.surface-btn.active, .surface-btn:hover {
  background: var(--gold);
  color: #000;
}

/* The Slap Surface */
.slap-stage {
  position: relative;
  width: 100%;
  max-width: 820px;
  aspect-ratio: 16 / 10;
  background: #11141d;
  border-radius: 24px;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Surface Themes */
.slap-stage[data-surface="laptop-dark"] {
  background: radial-gradient(circle at 50% 40%, #1e2433 0%, #0d111a 100%);
  border: 2px solid #2d3748;
  border-radius: 20px;
}
.slap-stage[data-surface="laptop-dark"]::after {
  content: "NORTHSTAR PRO";
  position: absolute;
  bottom: 15px;
  font-size: 0.65rem;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, 0.2);
  font-weight: 700;
}

.slap-stage[data-surface="laptop-silver"] {
  background: radial-gradient(circle at 50% 40%, #e2e8f0 0%, #cbd5e1 100%);
  border: 2px solid #94a3b8;
  border-radius: 20px;
}

.slap-stage[data-surface="hydroflask"] {
  max-width: 360px;
  aspect-ratio: 9 / 16;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
  border-radius: 36px 36px 48px 48px;
  border: 3px solid #4338ca;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.9);
}

.slap-stage[data-surface="skateboard"] {
  max-width: 320px;
  aspect-ratio: 1 / 3.4;
  background: linear-gradient(180deg, #3b2a1a 0%, #78350f 50%, #3b2a1a 100%);
  border-radius: 60px;
  border: 3px solid #92400e;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.9);
}

.slap-stage[data-surface="guitar"] {
  max-width: 440px;
  aspect-ratio: 1 / 1.7;
  background: radial-gradient(ellipse at 50% 65%, #ffd700 0%, #d97706 40%, #78350f 70%, #1c0d02 95%);
  border-radius: 90px 90px 140px 140px;
  border: 4px solid #451a03;
  box-shadow: 0 35px 80px rgba(0, 0, 0, 0.95), inset 0 0 60px rgba(0,0,0,0.8);
}
.slap-stage[data-surface="guitar"]::before {
  content: "";
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: 130px;
  height: 50px;
  background: #0f172a;
  border-radius: 8px;
  border: 2px solid #334155;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.9);
}

.slap-stage[data-surface="flight-case"] {
  max-width: 720px;
  aspect-ratio: 1.4 / 1;
  background: repeating-linear-gradient(45deg, #111827, #111827 10px, #0f172a 10px, #0f172a 20px);
  border-radius: 16px;
  border: 6px solid #475569;
  box-shadow: 0 35px 80px rgba(0, 0, 0, 0.95), inset 0 0 30px rgba(0,0,0,0.9);
}
.slap-stage[data-surface="flight-case"]::before {
  content: "NORTHSTAR HEAVY HARDWARE // FLIGHT NO. 09";
  position: absolute;
  top: 15px;
  left: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 2px;
  color: #64748b;
}

.slap-stage[data-surface="bumper"] {
  max-width: 880px;
  aspect-ratio: 3.2 / 1;
  background: linear-gradient(180deg, #1f2937 0%, #111827 60%, #030712 100%);
  border-radius: 12px;
  border: 2px solid #374151;
}

.slap-stage[data-surface="artboard"] {
  max-width: 780px;
  aspect-ratio: 4 / 3;
  background: #ffffff;
  background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
  background-size: 20px 20px;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
}

/* Sticker Element on Canvas */
.placed-sticker {
  position: absolute;
  touch-action: none;
  cursor: grab;
  transform-origin: center center;
  transition: box-shadow 0.2s ease;
  user-select: none;
}

.placed-sticker:active {
  cursor: grabbing;
}

.placed-sticker.selected {
  outline: 2px dashed var(--cyan);
  outline-offset: 6px;
}

.placed-sticker img, .placed-sticker svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
}

/* Die-Cut Styles */
.die-cut-white img, .die-cut-white svg {
  filter: 
    drop-shadow(2px 0 0 #fff)
    drop-shadow(-2px 0 0 #fff)
    drop-shadow(0 2px 0 #fff)
    drop-shadow(0 -2px 0 #fff)
    drop-shadow(0 10px 20px rgba(0,0,0,0.5));
}

.die-cut-gold img, .die-cut-gold svg {
  filter: 
    drop-shadow(2px 0 0 var(--gold))
    drop-shadow(-2px 0 0 var(--gold))
    drop-shadow(0 2px 0 var(--gold))
    drop-shadow(0 -2px 0 var(--gold))
    drop-shadow(0 10px 20px rgba(0,0,0,0.5));
}

.die-cut-holographic img, .die-cut-holographic svg {
  filter: 
    drop-shadow(2px 0 0 var(--cyan))
    drop-shadow(-2px 0 0 var(--pink))
    drop-shadow(0 2px 0 var(--gold))
    drop-shadow(0 10px 20px rgba(0,0,0,0.5));
}

/* Holographic Foil Layer Effect */
.holo-foil-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: color-dodge;
  opacity: 0.65;
  background: linear-gradient(
    135deg,
    rgba(255, 0, 128, 0.3) 0%,
    rgba(0, 240, 255, 0.4) 30%,
    rgba(251, 191, 36, 0.4) 60%,
    rgba(168, 85, 247, 0.3) 100%
  );
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

/* Transform Gizmo Controls */
.gizmo-handle {
  position: absolute;
  width: 24px;
  height: 24px;
  background: var(--cyan);
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.placed-sticker.selected .gizmo-handle {
  display: block;
}

.gizmo-rotate {
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  cursor: crosshair;
}

.gizmo-scale-br {
  bottom: -12px;
  right: -12px;
  cursor: se-resize;
}

.gizmo-delete {
  top: -12px;
  right: -12px;
  background: #ef4444;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

/* Canvas Toolbar */
.canvas-bottom-bar {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  gap: 0.75rem;
  background: rgba(15, 23, 42, 0.95);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(10px);
}

.action-pill-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.5rem 1.1rem;
  border-radius: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.action-pill-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
}

.action-pill-btn.primary {
  background: linear-gradient(135deg, var(--gold) 0%, #f59e0b 100%);
  color: #000;
  border: none;
}

.action-pill-btn.primary:hover {
  box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}

/* Control & Tray Sidebar */
.studio-sidebar {
  background: var(--panel-bg);
  border-left: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  backdrop-filter: blur(16px);
}

.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(10, 15, 28, 0.5);
}

.sidebar-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 1rem 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.sidebar-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  background: rgba(251, 191, 36, 0.05);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Search & Filters in Tray */
.search-box {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  color: #fff;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-box:focus {
  border-color: var(--cyan);
}

.filter-pills {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  scrollbar-width: thin;
}

.pill-filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 50px;
  cursor: pointer;
  white-space: nowrap;
}

.pill-filter-btn.active {
  background: var(--cyan);
  color: #000;
  border-color: var(--cyan);
}

/* Sticker Grid in Tray */
.sticker-tray-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.tray-sticker-item {
  aspect-ratio: 1 / 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.tray-sticker-item:hover {
  border-color: var(--gold);
  transform: scale(1.05);
  background: rgba(251, 191, 36, 0.08);
}

.tray-sticker-item img, .tray-sticker-item svg {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
}

/* Selected Sticker Controls Tab */
.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.control-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--gold);
}

.style-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.style-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.6rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
}

.style-btn.active {
  border-color: var(--gold);
  background: rgba(251, 191, 36, 0.15);
  color: var(--gold);
}

/* Custom Text Badge Creator */
.badge-creator-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.badge-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
}

.badge-input:focus {
  border-color: var(--gold);
}
