/*
 * image-rotate-flip.css — per-tool styles: drop zone, transform toolbar,
 * angle control, and the checkered canvas preview. Tokens only (CSP-safe).
 */

/* Drop zone — a label wrapping the (visually hidden) native file input. */
.irf-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;
}
.irf-dropzone:hover { border-color: var(--blue-600); background: var(--blue-50); }
.irf-dropzone.is-dragover { border-color: var(--blue-600); background: var(--blue-100); }
.irf-dropzone:focus-within { outline: 2px solid var(--blue-600); outline-offset: 2px; }
.irf-dropzone-icon { color: var(--text-muted); }
.irf-dropzone-title { font: 600 15px/1.4 var(--font-sans); color: var(--text-primary); }
.irf-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. */
.irf-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;
}

/* Transform toolbar. */
.irf-toolbar { flex-wrap: wrap; gap: var(--space-2); }
/* Mirror the refresh glyph so the "rotate left" button reads as counter-clockwise. */
.irf-flip-x { transform: scaleX(-1); }

/* Free-angle control: slider + number field side by side. */
.irf-angle-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.irf-range { flex: 1 1 200px; min-width: 160px; accent-color: var(--blue-600); }
.irf-angle-num-group { flex: 0 0 auto; width: 6.5rem; }
.irf-format-select { max-width: 24rem; }

/* Background radio row. */
.irf-radio-row { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.irf-radio { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; }

/* Canvas preview surface — checkered so transparency reads clearly. */
.irf-canvas-wrap {
  margin: var(--space-2) 0;
  padding: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  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;
  overflow: auto;
}
.irf-canvas-wrap canvas {
  display: block;
  max-width: 100%;
  max-height: 420px;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.irf-meta {
  font: 500 13px/1.5 var(--font-sans);
  color: var(--text-secondary);
  margin: 0 0 var(--space-2);
}
