/* ═══════════════════════════════════════════════════════════════
   FilmTexture — Shared Tool Styles
   ═══════════════════════════════════════════════════════════════ */

/* ── Tool Hero ── */

.tool-hero {
  text-align: center;
  padding: clamp(80px, 10vh, 120px) 24px 48px;
  max-width: 680px;
  margin: 0 auto;
}
.tool-hero-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(201,168,76,0.10);
  border: 1px solid rgba(201,168,76,0.18);
  border-radius: 100px;
  padding: 5px 14px;
  margin-bottom: 20px;
}
.tool-hero h1 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--white);
  margin-bottom: 12px;
}
.tool-hero p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--silver);
  max-width: 540px;
  margin: 0 auto;
}

/* ── Tool Body ── */

.tool-body {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 80px;
}
.tool-body--narrow { max-width: 640px; }

/* ── Sections ── */

.tool-section { margin-bottom: 28px; }
.tool-section-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--white);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tool-label-dim { color: var(--silver); font-weight: 400; }

/* ── Drop Zone ── */

.tool-drop {
  border: 2px dashed rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  padding: 44px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.tool-drop:hover, .tool-drop.drag {
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.02);
}
.tool-drop.has-file {
  border-style: solid;
  border-color: rgba(74,222,128,0.3);
  background: rgba(74,222,128,0.04);
}
.tool-drop-icon {
  font-size: 20px;
  color: rgba(255,255,255,0.3);
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
}
.tool-drop.has-file .tool-drop-icon { color: #7ae0a0; }
.tool-drop-text { font-size: 14px; color: var(--silver); }
.tool-drop.has-file .tool-drop-text { color: var(--white); font-weight: 500; }
.tool-drop-info { font-size: 12px; color: rgba(255,255,255,0.3); margin-top: 4px; }
.tool-drop input[type="file"] { display: none; }

/* ── Pill Buttons (Toggle) ── */

.tool-pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-pill {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px; font-weight: 400; font-family: inherit;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.tool-pill:hover {
  color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.14);
}
.tool-pill.active {
  color: #fff;
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.22);
  font-weight: 500;
}

/* ── Canvas Container ── */

.tool-canvas-wrap {
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}
.tool-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
}

/* ── Primary Action Button ── */

.tool-action {
  width: 100%;
  height: 48px;
  border-radius: 10px;
  font-size: 15px; font-weight: 600; font-family: inherit;
  border: none; cursor: pointer;
  transition: all 0.15s;
  background: var(--gold); color: #0A0A0A;
}
.tool-action:hover:not(:disabled) { opacity: 0.88; }
.tool-action:active:not(:disabled) { transform: scale(0.985); }
.tool-action:disabled {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.2);
  cursor: not-allowed;
}

/* ── Status Messages ── */

.tool-status {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  display: none;
  border: 1px solid transparent;
}
.tool-status--done  { display: block; background: rgba(74,222,128,0.08); border-color: rgba(74,222,128,0.2); color: #7ae0a0; }
.tool-status--busy  { display: block; background: rgba(96,165,250,0.08); border-color: rgba(96,165,250,0.2); color: #93bbfd; }
.tool-status--error { display: block; background: rgba(139,26,26,0.12); border-color: rgba(139,26,26,0.25); color: #e87070; }

/* ── Stat Cards ── */

.tool-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 24px;
}
.tool-stat {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.tool-stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.35);
  margin-bottom: 4px;
}
.tool-stat-value {
  font-size: 18px;
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.01em;
}
.tool-stat-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  margin-top: 2px;
}

/* ── Side-by-side Layout ── */

.tool-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Slider ── */

.tool-slider-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tool-slider-wrap label {
  font-size: 13px;
  color: var(--silver);
  white-space: nowrap;
  min-width: 70px;
}
.tool-slider-wrap input[type="range"] {
  flex: 1;
  accent-color: var(--gold);
  height: 4px;
}
.tool-slider-wrap .tool-slider-val {
  font-size: 13px;
  color: var(--white);
  font-weight: 500;
  min-width: 36px;
  text-align: right;
}

/* ── Split View ── */

.tool-split {
  position: relative;
  cursor: col-resize;
  user-select: none;
  -webkit-user-select: none;
}
.tool-split-line {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: rgba(255,255,255,0.7);
  pointer-events: none;
  z-index: 2;
}
.tool-split-handle {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  border: 2px solid rgba(255,255,255,0.7);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.tool-split-handle::before {
  content: '\2194';
  color: rgba(255,255,255,0.8);
  font-size: 14px;
}
.tool-split-label {
  position: absolute;
  top: 12px;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(0,0,0,0.6);
  color: rgba(255,255,255,0.7);
  pointer-events: none;
  z-index: 2;
}
.tool-split-label--before { left: 12px; }
.tool-split-label--after { right: 12px; }

/* ── Color Swatch ── */

.tool-swatch {
  width: 100%;
  height: 48px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.08);
}

/* ── Palette Row ── */

.tool-palette {
  display: flex;
  gap: 4px;
  height: 36px;
  border-radius: 6px;
  overflow: hidden;
}
.tool-palette-color {
  flex: 1;
  min-width: 0;
}

/* ── Responsive ── */

@media (max-width: 700px) {
  .tool-side {
    grid-template-columns: 1fr;
  }
  .tool-stats {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 480px) {
  .tool-pill { font-size: 12px; padding: 6px 11px; }
  .tool-drop { padding: 32px 16px; }
  .tool-stats { grid-template-columns: 1fr; }
}

/* ═══ LIGHT THEME OVERRIDES ═══ */
html[data-theme="light"] .tool-drop {
  border-color: rgba(0,0,0,0.18);
  background: rgba(0,0,0,0.02);
}
html[data-theme="light"] .tool-drop:hover,
html[data-theme="light"] .tool-drop.drag {
  border-color: rgba(0,0,0,0.30);
  background: rgba(0,0,0,0.04);
}
html[data-theme="light"] .tool-drop-icon {
  color: rgba(0,0,0,0.35);
}
html[data-theme="light"] .tool-drop-text {
  color: rgba(0,0,0,0.6);
}
html[data-theme="light"] .tool-drop-info {
  color: rgba(0,0,0,0.35);
}
html[data-theme="light"] .tool-pill {
  color: rgba(0,0,0,0.55);
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.10);
}
html[data-theme="light"] .tool-pill:hover {
  color: rgba(0,0,0,0.75);
  background: rgba(0,0,0,0.06);
  border-color: rgba(0,0,0,0.16);
}
html[data-theme="light"] .tool-pill.active {
  color: rgba(0,0,0,0.9);
  background: rgba(0,0,0,0.08);
  border-color: rgba(0,0,0,0.22);
}
html[data-theme="light"] .tool-canvas-wrap {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.08);
}
html[data-theme="light"] .tool-stat {
  border-color: rgba(0,0,0,0.08);
}
html[data-theme="light"] .tool-stat-label {
  color: rgba(0,0,0,0.4);
}
html[data-theme="light"] .tool-stat-value {
  color: rgba(0,0,0,0.8);
}
html[data-theme="light"] .tool-stat-sub {
  color: rgba(0,0,0,0.35);
}
html[data-theme="light"] .tool-split-handle {
  background: rgba(0,0,0,0.2);
}
html[data-theme="light"] .tool-split-handle:hover {
  background: rgba(0,0,0,0.35);
}
