/*
  upscaler/upscaler.css
  ========================
  Self-contained styles for the Image Upscaler tool. Copied from
  remove-background.css for visual consistency across Forgelyx (same
  underlying pattern: each tool duplicates its own copy of the generic
  .mea-drop-zone / .mea-controls / .mea-field / .mea-quality-group /
  .mea-btn-primary / .mea-status / .mea-download-btn rules — see
  remove-background.css's own header comment for why).
*/

/* Global safety net: [hidden] must always win over any class-based
   display rule below, regardless of CSS source order or specificity.
   Without this, any element that both uses [hidden] AND has a custom
   "display: flex/block/..." rule for its class can end up visible
   even while [hidden] is set (this is a real bug that happened with
   .mea-selected-file and .mea-download-btn in this file — see below). */
[hidden] {
  display: none !important;
}

/* ---------- Drop zone ---------- */

.mea-drop-zone:hover,
.mea-drop-zone.drag-active {
  border-color: var(--mea-accent);
  background: var(--mea-accent-muted);
}

/* ---------- Selected file bar ---------- */

.mea-selected-file {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid var(--mea-border);
  border-radius: var(--mea-radius-md);
  background: var(--mea-surface);
}

.mea-selected-thumb {
  width: 40px;
  height: 40px;
  min-width: 40px;
  object-fit: cover;
  border-radius: var(--mea-radius-sm);
  border: 1px solid var(--mea-border);
  flex-shrink: 0;
  background: var(--mea-surface);
  color: transparent; /* hide alt text if image hasn't loaded yet */
  overflow: hidden;
}

.mea-selected-remove {
  background: transparent;
  border: none;
  color: var(--mea-text-muted);
  font-size: 20px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: var(--mea-radius-sm);
  cursor: pointer;
  flex-shrink: 0;
}

/* ---------- Controls ---------- */

.mea-controls {
  margin-top: 32px;
  border-top: 1px solid var(--mea-border);
  padding-top: 24px;
}

.mea-field {
  margin-bottom: 20px;
}

.mea-field label {
  display: block;
  font-size: 13px;
  color: var(--mea-text-secondary);
  margin-bottom: 8px;
}

.mea-status {
  margin-top: 12px;
  font-size: 13px;
  min-height: 18px;
}

/* ---------- Progress bar (tiled inference) ---------- */

/* ---------- Before/after preview ---------- */

.mea-bgremove-preview {
  margin-top: 32px;
  border-top: 1px solid var(--mea-border);
  padding-top: 24px;
}

.mea-compare-wrap {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.mea-compare-panel {
  flex: 1;
  min-width: 0;
}

.mea-compare-panel .label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--mea-text-secondary);
  margin-bottom: 8px;
}

.mea-compare-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--mea-radius-md);
  border: 1px solid var(--mea-border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--mea-surface);
}

.mea-compare-img-wrap img,
.mea-compare-img-wrap canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.mea-download-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 13px;
  background: var(--mea-success);
  color: #061121;
  border-radius: var(--mea-radius-md);
  font-size: 14.5px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.15s ease;
}

.mea-download-btn:hover {
  transform: translateY(-1px);
}

/* ---------- FAQ (SEO) ---------- */

.mea-faq-item summary::after {
  content: "+";
  font-size: 18px;
  font-weight: 400;
  color: var(--mea-text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 12px;
}

@media (max-width: 480px) {
  .mea-compare-wrap {
    flex-direction: column;
  }
}
