/* Importing Google Fonts - Albert Sans */
@import url("https://fonts.googleapis.com/css2?family=Albert+Sans:wght@400;500;600;700;800&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Albert Sans", sans-serif;
}

:root {
  --bg: #eef2f9;
  --card: #ffffff;
  --text: #121a2c;
  --muted: #64708a;
  --faint: #9aa4b8;
  --border: #dfe5f0;
  --accent: #2563eb;
  --accent-soft: #eaf1ff;
  --good: #16a34a;
  --bad: #dc2626;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(37, 99, 235, 0.1), transparent 40%),
    var(--bg);
  color: var(--text);
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[hidden] {
  display: none !important;
}

kbd {
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--card);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
}

.page {
  display: grid;
  place-items: start center;
  min-height: 100vh;
  padding: 60px 16px;
}

.uploader {
  width: 100%;
  max-width: 640px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: var(--card);
  box-shadow: 0 30px 70px -40px rgba(18, 26, 44, 0.4);
}

.up-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.up-head h1 {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.up-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* Toggle switch */
.switch {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.track {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #cfd6e4;
  transition: background 0.25s;
}

.track i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s var(--ease);
}

.switch input:checked + .track {
  background: var(--accent);
}

.switch input:checked + .track i {
  transform: translateX(18px);
}

.switch input:focus-visible + .track {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

/* ---------- Drop zone ---------- */
.dropzone {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 36px 20px;
  border: 2px dashed #c4cfe3;
  border-radius: 20px;
  background: #f8faff;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, transform 0.25s var(--ease);
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.dropzone.is-over {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.015);
}

.dz-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 6px;
  border-radius: 22px;
  background: var(--card);
  color: var(--accent);
  box-shadow: 0 10px 24px -14px rgba(37, 99, 235, 0.6);
}

.dz-icon svg {
  width: 46px;
  height: 36px;
  stroke-width: 2.6;
}

.dz-icon .arrow {
  animation: lift 1.8s var(--ease) infinite;
}

.is-over .dz-icon .arrow {
  animation-duration: 0.7s;
}

@keyframes lift {
  50% {
    transform: translateY(-4px);
  }
}

.dz-title {
  font-size: 1.02rem;
}

.dz-title .link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dz-hint {
  color: var(--faint);
  font-size: 0.84rem;
}

.samples {
  display: block;
  margin: 12px auto 0;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.samples:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------- Overall progress ---------- */
.overall {
  margin-top: 20px;
}

.ov-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
}

.ov-actions {
  display: flex;
  gap: 6px;
}

.ov-actions button {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

#start-all {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.ov-bar {
  height: 6px;
  margin-top: 8px;
  border-radius: 6px;
  background: #e9eef7;
  overflow: hidden;
}

.ov-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #60a5fa);
  transition: width 0.3s;
}

/* ---------- File list ---------- */
.files {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  list-style: none;
}

.file {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 12px 12px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  animation: slideIn 0.35s var(--ease);
  transition: border-color 0.3s, background 0.3s;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.file.is-removing {
  animation: slideOut 0.3s var(--ease) forwards;
}

@keyframes slideOut {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

.file.error {
  border-color: #fecaca;
  background: #fff7f7;
}

.file.done {
  border-color: #c9ebd5;
}

.thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--c, #e9eef7);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  overflow: hidden;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb .ok {
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 2px solid var(--card);
  border-radius: 50%;
  background: var(--good);
  animation: pop 0.35s var(--ease);
}

.thumb .ok svg {
  width: 11px;
  height: 11px;
  stroke-width: 3.5;
}

@keyframes pop {
  from {
    transform: scale(0);
  }
}

.info {
  min-width: 0;
}

.name {
  display: flex;
  font-size: 0.93rem;
  font-weight: 600;
}

/* Long names are cut in the middle so the extension stays visible */
.name .start {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.name .end {
  flex-shrink: 0;
  white-space: nowrap;
}

.status {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.error .status {
  color: var(--bad);
}

.done .status {
  color: var(--good);
}

.bar {
  height: 5px;
  margin-top: 8px;
  border-radius: 5px;
  background: #e9eef7;
  overflow: hidden;
}

.bar i {
  display: block;
  width: var(--p, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.25s linear;
}

.paused .bar i {
  background: #f59e0b;
}

.done .bar,
.error .bar,
.queued .bar {
  display: none;
}

.actions {
  display: flex;
  gap: 4px;
}

.act {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.act:hover {
  background: #eef2f9;
  color: var(--text);
}

.act.retry:hover {
  color: var(--accent);
}

.act.remove:hover {
  color: var(--bad);
}

.act svg {
  width: 17px;
  height: 17px;
}

.dropzone:focus-visible,
.act:focus-visible,
.samples:focus-visible,
.ov-actions button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

/* ---------- Full-window drag overlay ---------- */
.drag-overlay {
  position: fixed;
  inset: 12px;
  z-index: 50;
  display: grid;
  place-items: center;
  border: 3px dashed var(--accent);
  border-radius: 28px;
  background: rgba(234, 241, 255, 0.92);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  pointer-events: none;
}

.drag-overlay.is-on {
  opacity: 1;
  visibility: visible;
}

.drag-overlay div {
  display: grid;
  justify-items: center;
  gap: 6px;
  color: var(--accent);
}

.drag-overlay span {
  font-size: 3.4rem;
  animation: bounce 0.8s var(--ease) infinite alternate;
}

@keyframes bounce {
  to {
    transform: translateY(-12px);
  }
}

.drag-overlay b {
  font-size: 1.6rem;
}

.drag-overlay small {
  color: var(--muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .page {
    padding: 20px 10px;
  }

  .uploader {
    padding: 20px 16px;
    border-radius: 20px;
  }

  .up-head {
    flex-direction: column;
  }

  .file {
    grid-template-columns: 40px 1fr auto;
    gap: 10px;
  }

  .thumb {
    width: 40px;
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
