/* ═══════════════════════════════════════════════════════════
   image.css — Estilos da aba Análise de imagem
═══════════════════════════════════════════════════════════ */

/* ── DROPZONE ── */
.img-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-xl);
  padding: 56px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-surface);
  min-height: 260px;
  position: relative;
}
.img-dropzone:hover,
.img-dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.img-dropzone.drag-over { transform: scale(1.01); }

.dropzone-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-lg);
  background: var(--bg-overlay);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  margin-bottom: 4px;
  transition: background var(--transition);
}
.img-dropzone:hover .dropzone-icon { background: var(--accent-bg); }

.dropzone-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}
.dropzone-sub {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 340px;
}
.dropzone-shortcuts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}
.kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg-overlay);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--border-default);
}

/* ── WORKSPACE ── */
#imgWorkspace { display: none; }

/* ── VISION BAR ── */
.vision-bar {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 10px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border-subtle);
}
.vision-bar-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-family: var(--font-sans);
  font-weight: 400;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.vision-bar-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }
.vision-bar-btn.active {
  background: var(--accent-dark);
  border-color: transparent;
  color: #fff;
  font-weight: 500;
}
.vision-bar-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── COMPARE LAYOUT ── */
.img-compare-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--space-4);
  align-items: start;
}
@media (max-width: 900px) {
  .img-compare-layout { grid-template-columns: 1fr; }
}

/* ── COMPARE VIEWER ── */
.compare-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-overlay);
  border: 1px solid var(--border-subtle);
  user-select: none;
}
.compare-base {
  display: block;
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
}
.compare-canvas-base {
  display: block;
  width: 100%;
  height: auto;
}
.compare-overlay {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  width: 50%; /* controlado pelo JS */
  border-right: 2px solid #fff;
}
.compare-overlay canvas {
  display: block;
  height: 100%;
  width: auto;
  max-width: none;
}
.compare-divider {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: white;
  box-shadow: 0 0 6px rgba(0,0,0,0.5);
  left: 50%;
  pointer-events: none;
}
.compare-divider-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px; height: 32px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: #444;
}
.compare-label {
  position: absolute;
  bottom: 10px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 500;
  background: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.9);
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.compare-label-left  { left: 10px; }
.compare-label-right { right: 10px; }

/* Slider do comparador */
.compare-slider-wrap {
  padding: 10px 12px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-raised);
  display: flex;
  align-items: center;
  gap: 10px;
}
.compare-slider-wrap label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── SPINNER ── */
.img-spinner {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  z-index: 10;
  backdrop-filter: blur(3px);
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-ring {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── PAINEL DE ANÁLISE ── */
.analysis-panel { display: flex; flex-direction: column; gap: var(--space-4); }

.stat-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}
.stat-row:last-child { border-bottom: none; }
.stat-label { color: var(--text-muted); }
.stat-value { font-family: var(--font-mono); font-weight: 500; color: var(--text-primary); }

.scan-bar-track {
  height: 6px;
  background: var(--bg-overlay);
  border-radius: 3px;
  overflow: hidden;
  margin: 6px 0 10px;
}
.scan-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1), background 0.5s;
  width: 0%;
}

/* ── RESET BTN ── */
.img-reset-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: transparent;
  font-family: var(--font-sans);
  transition: all var(--transition);
}
.img-reset-btn:hover { color: var(--red); border-color: var(--red-bd); background: var(--red-bg); }

/* ── SCAN ALERT ── */
.scan-alert {
  display: none;
  background: var(--yellow-bg);
  border: 1px solid var(--yellow-bd);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--yellow);
  line-height: 1.5;
}

/* ── MOBILE ── */
@media (max-width: 600px) {
  .vision-bar { gap: 3px; padding: 8px; }
  .vision-bar-btn { font-size: 11px; padding: 4px 9px; }
  .vision-bar-btn span.vb-name { display: none; } /* esconde texto, mostra só dot */
}

/* ── CORES DOMINANTES — chip com botão decorativa ── */
.color-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
@media (max-width: 600px) { .color-stats-grid { grid-template-columns: repeat(2, 1fr); } }

.cs-chip-wrap {
  display: flex;
  flex-direction: column;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
  transition: opacity 0.2s;
}
.cs-chip-wrap.cs-chip-dimmed {
  opacity: 0.38;
}
.cs-dec-btn {
  font-size: 9px;
  font-family: var(--font-sans);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg-overlay);
  border: none;
  border-top: 1px solid rgba(0,0,0,0.08);
  padding: 4px 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: center;
}
.cs-dec-btn:hover { background: var(--bg-raised); color: var(--text-secondary); }
.cs-dec-btn.active {
  background: var(--accent-dark);
  color: #fff;
}

/* ── PARES DE CONTRASTE — botão N/A e esmaecimento ── */
.checker-pair {
  transition: opacity 0.25s;
}
.checker-pair.cp-dimmed {
  opacity: 0.32;
  pointer-events: auto; /* mantém clicável para desfazer */
}
.checker-pair.cp-dimmed .cp-na-btn {
  pointer-events: auto;
}

.cp-na-btn {
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-overlay);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 3px 7px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.cp-na-btn:hover { background: var(--bg-raised); color: var(--text-secondary); }
.cp-na-btn.active {
  background: var(--accent-dark);
  border-color: transparent;
  color: #fff;
}

/* ── SMART EVALUATOR ── */
#seScore, #seScoreLabel, #seScoreRing, #seCriteria, #seFeedback {
  transition: opacity 0.2s ease;
}

.se-score-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.se-ring-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}
.se-ring-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  padding-top: 22px;
  gap: 1px;
}
.se-score-num {
  font-size: 20px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1;
}
.se-score-denom {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.se-score-meta {
  flex: 1;
  min-width: 0;
}
.se-score-label-wrap {
  margin-bottom: 6px;
}
.se-score-badge {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.se-score-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

/* Critérios */
.se-criteria {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.se-criterion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}
.se-criterion:last-child { border-bottom: none; }
.se-criterion:nth-child(even) { background: var(--bg-raised); }
.se-crit-label {
  font-size: 12px;
  color: var(--text-secondary);
  flex: 1;
  min-width: 0;
}
.se-crit-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}
.se-crit-value {
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-mono);
  white-space: nowrap;
}
.se-crit-sub {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Feedback */
.se-feedback {
  margin-bottom: 12px;
}
.se-feedback-p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 6px;
}
.se-feedback-p:last-child { margin-bottom: 0; }

/* Disclaimer */
.se-disclaimer {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}
.se-disclaimer strong {
  color: var(--text-secondary);
}

