/* ===========================================================================
   Dizayn: müasir, təmiz, mobil-öncü.
   Yumşaq kölgələr, yumru künclər, bir vurğu rəngi, yumşaq keçidlər.
   QR daima ağ fonludur (skanner üçün vacibdir).
   =========================================================================== */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #0d0f14;
  --muted: #6b7280;
  --line: #e6e8ec;
  --accent: #4f46e5;
  --accent-soft: #eef0ff;
  --danger: #dc2626;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --shadow-hover: 0 2px 4px rgba(16, 24, 40, .06), 0 16px 40px rgba(16, 24, 40, .10);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* çox zəif, çox sakit fon işığı */
  background-image: radial-gradient(1200px 400px at 50% -200px, #ffffff 0%, rgba(255,255,255,0) 70%);
}

::selection { background: var(--accent); color: #fff; }

/* ---------------- düymələr ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 16px;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease, color .16s ease;
}

.btn:hover:not(:disabled) {
  border-color: #d3d6dd;
  background: #fafbfc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 24, 40, .07);
}

.btn:active:not(:disabled) { transform: translateY(0); box-shadow: none; }

.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-primary {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
  font-weight: 600;
  padding: 12px 22px;
  font-size: 14px;
}
.btn-primary:hover:not(:disabled) { background: #22262e; border-color: #22262e; color: #fff; }

.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-sm { padding: 8px 12px; font-size: 12.5px; border-radius: 9px; }

.btn-accent { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }
.btn-accent:hover:not(:disabled) { background: #e3e6ff; border-color: transparent; color: var(--accent); }

/* ---------------- səhifə ---------------- */
.page {
  flex: 1;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 48px 20px 72px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.title {
  margin: 0;
  text-align: center;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.subtitle {
  margin: -12px 0 0;
  text-align: center;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}

/* ---------------- yükləmə bloku ---------------- */
.drop {
  width: 100%;
  border: 1.5px dashed #cdd2db;
  border-radius: var(--radius);
  background: var(--surface);
  padding: 44px 24px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.drop:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.01); }

.drop-icon { font-size: 26px; line-height: 1; margin-bottom: 12px; opacity: .8; }
.drop-main { margin: 0 0 6px; font-size: 15.5px; font-weight: 500; }
.drop-hint { margin: 0; font-size: 13px; color: var(--muted); }
.drop-formats { margin: 14px 0 0; font-size: 11.5px; color: #9aa1ad; }

/* ---------------- önizləmə ---------------- */
.card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.preview-media {
  width: 100%;
  max-height: 220px;
  border-radius: 10px;
  object-fit: contain;
  background: #f0f1f4;
  display: block;
}

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.row .name { font-weight: 500; word-break: break-all; min-width: 0; }
.row .size { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------------- progress ---------------- */
.progress { display: flex; flex-direction: column; gap: 8px; }
.track { height: 5px; border-radius: 99px; background: #eceef2; overflow: hidden; }
.fill { height: 100%; width: 0; border-radius: 99px; background: var(--text); transition: width .2s ease; }
.fill.done { background: #10b981; }
.pct { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------- xəta ---------------- */
.error {
  width: 100%;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: var(--danger);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
  font-weight: 400;
  white-space: pre-line;
}

/* ---------------- nəticə ---------------- */
.result {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 22px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.qr { width: 200px; max-width: 100%; border-radius: 12px; padding: 10px; background: #fff; border: 1px solid var(--line); }
.qr img { width: 100%; height: auto; display: block; border-radius: 4px; }

.result-title { font-size: 15px; font-weight: 600; margin: 0; }

.link {
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
  line-height: 1.6;
  margin: 0;
  text-decoration: none;
  border-bottom: 1px dashed #d3d6dd;
  padding-bottom: 1px;
  transition: color .16s ease;
}
.link:hover { color: var(--accent); border-bottom-color: var(--accent); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

.note { font-size: 12px; color: #10b981; font-weight: 500; min-height: 15px; margin: 0; }

.sep { width: 100%; height: 1px; background: var(--line); border: 0; margin: 2px 0; }

.token-box { width: 100%; display: flex; flex-direction: column; gap: 9px; align-items: center; }
.token-label { font-size: 11.5px; color: var(--muted); }
.token {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 10.5px;
  word-break: break-all;
  line-height: 1.7;
  color: #9aa1ad;
  margin: 0;
  max-width: 100%;
}

@media (max-width: 480px) {
  .page { padding: 34px 16px 48px; gap: 18px; }
  .title { font-size: 22px; }
  .drop { padding: 34px 18px; }
  .qr { width: 176px; }
  .result { padding: 20px 16px 16px; }
}

/* ===========================================================================
   BAXIŞ SƏHİFƏSİ — tam ekran, qara fon
   =========================================================================== */

body.viewer { background: #000; color: #fff; overflow: hidden; }
body.viewer::selection, body.viewer ::selection { background: rgba(255,255,255,.25); }

.stage { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: #000; }

.stage video, .stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}

.play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 68px; height: 68px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.5);
  background: rgba(255,255,255,.10);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 0 0 0 4px;
  cursor: pointer;
  font-family: var(--font);
  transition: background .18s ease, transform .18s ease, border-color .18s ease;
}
.play:hover { background: #fff; color: #000; border-color: #fff; transform: translate(-50%, -50%) scale(1.06); }
.play[hidden] { display: none; }

.bar {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; gap: 8px;
  padding: calc(12px + env(safe-area-inset-top)) 12px 12px;
  z-index: 10; pointer-events: none;
}

.bar .icon {
  pointer-events: auto;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(0,0,0,.32);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; text-decoration: none; padding: 0;
  font-family: var(--font);
  transition: background .16s ease, color .16s ease;
}
.bar .icon:hover { background: #fff; color: #000; }

.msg {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 28px; text-align: center;
  font-size: 16px; font-weight: 500; color: #fff;
}
.msg .sub { color: #8a8f98; font-size: 13.5px; font-weight: 400; line-height: 1.7; max-width: 360px; }
.msg[hidden] { display: none; }
