/* ==========================================================================
   ESTUDIO DE ILUMINACIÓN & CABEZA DE ASARO 3D - ROOSTER ESPACIO DE ARTE
   ========================================================================== */

:root {
  --bg-dark: #0a0c10;
  --bg-card: #13161f;
  --bg-card-hover: #1a1e2b;
  --bg-card-active: #222738;
  --border: #232838;
  --border-light: #2f364a;
  
  --yellow: #FFD500;
  --yellow-hover: #e6c000;
  --yellow-glow: rgba(255, 213, 0, 0.25);
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  
  --sidebar-width: 380px;
  --header-height: 58px;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.45;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* ==========================================================================
   APP HEADER
   ========================================================================== */
.app-header {
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 12px;
  position: relative;
  z-index: 20;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-logo {
  height: 34px;
  width: auto;
  object-fit: contain;
}

.brand-text h1 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.2px;
}

.brand-badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--yellow);
  color: #000;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* Camera presets in header */
.camera-presets-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  padding: 2px 4px;
  scrollbar-width: none;
}
.camera-presets-bar::-webkit-scrollbar {
  display: none;
}

.btn-preset {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.btn-preset:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-light);
}
.btn-preset.active {
  background: rgba(255, 213, 0, 0.12);
  color: var(--yellow);
  border-color: var(--yellow);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-header-action {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.btn-header-action:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}
.btn-header-action.active {
  background: var(--yellow);
  color: #000;
  border-color: var(--yellow);
}

/* ==========================================================================
   APP WORKSPACE LAYOUT
   ========================================================================== */
.workspace {
  display: flex;
  height: calc(100% - var(--header-height));
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* 3D Viewport Area */
.viewport-area {
  flex: 1;
  height: 100%;
  position: relative;
  background: radial-gradient(circle at 50% 45%, #181d29 0%, #0a0c10 85%);
  overflow: hidden;
  display: flex;
}

/* Split-screen container */
.split-view-container {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative;
}

.canvas-panel {
  flex: 1;
  height: 100%;
  position: relative;
  outline: none;
}

#asaroCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Floating overlay help & telemetry */
.canvas-help-pill {
  position: absolute;
  top: 14px;
  left: 16px;
  background: rgba(19, 22, 31, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 20px;
  pointer-events: none;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
}

.telemetry-badges {
  position: absolute;
  bottom: 16px;
  left: 16px;
  display: flex;
  gap: 8px;
  z-index: 5;
  pointer-events: none;
}

.badge-item {
  background: rgba(19, 22, 31, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
}
.badge-label {
  font-size: 9.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.badge-val {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--yellow);
}

/* Zoom controls */
.canvas-zoom-controls {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 5;
}
.btn-zoom {
  width: 32px;
  height: 32px;
  background: rgba(19, 22, 31, 0.9);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.btn-zoom:hover {
  background: var(--bg-card-hover);
  border-color: var(--yellow);
  color: var(--yellow);
}

/* Value Filter Mode Banner (Shown when notan/posterize active) */
.filter-active-banner {
  position: absolute;
  top: 14px;
  right: 16px;
  background: rgba(255, 213, 0, 0.15);
  border: 1px solid var(--yellow);
  color: var(--yellow);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 6;
}
.filter-active-banner button {
  background: var(--yellow);
  border: none;
  color: #000;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
  cursor: pointer;
}

/* Split Photo Reference Panel */
.reference-split-panel {
  width: 45%;
  height: 100%;
  background: #08090d;
  border-left: 2px solid var(--border);
  position: relative;
  display: none;
  flex-direction: column;
}
.reference-split-panel.open {
  display: flex;
}
.ref-panel-header {
  height: 38px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ref-panel-header span {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}
.ref-panel-body {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 12px;
}
.ref-panel-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}
.ref-dropzone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.ref-dropzone:hover {
  border-color: var(--yellow);
  color: var(--text-main);
}

/* ==========================================================================
   SIDEBAR CONTROL PANEL
   ========================================================================== */
.control-sidebar {
  width: var(--sidebar-width);
  height: 100%;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 10;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

/* Tab Navigation */
.sidebar-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  padding: 4px;
  gap: 4px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}
.tab-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}
.tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-card-hover);
}
.tab-btn.active {
  background: var(--bg-card);
  color: var(--yellow);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* Tab Content Panels */
.tab-contents-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 20px;
}
.tab-pane.active {
  display: flex;
}

/* Control Group Cards */
.control-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title span.hint {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: none;
}

/* Preset Cards Grid (Rembrandt, Cenital, etc.) */
.presets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.preset-card {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}
.preset-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}
.preset-card.active {
  border-color: var(--yellow);
  background: rgba(255, 213, 0, 0.08);
}
.preset-card-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}
.preset-card.active .preset-card-name {
  color: var(--yellow);
}
.preset-card-desc {
  font-size: 10.5px;
  color: var(--text-dim);
}

/* Slider Controls */
.control-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-label-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.control-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.control-val {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--yellow);
}

.slider-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  background: var(--bg-dark);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}
.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--yellow);
  cursor: pointer;
  box-shadow: 0 0 6px var(--yellow-glow);
  transition: transform 0.1s;
}
.slider-input::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Quick Temperature Buttons */
.temp-buttons-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr) 40px;
  gap: 6px;
}
.btn-temp {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}
.btn-temp:hover {
  border-color: var(--border-light);
  color: var(--text-main);
}
.btn-temp.active {
  border-color: var(--yellow);
  color: var(--yellow);
  background: rgba(255, 213, 0, 0.1);
}
.color-picker-wrap {
  position: relative;
  width: 100%;
  height: 100%;
}
.color-picker-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.color-picker-box {
  width: 100%;
  height: 100%;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: block;
}

/* Switch / Checkbox Row */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}
.switch-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-dark);
  border: 1px solid var(--border);
  transition: .2s;
  border-radius: 20px;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: var(--text-dim);
  transition: .2s;
  border-radius: 50%;
}
input:checked + .toggle-slider {
  background-color: var(--yellow);
  border-color: var(--yellow);
}
input:checked + .toggle-slider:before {
  transform: translateX(18px);
  background-color: #000;
}

/* Material Options Grid */
.materials-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.material-card {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.15s ease;
}
.material-card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}
.material-card.active {
  border-color: var(--yellow);
  background: rgba(255, 213, 0, 0.08);
}
.material-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
}
.material-info {
  display: flex;
  flex-direction: column;
}
.material-name {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main);
}
.material-card.active .material-name {
  color: var(--yellow);
}
.material-desc {
  font-size: 10px;
  color: var(--text-dim);
}

/* Value Study Tool Cards */
.value-mode-card {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.value-mode-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.value-mode-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}
.value-mode-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Multi-step pill buttons (e.g. 3 tonos, 5 tonos) */
.pill-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 4px;
}
.pill-opt {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 0;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}
.pill-opt:hover {
  color: var(--text-main);
}
.pill-opt.active {
  background: var(--yellow);
  color: #000;
  font-weight: 700;
}

/* Sample portrait reference thumbnails */
.sample-portraits-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.sample-thumb {
  aspect-ratio: 3/4;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
  background: var(--bg-dark);
}
.sample-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sample-thumb:hover {
  border-color: var(--yellow);
  transform: translateY(-2px);
}
.sample-thumb.active {
  border-color: var(--yellow);
  box-shadow: 0 0 0 2px var(--yellow);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 900px) {
  .workspace {
    flex-direction: column;
  }
  .viewport-area {
    height: 55%;
  }
  .control-sidebar {
    width: 100%;
    height: 45%;
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .brand-sub {
    display: none;
  }
}
