/* ============================================================
   PIXLPRO — Image Designer Page CSS
   assets/css/designer-page.css
   Loaded after style.css and tool.css
   All styles extracted from HTML — zero inline styles in HTML
   ============================================================ */

/* ── page scrollable ── */
body.tool-page { overflow-x: hidden; overflow-y: auto; }

/* ── hidden shell hooks ── */
.ds-shell-hook { display: none !important; }

/* ══════════════════════
   PAGE CONTAINER
══════════════════════ */
.ds-page {
  max-width: 1200px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 28px 32px 52px;
}

/* ══════════════════════
   ACTION TOOLBAR
══════════════════════ */
.ds-toolbar {
  background: #ffffff;
  border: 1px solid #e2e0d8;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(12,12,20,0.05);
  padding: 0 14px;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  flex-shrink: 0;
  margin-bottom: 14px;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}
.ds-toolbar::-webkit-scrollbar { height: 3px; }
.ds-toolbar::-webkit-scrollbar-thumb { background: #e2e0d8; border-radius: 2px; }

.ds-tb-sep {
  width: 1px; height: 18px;
  background: #e8e6df; margin: 0 3px; flex-shrink: 0;
}
.ds-tb-lbl {
  font-family: 'DM Sans', sans-serif; font-size: 0.65rem;
  font-weight: 600; color: #8888a8; white-space: nowrap; flex-shrink: 0;
}
.ds-tb-num {
  font-family: 'DM Mono', monospace; font-size: 0.7rem; color: #0c0c14;
  background: #faf9f6; border: 1px solid #d4d1c6;
  border-radius: 6px; padding: 4px 7px; outline: none;
  flex-shrink: 0; transition: border-color 0.14s, box-shadow 0.14s;
  appearance: none; -webkit-appearance: none;
}
.ds-tb-num:focus { border-color: #3d35e8; box-shadow: 0 0 0 2px rgba(61,53,232,0.10); }
.ds-tb-num.w56 { width: 56px; }
.ds-tb-num.w76 { width: 76px; }

.ds-tb-range {
  -webkit-appearance: none; appearance: none;
  height: 4px; background: #e2e0d8; border-radius: 2px;
  outline: none; cursor: pointer; flex-shrink: 0; width: 72px;
}
.ds-tb-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px;
  border-radius: 50%; background: #3d35e8; cursor: pointer;
  border: 2px solid #fff; box-shadow: 0 0 0 2px rgba(61,53,232,0.18);
}
.ds-tb-val {
  font-family: 'DM Mono', monospace; font-size: 0.65rem;
  font-weight: 600; color: #3d35e8; min-width: 30px; flex-shrink: 0;
}

.ds-tb-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 5px; height: 30px; padding: 0 10px; border-radius: 7px;
  background: #f2f1ec; border: 1px solid #e2e0d8; color: #545470;
  cursor: pointer; flex-shrink: 0; white-space: nowrap;
  font-family: 'DM Sans', sans-serif; font-size: 0.72rem; font-weight: 600;
  transition: background 0.13s, border-color 0.13s, color 0.13s;
}
.ds-tb-btn:hover { background: #e8e6df; color: #0c0c14; border-color: #d4d1c6; }
.ds-tb-btn svg { width: 11px; height: 11px; flex-shrink: 0; }
.ds-tb-btn.primary { background: #3d35e8; border-color: #3d35e8; color: #fff; box-shadow: 0 1px 4px rgba(61,53,232,0.28); }
.ds-tb-btn.primary:hover { background: #2c25c8; border-color: #2c25c8; }
.ds-tb-btn.ghost-icon { width: 30px; padding: 0; font-size: 15px; }
label.ds-tb-btn { cursor: pointer; }

.ds-tb-sel {
  font-family: 'DM Mono', monospace; font-size: 0.7rem; color: #0c0c14;
  background: #faf9f6; border: 1px solid #d4d1c6;
  border-radius: 6px; padding: 4px 22px 4px 8px; outline: none;
  flex-shrink: 0; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%238888a8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 7px center;
  transition: border-color 0.14s;
  max-width: 80px;
}
.ds-tb-sel:focus { border-color: #3d35e8; }
/* Export format select — slightly wider for label */
#exportFormat { max-width: 72px; }

.ds-tb-text {
  font-family: 'DM Sans', sans-serif; font-size: 0.72rem; color: #0c0c14;
  background: #faf9f6; border: 1px solid #d4d1c6;
  border-radius: 6px; padding: 4px 9px; outline: none;
  flex-shrink: 0; transition: border-color 0.14s;
}
.ds-tb-text:focus { border-color: #3d35e8; }
.ds-tb-text.w120 { width: 120px; }

/* Hidden by default — JS shows when text tool is active */
.ds-text-tool-field { display: none; }

/* ══════════════════════
   TWO-COLUMN GRID
══════════════════════ */
.ds-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  align-items: start;
  min-width: 0;
  overflow: hidden;
}

/* ══════════════════════
   LEFT SIDEBAR CARDS
══════════════════════ */
.ds-sidebar { display: flex; flex-direction: column; gap: 12px; }

.ds-card {
  background: #ffffff;
  border: 1px solid #e2e0d8;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(12,12,20,0.05);
  overflow: hidden;
}
.ds-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid #f0efe8;
}
.ds-card-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.72rem; font-weight: 700; color: #0c0c14; letter-spacing: -0.01em;
}
.ds-card-body { padding: 12px 14px; }
.ds-card-body-flush { padding: 8px 10px 4px; }

/* ── Tool picker ── */
.ds-tools-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px;
}
.ds-tool-btn {
  width: 100%; aspect-ratio: 1;
  max-height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; background: none;
  border: 1px solid transparent; color: #8888a8; cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.ds-tool-btn:hover { background: #f2f1ec; color: #2a2a3a; border-color: #e2e0d8; }
.ds-tool-btn.active { background: rgba(61,53,232,0.08); color: #3d35e8; border-color: rgba(61,53,232,0.20); }
.ds-tool-btn svg { width: 13px; height: 13px; }
.ds-tool-div { grid-column: 1/-1; height: 1px; background: #f0efe8; margin: 2px 0; }

/* ── Color swatches ── */
.ds-color-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-top: 1px solid #f0efe8;
}
.ds-color-label {
  font-size: 0.7rem; font-weight: 600; color: #8888a8;
  font-family: 'DM Sans', sans-serif; flex-shrink: 0;
}
.ds-color-hint {
  font-family: 'DM Mono', monospace; font-size: 0.62rem; color: #b8b8cc;
}
.ds-swatch-pair {
  position: relative; width: 42px; height: 32px; flex-shrink: 0;
}
.ds-swatch-bg {
  position: absolute; bottom: 0; right: 0;
  width: 24px; height: 24px; border-radius: 6px;
  border: 2px solid #d4d1c6; cursor: pointer; z-index: 2;
  transition: transform 0.12s; box-shadow: 0 1px 3px rgba(12,12,20,0.08);
  background: #ffffff; /* default until JS sets it */
}
.ds-swatch-bg:hover { transform: scale(1.08); }
.ds-swatch-fg {
  position: absolute; top: 0; left: 0;
  width: 24px; height: 24px; border-radius: 6px;
  border: 2px solid #3d35e8; cursor: pointer; z-index: 3;
  transition: transform 0.12s;
  box-shadow: 0 0 0 2px rgba(61,53,232,0.18), 0 2px 6px rgba(12,12,20,0.15);
}
.ds-swatch-fg:hover { transform: scale(1.08); box-shadow: 0 0 0 3px rgba(61,53,232,0.25); }

/* Hidden color inputs — triggered by swatch click */
.ds-color-input-hidden {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none; /* JS .click() opens it — no user direct interaction */
  border: none;
  padding: 0;
  top: 0; left: 0;
  overflow: hidden;
}

/* ── Sidebar controls ── */
.ds-ctrl { margin-bottom: 10px; }
.ds-ctrl:last-child { margin-bottom: 0; }
.ds-ctrl-label {
  display: block; font-size: 0.7rem; font-weight: 600;
  color: #545470; margin-bottom: 5px; font-family: 'DM Sans', sans-serif;
}
.ds-ctrl-mt { margin-top: 8px; }

.ds-select {
  width: 100%; font-family: 'DM Mono', monospace; font-size: 0.72rem; color: #0c0c14;
  background: #faf9f6; border: 1px solid #d4d1c6;
  border-radius: 7px; padding: 6px 26px 6px 9px; outline: none;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238888a8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
  cursor: pointer; transition: border-color 0.14s;
}
.ds-select:focus { border-color: #3d35e8; box-shadow: 0 0 0 3px rgba(61,53,232,0.10); outline: none; }

.ds-check {
  display: flex; align-items: center; gap: 7px; cursor: pointer; margin-bottom: 6px;
}
.ds-check:last-child { margin-bottom: 0; }
.ds-check input { accent-color: #3d35e8; width: 13px; height: 13px; cursor: pointer; }
.ds-check span {
  font-size: 0.72rem; color: #545470;
  font-family: 'DM Sans', sans-serif; font-weight: 500; line-height: 1;
}

/* ── Brush preset pills ── */
.ds-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.ds-pill {
  font-family: 'DM Mono', monospace; font-size: 0.65rem; font-weight: 500;
  padding: 4px 9px; border-radius: 20px; cursor: pointer;
  background: #f2f1ec; border: 1px solid #e2e0d8; color: #545470;
  transition: background 0.12s, color 0.12s, border-color 0.12s; line-height: 1;
}
.ds-pill:hover { background: rgba(61,53,232,0.07); color: #3d35e8; border-color: rgba(61,53,232,0.20); }

/* ── Layer list ── */
.ds-layer-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 7px; cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  margin-bottom: 2px; border: 1px solid transparent;
}
.ds-layer-item:hover { background: #f2f1ec; }
.ds-layer-item.active { background: rgba(61,53,232,0.06); border-color: rgba(61,53,232,0.18); }

/* .layer-thumb used by designer.js — keep this exact class name */
.layer-thumb {
  width: 24px; height: 24px; border-radius: 4px;
  border: 1px solid #e2e0d8; overflow: hidden; flex-shrink: 0;
  background: #faf9f6;
}
.layer-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ds-layer-inner {
  display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0;
}
.ds-layer-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 0.72rem; color: #2a2a3a;
  font-family: 'DM Sans', sans-serif; flex: 1;
}
.ds-layer-item.active .ds-layer-name { color: #3d35e8; font-weight: 600; }
.ds-layer-vis { flex-shrink: 0; accent-color: #3d35e8; cursor: pointer; }

.ds-layer-actions { display: flex; gap: 5px; margin-top: 8px; }
.ds-layer-btn {
  flex: 1; font-family: 'DM Sans', sans-serif; font-size: 0.7rem; font-weight: 600;
  padding: 6px 0; border-radius: 7px; cursor: pointer; transition: background 0.13s;
  border: 1px solid; display: flex; align-items: center; justify-content: center;
  gap: 3px; background: none;
}
.ds-layer-btn.add { color: #3d35e8; border-color: rgba(61,53,232,0.22); background: rgba(61,53,232,0.06); }
.ds-layer-btn.add:hover { background: rgba(61,53,232,0.12); }
.ds-layer-btn.del { color: #dc2626; border-color: rgba(220,38,38,0.20); background: rgba(220,38,38,0.05); }
.ds-layer-btn.del:hover { background: rgba(220,38,38,0.10); }

/* ── Info rows ── */
.ds-info-row {
  font-family: 'DM Mono', monospace; font-size: 0.68rem;
  color: #8888a8; margin-bottom: 3px; line-height: 1.5;
}
.ds-info-row b { color: #545470; font-weight: 500; }

.ds-privacy {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.68rem; font-weight: 600; color: #0a8a5a;
  background: rgba(10,138,90,0.08); border: 1px solid rgba(10,138,90,0.15);
  padding: 3px 9px; border-radius: 20px; font-family: 'DM Sans', sans-serif;
}
.ds-privacy-wrap { margin-top: 10px; }

/* ══════════════════════
   CANVAS CARD (right col)
══════════════════════ */
.ds-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; overflow: hidden; }

.ds-canvas-card {
  background: #ffffff; border: 1px solid #e2e0d8;
  border-radius: 12px; box-shadow: 0 1px 2px rgba(12,12,20,0.05);
  overflow: hidden; min-width: 0;
}
.ds-canvas-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid #f0efe8;
}
.ds-canvas-head-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.72rem; font-weight: 700; color: #0c0c14;
}
.ds-canvas-head-meta { display: flex; align-items: center; gap: 6px; }
.ds-canvas-badge {
  font-family: 'DM Mono', monospace; font-size: 0.62rem;
  color: #8888a8; background: #f2f1ec; border: 1px solid #e2e0d8;
  padding: 2px 8px; border-radius: 20px;
}

/* Dark canvas viewport */
.ds-canvas-viewport {
  background: #10131e;
  background-image: radial-gradient(circle, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 20px 20px;
  min-height: 480px;
  overflow: auto;
  display: flex; align-items: flex-start; justify-content: flex-start;
  padding: 16px; position: relative; transition: outline 0.12s;
  width: 100%;
  box-sizing: border-box;
}
.ds-canvas-viewport::-webkit-scrollbar { width: 6px; height: 6px; }
.ds-canvas-viewport::-webkit-scrollbar-track { background: #0c0f18; }
.ds-canvas-viewport::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); border-radius: 3px; }
.ds-canvas-viewport.drag-active {
  outline: 2px dashed #3d35e8; outline-offset: -3px; background-color: #131726;
}

/* Canvas wrap + element */
.designer-canvas-wrap {
  position: relative;
  flex-shrink: 1;
  max-width: 100%;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 12px 60px rgba(0,0,0,0.70);
  border-radius: 2px;
  overflow: hidden;
}
#mainCanvas {
  display: block;
  cursor: crosshair;
  max-width: 100%;
  height: auto;
}
#mainCanvas.text-mode   { cursor: text; }
#mainCanvas.eraser-mode { cursor: cell; }
#mainCanvas.fill-mode   { cursor: copy; }
#mainCanvas.move-mode   { cursor: move; }

/* Status bar */
.ds-statusbar {
  display: flex; align-items: center; gap: 20px;
  padding: 7px 14px; border-top: 1px solid #f0efe8;
  background: #faf9f6; flex-wrap: wrap;
}
.ds-status-item {
  font-family: 'DM Mono', monospace; font-size: 0.62rem;
  color: #b8b8cc; display: flex; align-items: center; gap: 4px; white-space: nowrap;
}
.ds-status-item b { color: #8888a8; font-weight: 500; }
.ds-status-live {
  font-family: 'DM Mono', monospace; font-size: 0.62rem;
  color: #0a8a5a; font-weight: 600; margin-left: auto;
  display: flex; align-items: center; gap: 5px;
}
.ds-status-live::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: #0a8a5a; flex-shrink: 0;
  animation: ds-pulse 2s ease infinite;
}
@keyframes ds-pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.6;transform:scale(1.3)} }

/* ══════════════════════
   DROPDOWN ICON COLORS
   (replaces inline style="background:...")
══════════════════════ */
.px-dd-icon-teal   { background: rgba(13,148,136,0.10); }
.px-dd-icon-blue   { background: rgba(37,99,235,0.10); }
.px-dd-icon-violet { background: rgba(124,58,237,0.10); }
.px-dd-icon-amber  { background: rgba(217,119,6,0.10); }
.px-dd-icon-rose   { background: rgba(225,29,72,0.10); }
.px-dd-icon-indigo { background: rgba(61,53,232,0.12); }

/* Hero icon bg */
.t-hero-icon-indigo { background: rgba(61,53,232,0.10); }

/* ══════════════════════
   RESPONSIVE
══════════════════════ */
@media(max-width:1024px) { .ds-page { padding: 20px 24px 40px; } }
@media(max-width:860px) {
  .ds-grid { grid-template-columns: 1fr; }
  .ds-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .ds-canvas-viewport { min-height: 400px; }
}
@media(max-width:640px) {
  .ds-page { padding: 16px 16px 32px; }
  .ds-sidebar { grid-template-columns: 1fr; }
  .ds-canvas-viewport { min-height: 320px; padding: 16px; }
  .ds-tools-grid { grid-template-columns: repeat(6, 1fr); }
}
@media(max-width:420px) {
  .ds-toolbar { height: auto; flex-wrap: wrap; padding: 8px 12px; }
  .ds-tb-sep { display: none; }
}

/* ── Swatch click handled via JS mousedown .click() ── */
.ds-swatch-fg,
.ds-swatch-bg { cursor: pointer; }

.ds-color-labels {
  display: flex; align-items: center; gap: 3px;
}
.ds-fg-label { font-family: 'DM Mono', monospace; font-size: 0.62rem; font-weight: 600; color: #3d35e8; cursor: pointer; }
.ds-bg-label { font-family: 'DM Mono', monospace; font-size: 0.62rem; color: #8888a8; cursor: pointer; }
.ds-color-slash { font-family: 'DM Mono', monospace; font-size: 0.62rem; color: #b8b8cc; }

/* ── Distinct filled shapes — tinted fill to differentiate from outline ── */
.ds-tool-btn[data-tool="filled-rect"] svg,
.ds-tool-btn[data-tool="filled-circle"] svg {
  opacity: 0.75;
}
.ds-tool-btn[data-tool="filled-rect"].active svg,
.ds-tool-btn[data-tool="filled-circle"].active svg { opacity: 1; }

/* ── Tool tooltips on hover ── */
.ds-tool-btn { position: relative; }
.ds-tool-btn::before {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #0c0c14;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.62rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 5px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 20;
  max-width: 160px;
  text-align: center;
}
.ds-tool-btn:hover::before { opacity: 1; }

/* ══════════════════════
   EXPLICIT BG COLOR BUTTON
══════════════════════ */
.ds-color-btn-bg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px 0 6px;
  border-radius: 7px;
  background: #f2f1ec;
  border: 1px solid #e2e0d8;
  color: #545470;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  transition: background 0.13s, border-color 0.13s;
  flex-shrink: 0;
  margin-left: 4px;
}
.ds-color-btn-bg:hover {
  background: #e8e6df;
  border-color: #d4d1c6;
  color: #0c0c14;
}
.ds-color-btn-bg-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1.5px solid #d4d1c6;
  background: #ffffff;
  flex-shrink: 0;
}
