/* ═══════════════════════════════════════════════════════════════
   Image Carver — Theme Bridge
   Maps local CSS variables to shared --t-* tokens so that
   styles.css continues to work under all themes without changes.
   ═══════════════════════════════════════════════════════════════ */

/* ── Remap local vars to theme tokens ── */
[class*="theme-"] {
  --bg:           var(--t-bg-primary);
  --bg2:          var(--t-bg-secondary);
  --text:         var(--t-text);
  --text2:        var(--t-text-dim);
  --accent:       var(--t-accent);
  --accent2:      var(--t-accent);
  --border:       var(--t-border);
  --input-bg:     var(--t-input-bg);
  --input-border: var(--t-input-border);
  --section-bg:   var(--t-bg-secondary);
  --btn-bg:       var(--t-bg-tertiary);
  --btn-hover:    var(--t-hover-bg);
}

/* ── Layout: push the flex row below the fixed theme bar ── */
body { padding-top: var(--sb-topbar-h); box-sizing: border-box; }

/* ── Section styling ── */
[class*="theme-"] .section {
  background: var(--t-bg-secondary);
  border-radius: var(--t-radius);
}

/* ── Field rows ── */
[class*="theme-"] .field label {
  font-size: var(--t-fs-label);
  color: var(--t-text-dim);
  font-weight: var(--t-label-weight, 400);
  text-shadow: var(--t-text-glow, none);
}
[class*="theme-"] .field input[type="number"],
[class*="theme-"] .field input[type="text"] {
  background: var(--t-input-bg);
  border: var(--t-border-width) solid var(--t-input-border);
  color: var(--t-text);
  font-size: var(--t-fs-input);
  border-radius: var(--t-radius);
  text-shadow: var(--t-text-glow, none);
}
[class*="theme-"] .field input[type="number"]:focus,
[class*="theme-"] .field input[type="text"]:focus {
  outline: none;
  border-color: var(--t-accent);
  box-shadow: var(--t-shadow-halo, none);
}
[class*="theme-"] .field input[type="checkbox"] {
  accent-color: var(--t-accent);
}
[class*="theme-"] .field .unit {
  font-size: var(--t-fs-unit);
  color: var(--t-text-dim);
  text-shadow: var(--t-text-glow, none);
}
[class*="theme-"] .field input[type="range"] {
  accent-color: var(--t-accent);
}

/* ── Drop zone ── */
[class*="theme-"] #dropZone {
  border-color: var(--t-border);
  color: var(--t-text-dim);
  background: var(--t-input-bg);
}
[class*="theme-"] #dropZone.dragover {
  border-color: var(--t-accent);
  color: var(--t-accent);
}

/* ── Info notes ── */
[class*="theme-"] #imageInfo,
[class*="theme-"] #stepoverInfo,
[class*="theme-"] #roughingInfo {
  color: var(--t-text-dim);
  font-size: var(--t-fs-unit);
}

/* ── Export row ── */
[class*="theme-"] .export-row { display: flex; gap: 6px; }

/* ── Status bar ── */
[class*="theme-"] #statusBar {
  background: rgba(0,0,0,0.5);
  color: var(--t-text-dim);
}

/* ── Loading overlay ── */
[class*="theme-"] #loadingOverlay { color: var(--t-accent); }

/* ═══ Per-theme specializations ═══ */

/* ── ShopBot 1.0: amber terminal ── */
.theme-shopbot1 .section h3 {
  color: #f09040;
  text-shadow: 0 0 6px rgba(240,144,64,0.35);
}
.theme-shopbot1 .section h3::before {
  content: '// '; color: #a05818;
}
.theme-shopbot1 #statusBar { background: #000 !important; border-top: 1px solid #502808; }

/* ── SBcode: syntax coloring ── */
.theme-devdark .section h3::before { content: '// '; color: #6a9955; }
.theme-devdark .section:nth-child(2) h3 { color: #c586c0; }
.theme-devdark .section:nth-child(3) h3 { color: #4ec9b0; }
.theme-devdark .section:nth-child(4) h3 { color: #dcdcaa; }
.theme-devdark .section:nth-child(5) h3 { color: #ce9178; }
.theme-devdark .section:nth-child(6) h3 { color: #569cd6; }
.theme-devdark .section:nth-child(7) h3 { color: #4fc1ff; }
.theme-devdark .section:nth-child(8) h3 { color: #c586c0; }
.theme-devdark .section:nth-child(9) h3 { color: #dcdcaa; }

/* ── ShopBot 3: legal-pad sidebar + teal viewport ── */

.theme-shopbot3 #sidebar {
  background-color: #fef9c3;
  background-image:
    linear-gradient(to right, transparent 44px, #e06060 44px, #e06060 46px, transparent 46px),
    repeating-linear-gradient(to bottom, transparent 0px, transparent 29px, #aecfea 29px, #aecfea 30px);
  background-attachment: local;
  padding: 0 !important;
  gap: 0 !important;
}

.theme-shopbot3 .section {
  background: transparent !important;
  border-radius: 0 !important;
  border: none !important;
  padding: 0 1rem 0 56px !important;
  margin: 0 !important;
}

.theme-shopbot3 .section h3 {
  height: 30px; display: flex; align-items: center; margin: 0; padding: 0;
  color: #5a2800; font-size: 16px;
}

.theme-shopbot3 .field {
  height: 30px; margin: 0 !important; gap: 6px; align-items: center;
}
.theme-shopbot3 .field label {
  height: 30px; display: flex; align-items: center; margin: 0; font-size: 16px;
}
.theme-shopbot3 .field input[type="number"],
.theme-shopbot3 .field input[type="text"] {
  height: 30px; padding-top: 0 !important; padding-bottom: 0 !important;
  border-radius: 0 !important; font-size: 16px;
}
.theme-shopbot3 .field input[type="range"] { height: 20px; margin: 0; }
.theme-shopbot3 .field .unit { font-size: 16px; }

.theme-shopbot3 #dropZone {
  min-height: 60px; border-radius: 0; padding: 10px;
}

.theme-shopbot3 button.primary {
  height: 30px; padding: 0 !important; margin-top: 0 !important;
  border-radius: 0 !important; font-size: 15px;
}

.theme-shopbot3 .export-row { margin: 0 !important; gap: 2px; }
.theme-shopbot3 .export-row button {
  height: 30px; padding: 0 !important; border-radius: 0 !important; font-size: 14px;
}

.theme-shopbot3 .stats { font-size: 14px; line-height: 30px; margin: 0; }

/* ── Logo in sidebar ── */
.theme-shopbot1 .sidebar-logo { filter: invert(1) sepia(1) saturate(3) hue-rotate(335deg) brightness(0.7) drop-shadow(0 0 3px rgba(240,144,64,0.5)); }
.theme-shopbot-light .sidebar-logo { filter: brightness(0); }
.theme-shopbot3 .sidebar-logo { filter: brightness(0) sepia(1) hue-rotate(15deg); }
