/* ============================================================
   Icon Tool
   ============================================================ */

/* ----- Design tokens: one place to change the look ----- */
:root {
  --color-bg: #f5f4f8; /* page background */
  --color-surface: #ffffff; /* cards and sections */
  --color-text: #1a1a24; /* main text */
  --color-muted: #6b6b78; /* secondary text */
  --color-primary: #6d4aff; /* brand purple */
  --color-danger: #d64545; /* danger / clear button */
  --color-border: #dcdce4; /* borders */
  --radius: 10px; /* corner rounding */
  --spacing: 1rem; /* base spacing unit */
}

/* ----- Global reset ----- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}

/* ----- Main container ----- */
.tool {
  max-width: 640px;
  margin: 2rem auto;
  padding: 0 var(--spacing);
}

/* ----- Header ----- */
.tool__header h1 {
  margin: 0 0 0.25rem;
}
.tool__header p {
  margin: 0;
  color: var(--color-muted);
}

/* ----- Drop zone ----- */
.tool__dropzone {
  margin-top: 1.5rem;
  padding: 2.5rem 1rem;
  text-align: center;
  background: var(--color-surface);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
}

/* Highlight when dragging a file over the zone */
.tool__dropzone.is-dragover {
  border-color: var(--color-primary);
  background: #f3efff;
}

.tool__dropzone p {
  margin: 0.25rem 0;
}
.tool__hint {
  font-size: 0.85rem;
  color: var(--color-muted);
}

/* ----- Status messages ----- */
.tool__status {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: #fdeaea;
  color: var(--color-danger);
  font-weight: 600;
}

/* ----- Preview ----- */
.tool__preview {
  margin-top: 1.5rem;
  padding: var(--spacing);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.tool__preview h2 {
  margin-top: 0;
  font-size: 1.1rem;
}
.tool__preview img {
  display: block;
  max-width: 160px;
  max-height: 160px;
  image-rendering: pixelated; /* shows true pixels, no smoothing */
}

/* ----- Downloads list ----- */
.tool__downloads {
  margin-top: 1.5rem;
  padding: var(--spacing);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.tool__downloads h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.tool__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tool__list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.tool__list li:last-child {
  border-bottom: none;
}

/* ----- Buttons ----- */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}

.btn:hover {
  opacity: 0.9;
}

.btn--danger {
  background: var(--color-danger);
}

/* ----- Danger zone ----- */
.tool__danger {
  margin-top: 1.5rem;
  padding: var(--spacing);
  text-align: center;
}

/* ----- Small screens ----- */
@media (max-width: 480px) {
  .tool {
    margin-top: 1rem;
  }
  .tool__list li {
    flex-direction: column;
    align-items: flex-start;
  }
}
