/* Reveo Diktofon — «Yuklash», the drag-and-drop page.
 *
 * app.css holds the shell and the shared primitives (.btn, .page-head, .empty)
 * and must load first; every colour, face, radius and shadow below is a custom
 * property from reveo-tokens.css, reached through it. NOTHING here defines a
 * colour of its own — a product-local hex is how two Reveo products drift
 * apart until somebody moving between call.reveo.uz and diktofon.reveo.uz
 * thinks they changed vendor.
 *
 * The @import is a safety net, exactly as in app.css: index.html links the
 * token sheet first so it is fetched in parallel, and the import means this
 * file still resolves if that link is ever dropped or if this page is opened
 * before the shell has been taught to link it. */

@import url('/reveo-tokens.css');

.up-lede {
  max-width: 68ch;
  margin: 0 0 18px;
  color: var(--ink-2);
}

.up-link {
  margin-left: auto;
  color: var(--brand-ink);
  font-weight: 600;
  text-decoration: none;
}
.up-link:hover {
  text-decoration: underline;
}

/* ── The drop zone ───────────────────────────────────────────────────────── */

.up-drop {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 40px 24px;
  text-align: center;
  background: var(--surface);
  /* Dashed, and it is the one dashed border in the product: this is the only
   * element on any page that is asking to have something dropped ON it, and
   * the shape says so before the sentence inside it is read. */
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  transition:
    border-color 0.18s var(--ease),
    background 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
}

.up-drop.is-over {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: var(--shadow);
}

.up-drop-art {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: var(--pill);
  background: var(--brand-soft-2);
  border: 1px solid var(--brand-soft);
}
.up-drop-dot {
  width: 16px;
  height: 26px;
  border-radius: var(--pill);
  background: var(--brand);
}
.up-drop.is-over .up-drop-art {
  background: var(--surface);
  border-color: var(--brand);
}

.up-drop-title {
  margin: 0;
  font-family: var(--font-d);
  font-size: var(--t-h2);
  font-weight: 600;
  color: var(--ink);
}

.up-drop-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.up-or {
  color: var(--ink-3);
  font-size: var(--t-small);
}

/* The file inputs sit INSIDE their labels, clipped rather than hidden.
 * `display: none` takes them out of the tab order, and the keyboard route to
 * this page's only two controls is then no route at all. */
.up-input {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* `:focus-within` rather than `:has()`: the ring has to appear in every
 * browser that can tab to the input, not only the ones with `:has()`. */
.up-pick:focus-within {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.up-drop-hint {
  margin: 0;
  max-width: 58ch;
  color: var(--ink-3);
  font-size: var(--t-small);
}

/* ── Notices ─────────────────────────────────────────────────────────────── */

.up-notice {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: var(--t-small);
}
.up-notice-bad {
  background: var(--red-soft);
  border-color: var(--red-soft);
  color: var(--red-ink);
  font-size: var(--t-body);
}

/* ── The queue ───────────────────────────────────────────────────────────── */

.up-queue {
  margin-top: 22px;
}

.up-summary {
  margin: 0 0 8px;
  min-height: 1.2em;
  font-size: var(--t-eyebrow);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.up-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  /* `clip`, not `hidden`: hidden would make this a scroll container, which is
   * the bug pages.css already paid for on the recordings list. */
  overflow: clip;
}
.up-list:empty {
  display: none;
}

.up-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 12px;
  align-items: center;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
}
.up-row:first-child {
  border-top: 0;
}

.up-row-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.up-name {
  /* A filename is an identifier read left to right, not a magnitude compared
   * down a column — the one place this product uses the mono face. */
  font-family: var(--font-m);
  font-size: var(--t-small);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.up-meta {
  color: var(--ink-3);
  font-size: var(--t-small);
  font-variant-numeric: tabular-nums;
}

.up-row-state {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    'status action'
    'bar    action';
  align-items: center;
  gap: 4px 10px;
}

.up-status {
  grid-area: status;
  font-size: var(--t-small);
  font-weight: 600;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.up-bar {
  grid-area: bar;
  display: block;
  height: 6px;
  border-radius: var(--pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: clip;
}

.up-bar-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: var(--pill);
  background: var(--brand);
  transition: width 0.2s var(--ease);
}

.up-row-action {
  grid-area: action;
}

/* State is carried on the row, so the status text and its bar can never
 * disagree about what happened to the file. */
.up-row[data-status='stored'] .up-status {
  color: var(--brand-ink);
}
.up-row[data-status='duplicate'] .up-status {
  /* Already here is a SUCCESS — re-dropping a folder is the normal case — but
   * a quieter one than a file that just crossed the wire. */
  color: var(--ink-3);
}
.up-row[data-status='duplicate'] .up-bar-fill {
  background: var(--ink-4);
}
.up-row[data-status='failed'] .up-status {
  color: var(--red-ink);
}
.up-row[data-status='failed'] .up-bar {
  border-color: var(--red-soft);
  background: var(--red-soft);
}
.up-row[data-status='hashing'] .up-bar-fill {
  background: var(--ink-4);
}
.up-row[data-status='queued'] .up-status {
  color: var(--ink-3);
}

@media (max-width: 720px) {
  .up-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .up-drop {
    padding: 28px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .up-drop,
  .up-bar-fill {
    transition: none;
  }
}
