/* ==========================================================================
   KEITH HARING STUDIO - NYC POP ART & SUBWAY ATELIER
   Thick Contours, Kinetic Energy Radiations, 1980s Street Aesthetics
   ========================================================================== */

:root {
  --c-bg: #0F0F12;
  --c-surface: #18181D;
  --c-surface-card: #22222A;
  --c-border: #2E2E38;
  --c-border-highlight: #FACC15;

  --haring-yellow: #FACC15;
  --haring-red: #EF4444;
  --haring-cyan: #06B6D4;
  --haring-green: #84CC16;
  --haring-pink: #EC4899;
  --haring-purple: #A855F7;
  --haring-white: #FFFFFF;
  --haring-black: #121214;

  --c-text-main: #FFFFFF;
  --c-text-muted: #9CA3AF;

  --font-pop: 'Bungee', cursive, sans-serif;
  --font-mono: 'Space Mono', monospace;
  --font-sans: 'Rubik', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  background-color: var(--c-bg);
  color: var(--c-text-main);
  font-family: var(--font-sans);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}
::-webkit-scrollbar-thumb {
  background: var(--haring-yellow);
  border-radius: 3px;
}

/* ==========================================================================
   STUDIO HEADER
   ========================================================================== */

.studio-header {
  height: 66px;
  background: #141418;
  border-bottom: 3px solid #000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: relative;
  z-index: 100;
  box-shadow: 0 4px 0 #000;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-crest {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  border: 3px solid #000;
  background: var(--haring-yellow);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 3px 3px 0 #000;
}

.brand-titles h1 {
  font-family: var(--font-pop);
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  color: #FFF;
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 2px 2px 0 #000;
}

.brand-titles h1 span {
  font-size: 0.75rem;
  color: var(--haring-yellow);
  font-family: var(--font-mono);
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--c-text-muted);
  font-family: var(--font-mono);
}

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

/* Action Buttons */
.btn-pop-action {
  background: #22222A;
  border: 2px solid #000;
  color: #FFF;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  box-shadow: 2px 2px 0 #000;
  transition: all 0.15s ease;
}

.btn-pop-action:hover {
  background: #2E2E3A;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #000;
}

.btn-pop-action.active {
  background: var(--haring-yellow);
  color: #000;
  border-color: #000;
  box-shadow: 3px 3px 0 #000;
}

.btn-pop-primary {
  background: var(--haring-red);
  color: #FFF;
  border: 2px solid #000;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-pop);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 3px 3px 0 #000;
  transition: all 0.15s ease;
}

.btn-pop-primary:hover {
  background: #DC2626;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 #000;
}

/* ==========================================================================
   APP WORKSPACE
   ========================================================================== */

.app-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 290px 1fr 290px;
  overflow: hidden;
}

/* LEFT SIDEBAR */
.sidebar-left {
  background: var(--c-surface);
  border-right: 3px solid #000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-scrollable {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-label {
  font-family: var(--font-pop);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--haring-yellow);
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
}

/* Themes List */
.theme-select-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.theme-card-btn {
  background: var(--c-surface-card);
  border: 2px solid #000;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  box-shadow: 2px 2px 0 #000;
  transition: all 0.15s ease;
}

.theme-card-btn:hover {
  background: #2A2A35;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #000;
}

.theme-card-btn.active {
  background: #2E2E3C;
  border-color: var(--haring-yellow);
  box-shadow: 3px 3px 0 var(--haring-yellow);
}

.theme-icon-swatch {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 2px solid #000;
  flex-shrink: 0;
}

.theme-info h4 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.82rem;
  color: #FFF;
  margin-bottom: 2px;
}

.theme-info p {
  font-size: 0.68rem;
  color: var(--c-text-muted);
}

/* Category Filter Tabs */
.category-filter-tabs {
  display: flex;
  gap: 4px;
  background: #000;
  padding: 4px;
  border-radius: 8px;
  border: 2px solid #000;
}

.cat-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--c-text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 6px 4px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
}

.cat-tab.active {
  background: var(--haring-yellow);
  color: #000;
}

/* Spawner Grid */
.spawner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.spawner-card {
  background: var(--c-surface-card);
  border: 2px solid #000;
  border-radius: 8px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 2px 2px 0 #000;
  transition: all 0.15s ease;
  user-select: none;
}

.spawner-card:hover {
  background: #2E2E3A;
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 #000;
  border-color: var(--haring-yellow);
}

.spawner-preview {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.spawner-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #FFF;
  text-align: center;
}

/* ==========================================================================
   CENTER CANVAS WORKSPACE
   ========================================================================== */

.canvas-viewport {
  background: #0B0B0E;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.canvas-stage-wrapper {
  width: 100%;
  max-width: 680px;
  aspect-ratio: 1 / 1;
  position: relative;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), 6px 6px 0 #000;
  border-radius: 4px;
}

.haring-frame-border {
  position: absolute;
  inset: -14px;
  border: 14px solid #141418;
  outline: 3px solid #000;
  pointer-events: none;
  z-index: 20;
}

.stage-surface {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: #141418;
  cursor: crosshair;
}

/* Backdrop SVG */
.backdrop-svg-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Entities */
.haring-entity {
  position: absolute;
  cursor: move;
  user-select: none;
  transform-origin: center center;
  z-index: 10;
  transition: transform 0.1s ease;
}

.haring-entity:hover {
  filter: drop-shadow(0 0 12px rgba(250, 204, 21, 0.8));
}

.haring-entity.selected {
  outline: 3px dashed var(--haring-yellow);
  outline-offset: 6px;
  filter: drop-shadow(0 0 16px rgba(250, 204, 21, 0.9));
}

.haring-entity.entity-sequencer-hit {
  transform: scale(1.12);
  filter: drop-shadow(0 0 24px #FFF) brightness(1.5);
  transition: all 0.08s ease;
}

/* Scanline */
.haring-scanline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--haring-yellow);
  box-shadow: 0 0 15px 4px rgba(250, 204, 21, 0.8);
  pointer-events: none;
  z-index: 30;
  display: none;
  left: 0;
}

.haring-scanline.active {
  display: block;
}

/* Canvas HUD */
.canvas-hud {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  background: #18181D;
  border: 2px solid #000;
  padding: 6px 16px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--c-text-muted);
  box-shadow: 3px 3px 0 #000;
  z-index: 40;
}

.hud-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.hud-label {
  color: var(--haring-yellow);
  font-weight: 700;
}

/* ==========================================================================
   RIGHT SIDEBAR: INSPECTOR & CONTROLS
   ========================================================================== */

.sidebar-right {
  background: var(--c-surface);
  border-left: 3px solid #000;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

.inspector-card {
  background: var(--c-surface-card);
  border: 2px solid #000;
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 2px 2px 0 #000;
}

.control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.control-row label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #FFF;
  display: flex;
  align-items: center;
  gap: 6px;
}

.value-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--haring-yellow);
  font-weight: 700;
}

/* Color Picker */
.styled-color-input {
  -webkit-appearance: none;
  border: 2px solid #000;
  border-radius: 6px;
  background: #000;
  cursor: pointer;
  padding: 2px;
  box-shadow: 2px 2px 0 #000;
}
.styled-color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}
.styled-color-input::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

/* Sliders */
input[type="range"] {
  width: 100%;
  accent-color: var(--haring-yellow);
  cursor: pointer;
}

/* Action Buttons Grid */
.actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.btn-action-icon {
  background: #18181D;
  border: 2px solid #000;
  color: #FFF;
  padding: 8px;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 0 #000;
  transition: all 0.15s;
}

.btn-action-icon:hover {
  background: var(--haring-yellow);
  color: #000;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #000;
}

.btn-action-icon.btn-danger:hover {
  background: var(--haring-red);
  color: #FFF;
}

/* Backdrop / Environment Buttons */
.backdrop-style-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.backdrop-opt-btn {
  background: #18181D;
  border: 2px solid #000;
  color: var(--c-text-muted);
  padding: 8px 4px;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  box-shadow: 2px 2px 0 #000;
  transition: all 0.15s;
}

.backdrop-opt-btn.active {
  background: var(--haring-yellow);
  color: #000;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #000;
}

/* ==========================================================================
   MODALS: MOCKUP & PRINT STUDIO
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

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

.modal-dialog {
  background: #16161C;
  border: 3px solid #000;
  border-radius: 12px;
  width: 90%;
  max-width: 820px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 6px 6px 0 #000;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 3px solid #000;
  background: #1F1F26;
}

.modal-title {
  font-family: var(--font-pop);
  font-size: 1.05rem;
  color: #FFF;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--c-text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  transition: color 0.15s;
}

.modal-close-btn:hover {
  color: var(--haring-yellow);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

/* Interior Mockup Environments */
.scene-environment {
  width: 100%;
  height: 400px;
  border-radius: 8px;
  border: 3px solid #000;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8);
}

.scene-environment.scene-subway {
  background: #D1D5DB; /* NYC white/gray subway tiles */
  background-image: 
    linear-gradient(to right, rgba(0, 0, 0, 0.1) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 1px, transparent 1px);
  background-size: 32px 16px;
}

.scene-environment.scene-pop_shop {
  background: #FFF;
  background-image: radial-gradient(#000 15%, transparent 16%);
  background-size: 20px 20px;
}

.scene-environment.scene-loft {
  background: #3B1E19; /* Brick / downtown loft */
  background-image: 
    linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),
    linear-gradient(to right, rgba(0, 0, 0, 0.2) 2px, transparent 2px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.2) 2px, transparent 2px);
  background-size: 100% 100%, 48px 24px, 48px 24px;
}

.artwork-clone-viewport {
  width: 240px;
  aspect-ratio: 1 / 1;
  position: relative;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), 4px 4px 0 #000;
}

/* ==========================================================================
   FINE ART FRAME & PRINT SIZING STUDIO STYLES
   ========================================================================== */

.print-controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.control-group-compact {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.control-group-compact label {
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #CCC;
  display: flex;
  align-items: center;
  gap: 5px;
}

.select-compact, .input-compact {
  width: 100%;
  padding: 7px 10px;
  font-size: 0.78rem;
  border: 2px solid #000;
  border-radius: 4px;
  background: #18181F;
  color: #FFF;
  font-family: var(--font-sans);
  outline: none;
}

.select-compact:focus, .input-compact:focus {
  border-color: var(--haring-yellow);
}

.custom-dimensions-box {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  background: rgba(250, 204, 21, 0.05);
  padding: 10px;
  border-radius: 6px;
  border: 2px dashed #000;
  margin-top: 10px;
}

.orientation-pill-group {
  display: flex;
  gap: 4px;
}

.orient-pill {
  flex: 1;
  padding: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #18181F;
  border: 2px solid #000;
  border-radius: 4px;
  color: var(--c-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: 2px 2px 0 #000;
  transition: all 0.15s ease;
}

.orient-pill.active {
  background: var(--haring-yellow);
  color: #000;
}

/* Frame Finishes */
.frame-black {
  background: #111111 !important;
  border: 16px solid #111111 !important;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7), 6px 6px 0 #000 !important;
}

.frame-white {
  background: #FDFBF7 !important;
  border: 16px solid #E5E7EB !important;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), 6px 6px 0 #000 !important;
}

.frame-yellow {
  background: #CA8A04 !important;
  border: 16px solid #FACC15 !important;
  box-shadow: 0 15px 40px rgba(250, 204, 21, 0.4), 6px 6px 0 #000 !important;
}

.frame-walnut {
  background: #3E2723 !important;
  border: 16px solid #4E342E !important;
  box-shadow: 0 15px 40px rgba(62, 39, 35, 0.55), 6px 6px 0 #000 !important;
}

.frame-frameless {
  background: transparent !important;
  border: 0px none !important;
  padding: 0 !important;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4) !important;
}

/* Mat Boards */
.mat-none { padding: 0px !important; }
.mat-slim { padding: 12px !important; }
.mat-classic { padding: 22px !important; }
.mat-wide { padding: 34px !important; }

/* Hidden on screen view */
.printable-art-container {
  display: none;
}

@media print {
  body * {
    visibility: hidden;
  }

  .printable-art-container,
  .printable-art-container * {
    visibility: visible;
  }

  .printable-art-container {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    background: #FFF;
    box-sizing: border-box;
  }

  .print-border-frame {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding: 1.5cm;
    background: #FFF;
  }

  .print-inner-canvas {
    flex: 1;
    width: 100%;
    position: relative;
    border: 5px solid #000;
    overflow: hidden;
    background: #141418;
  }

  .print-museum-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 1cm;
    border-top: 3px solid #000;
    padding-top: 0.4cm;
    font-family: 'Space Mono', monospace;
    color: #000;
  }

  .print-museum-footer h3 {
    font-size: 14pt;
    font-weight: 800;
    letter-spacing: 0.05em;
  }

  .print-museum-footer p {
    font-size: 8.5pt;
    color: #222;
  }
}

/* Mobile studio shell */
@media (max-width: 900px) {
  html, body { height: 100dvh; }
  .studio-header {
    height: auto;
    min-height: 52px;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
  }
  .brand-subtitle, .edition-badge, .brand-titles p { display: none; }
  .studio-header button { min-width: 40px; min-height: 40px; }
  .export-body, .export-modal-body, .modal-body, .print-controls-grid { grid-template-columns: 1fr; }
  .export-modal-container, .export-modal-dialog, .modal-dialog, .modal-card, .interior-modal-container {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    max-height: 88dvh;
  }
  .sofa-silhouette { width: min(580px, 100%); }
  .picasso-stage, .kandinsky-stage, .monet-art-stage, .dali-art-stage,
  .stage-surface, .emin-stage-surface, .mondrian-grid,
  .stage-collage-surface, .stage-flora-surface, .stage-dali-surface,
  .p-collage-item, .m-flora-item, .dali-entity, .klimt-entity, .kusama-entity,
  .kahlo-entity, .haring-entity, .emin-entity, .k-entity {
    touch-action: none;
  }
}
