/* FrogShrink - tool-specific styles. Header, hero, footer, base resets, and
   the :root palette tokens come from the shared shell (tool-shell.css); this
   file carries the dropzone, settings form, and results list. */

/* ─── Panels ──────────────────────────────────────────────────────────── */

.panel__title {
  margin: 0 0 1.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

/* ─── Dropzone ────────────────────────────────────────────────────────── */

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
  padding: 2.5rem 1.5rem;
  border: 2px dashed var(--border-dark);
  border-radius: var(--radius-md);
  background: var(--bg-deep);
  color: var(--text-light);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}
.dropzone:hover { border-color: var(--accent); }
.dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
/* The native input fills the zone so a click anywhere opens the picker, but
   stays invisible - the styled label is the affordance. */
.dropzone__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.dropzone__icon { color: var(--accent); pointer-events: none; }
.dropzone__text { font-size: 0.98rem; pointer-events: none; }
.dropzone__text strong { color: var(--accent); }
.dropzone__hint { font-size: 0.82rem; color: var(--muted); pointer-events: none; }

/* ─── Form fields ─────────────────────────────────────────────────────── */

.field { margin-bottom: 1.25rem; }
.field:last-child { margin-bottom: 0; }

.field-row { display: flex; gap: 1rem; }
.field-row .field { flex: 1; min-width: 0; margin-bottom: 0; }
@media (max-width: 460px) {
  .field-row { flex-direction: column; gap: 1rem; }
}

label, .field__sublabel {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
}
.field__sublabel { margin-bottom: 0.4rem; }
.field__val {
  float: right;
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent);
}

select, input[type="number"], input[type="file"] {
  width: 100%;
  padding: 0.7rem 0.85rem;
  background: var(--bg-deep);
  color: var(--text-light);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}
select { cursor: pointer; }
select option { background: var(--bg-deep); color: var(--text-light); }

select:focus, input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Range slider - themed to the single accent. */
input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--border-dark);
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}
input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.field__hint {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

/* Checkbox-gated fields. */
.field--check { margin-bottom: 1.1rem; }
.check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  cursor: pointer;
  font-weight: 600;
}
.check input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  cursor: pointer;
}
.subfield {
  margin-top: 0.85rem;
  padding-left: 1.6rem;
}
.subfield[hidden] { display: none; }
/* Dimmed look when a section's toggle is off (inputs also get `disabled`). */
.is-disabled { opacity: 0.45; pointer-events: none; }

.inline-field {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.inline-field input[type="number"] { max-width: 140px; }
.inline-field__unit {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
}

.notice {
  margin: 1.5rem 0 0;
  padding: 0.85rem 1rem;
  background: var(--accent-soft);
  border: 1px solid rgba(25, 195, 125, 0.3);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: rgba(229, 231, 235, 0.92);
}
.notice strong { color: var(--accent); }

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.action-row #processBtn { flex: 1; }
@media (max-width: 380px) {
  .action-row { flex-direction: column; }
}

/* ─── Results ─────────────────────────────────────────────────────────── */

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.results-head .panel__title { margin: 0; }

.results-summary {
  margin: 0.85rem 0 0;
  padding: 0.7rem 0.9rem;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-light);
  font-family: var(--mono);
}
.results-summary[hidden] { display: none; }

/* Separated from the Compress/Clear row (and from the summary when shown). */
#downloadAllBtn { margin-top: 0.85rem; }

.empty-state {
  margin: 0;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
}

.shrink-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.shrink-list[hidden] { display: none; }

.shrink-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--bg-deep);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
}
.shrink-item.is-busy { border-color: rgba(25, 195, 125, 0.4); }
.shrink-item.is-error { border-color: rgba(255, 107, 107, 0.5); }

.shrink-item__thumb {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--surface-dark);
  border: 1px solid var(--border-dark);
}

.shrink-item__meta { flex: 1; min-width: 0; }
.shrink-item__name {
  margin: 0 0 0.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shrink-item__sizes {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.1rem;
  flex-wrap: wrap;
}
.shrink-item__out { color: var(--text-light); }
.shrink-item__delta {
  margin-left: 0.4rem;
  font-weight: 700;
  color: var(--accent);
}
.shrink-item__delta.is-larger { color: #ffa94d; }
.shrink-item__status {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}
.shrink-item.is-error .shrink-item__status { color: #ff8a8a; }

.shrink-item__actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
}
/* The download link only makes sense once a result exists; app.js also
   toggles it, this is the resting state and a safety net. */
.shrink-item:not(.is-done) .shrink-item__dl { display: none; }
.shrink-item__rm {
  padding: 0.45rem 0.7rem;
  line-height: 1;
}

@media (max-width: 460px) {
  .shrink-item { flex-wrap: wrap; }
  .shrink-item__actions { width: 100%; justify-content: flex-end; }
  .btn--sm { min-height: 44px; }
}
