/*
 * image-converter.css — per-tool styles for the drag-and-drop zone, option
 * controls and the converted-image preview. Tokens only (CSP: style-src 'self').
 */

.ic-stack { display: flex; flex-direction: column; gap: var(--space-4); }

/* Drop zone — a label wrapping the (visually hidden) native file input. */
.ic-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-4);
  text-align: center;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--neutral-50);
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.ic-dropzone:hover { border-color: var(--blue-600); background: var(--blue-50); }
.ic-dropzone.is-dragover { border-color: var(--blue-600); background: var(--blue-100); }
.ic-dropzone:focus-within { outline: 2px solid var(--blue-600); outline-offset: 2px; }
.ic-dropzone-icon { color: var(--text-muted); }
.ic-dropzone-title { font: 600 15px/1.4 var(--font-sans); color: var(--text-primary); }
.ic-dropzone-hint { font: 400 13px/1.4 var(--font-sans); color: var(--text-secondary); }

/* Native file input, kept accessible but visually collapsed inside the label. */
.ic-file-input {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Options block. */
.ic-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--neutral-50);
}

.ic-quality-value { float: right; color: var(--text-secondary); font-weight: 600; }

.ic-range { width: 100%; accent-color: var(--blue-600); cursor: pointer; }

.ic-bg-row { display: flex; align-items: center; gap: var(--space-3); }
.ic-color {
  width: 44px; height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
}
.ic-bg-value { color: var(--text-secondary); }

/* Converted-image preview — checkered so transparency reads clearly. */
.ic-preview {
  margin: 0;
  padding: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--neutral-50);
  background-image:
    linear-gradient(45deg, var(--neutral-100) 25%, transparent 25%),
    linear-gradient(-45deg, var(--neutral-100) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--neutral-100) 75%),
    linear-gradient(-45deg, transparent 75%, var(--neutral-100) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.ic-preview img {
  display: block;
  max-width: 100%;
  max-height: 340px;
  height: auto;
  border-radius: var(--radius-sm);
}

.ic-change-up { color: var(--red-600); }
.ic-change-down { color: var(--green-600); }
