/* Box Shadow Generator: styles for this tool only. Shared styles live in /tools/shared/tools.css.
   Cards, labels and spacing follow the QR Code Generator; sliders, segmented controls, color fields and buttons are the shared components. */

html,
body {
  overflow-x: clip;
}
body {
  font-variant-numeric: tabular-nums;
}
.bs-scroll {
  flex: 1;
  padding: var(--space-4);
}

/* ---------- layout: preview, box and layers in the stage; presets and code live in the shared right panel (pdf.css) ---------- */

.bs-main {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding-bottom: var(--space-8);
  display: grid;
  gap: var(--space-4);
}

.bs-card {
  min-width: 0;
  padding: var(--space-6);
  background: var(--color-surface);
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-2xl);
}
.bs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.bs-title {
  margin: 0;
  font-size: var(--text-md);
  font-weight: var(--weight-regular);
  color: var(--color-ink);
}
.bs-card > .bs-title {
  margin-bottom: var(--space-3);
}
.bs-head .icon,
.bs-layer-btns .icon,
.bs-copy .icon {
  width: 16px;
  height: 16px;
}

/* ---------- fields ---------- */

.bs-f {
  min-width: 0;
}
.bs-card .field-label {
  padding-top: 0;
}
.bs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3) var(--space-6);
}
.bs-grid .slider {
  margin-top: 0; /* the label sits right above, so the gap matches every other label */
}
.bs-grid .field {
  width: 100%;
}

/* ---------- preview ---------- */

.bs-stage {
  --bs-bg: #f4f4f5;
  display: grid;
  place-items: center;
  height: 18rem;
  padding: var(--space-6);
  overflow: hidden;
  background: var(--bs-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
}
.bs-box {
  width: 200px;
  height: 140px;
  max-width: 100%;
  max-height: 100%;
  background: #fff;
  transition: box-shadow 0.15s, border-radius 0.15s;
}
@media (prefers-reduced-motion: reduce) {
  .bs-box {
    transition: none;
  }
}

/* ---------- layers ---------- */

.bs-layer-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-xl);
}
.bs-layer-list > li + li {
  border-top: 0.5px solid var(--color-border);
}
.bs-layer {
  padding: var(--space-3) var(--space-4) var(--space-4);
}
.bs-layer-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.bs-layer-grip {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 2.5rem;
  color: var(--color-muted);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.bs-layer-grip:hover {
  color: var(--color-ink);
}
.bs-layer-grip .icon {
  width: 16px;
  height: 16px;
}
.bs-layer-name {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  color: var(--color-ink);
}
.bs-layer-btns {
  display: flex;
  gap: 2px;
}
.bs-layer.is-off .bs-layer-name,
.bs-layer.is-off .bs-grid {
  opacity: 0.5;
}
.bs-layer .check-row {
  margin-top: var(--space-3);
  width: max-content;
}
.bs-layer.drag-ghost {
  background: var(--color-surface);
  border: 0.5px solid var(--color-border);
}

/* ---------- presets and code ---------- */

.bs-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* the panel is narrow, so two across */
  gap: var(--space-2);
}
.bs-presets .btn {
  width: 100%;
  justify-content: center;
}
.bs-fmt button {
  flex: 1;
  cursor: pointer;
}
.bs-fmt button:not([aria-pressed="true"]):hover,
#surface button:not([aria-pressed="true"]):hover {
  color: var(--color-ink);
}
.bs-fmt button:focus-visible,
#surface button:focus-visible {
  outline-offset: -2px;
}
.bs-code {
  min-height: 9rem;
  white-space: pre-wrap;
}
.bs-copy {
  width: 100%;
  justify-content: center;
}
.bs-code-foot .field-label {
  padding: 0;
}
.bs-fmt {
  margin-bottom: 0;
}

@media (max-width: 560px) {
  .bs-card {
    padding: var(--space-4);
  }
  .bs-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .bs-stage {
    height: 14rem;
    padding: var(--space-4);
  }
  .bs-presets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
