/* ==========================================================================
   Zip tutorial animation ("How to Zip" modal)
   --------------------------------------------------------------------------
   Markup: views/partials/zipTutorial.ejs (loads this file and
   public/js/zip-tutorial.js).
   Shows a Windows 11-style File Explorer and an uploader: select five PDFs,
   Compress to ZIP file, name it, drag it to the drop zone, upload.
   Every class uses the "zt-" prefix. The stage is drawn at a fixed design
   size (900x470 side by side, or 420x820 stacked when .zt-narrow) and the
   script scales it to fit. Brand accents come from a .zt-brand-* class.
   ========================================================================== */

/* Tokens. --zt-accent fills buttons and bars; --zt-accent-strong is for
   accent text on white; --zt-ink is text on an accent fill. */
.zt {
  --zt-accent: #aad267;
  --zt-accent-strong: #4f7a1c;
  --zt-accent-soft: rgba(170, 210, 103, 0.28);
  --zt-ink: #163020;

  --zt-desk: #0b1d2e;
  --zt-desk-2: #12304a;
  --zt-grid: rgba(160, 200, 235, 0.08);
  --zt-win-bar: #f3f3f3;
  --zt-win-line: #e5e5e5;
  --zt-text: #1b1b1b;
  --zt-muted: #5c6370;
  --zt-select: #cce8ff;
  --zt-select-line: #99d1ff;
  --zt-win-blue: #0067c0;

  --zt-ui: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --zt-site: "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;
  --zt-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  color: var(--zt-text);
}

.zt-brand-bmbx {
  --zt-accent: #0075c1;
  --zt-accent-strong: #0075c1;
  --zt-accent-soft: rgba(0, 117, 193, 0.18);
  --zt-ink: #ffffff;
}

.zt-brand-gfbe {
  --zt-accent: rgb(125, 165, 159);
  --zt-accent-strong: #3f6f68;
  --zt-accent-soft: rgba(125, 165, 159, 0.28);
  --zt-ink: #10302b;
}

.zt-brand-mipe {
  --zt-accent: #8f1443;
  --zt-accent-strong: #8f1443;
  --zt-accent-soft: rgba(143, 20, 67, 0.16);
  --zt-ink: #ffffff;
}

/* ---------- Stage (fixed design size, scaled by the script) ---------- */

.zt-viewport {
  position: relative;
  width: 100%;
  height: 470px; /* replaced by the script: design height x scale */
  overflow: hidden;
  border-radius: 10px;
}

.zt-stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 900px;
  height: 470px;
  transform-origin: 0 0;
  background:
    linear-gradient(var(--zt-grid) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--zt-grid) 1px, transparent 1px) 0 0 / 24px 24px,
    radial-gradient(ellipse at 50% 35%, var(--zt-desk-2) 0%, var(--zt-desk) 75%);
  font-family: var(--zt-ui);
  font-size: 12px;
  line-height: 1.3;
  user-select: none;
  transition: opacity 0.35s ease;
}

.zt-narrow .zt-stage {
  width: 420px;
  height: 820px;
}

.zt-stage.is-fading {
  opacity: 0;
}

/* ---------- Windows ---------- */

.zt-win {
  position: absolute;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.zt-explorer {
  top: 20px;
  left: 20px;
  width: 420px;
  height: 430px;
}

.zt-browser {
  top: 20px;
  left: 460px;
  width: 420px;
  height: 430px;
}

.zt-narrow .zt-explorer {
  top: 14px;
  left: 14px;
  width: 392px;
  height: 352px;
}

.zt-narrow .zt-browser {
  top: 384px;
  left: 14px;
  width: 392px;
  height: 422px;
}

.zt-titlebar {
  display: flex;
  flex: 0 0 32px;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  background: var(--zt-win-bar);
}

.zt-title {
  flex: 1;
  min-width: 0;
}

.zt-winctl {
  display: flex;
  align-self: stretch;
}

.zt-winctl i {
  position: relative;
  width: 40px;
}

.zt-winctl i::before,
.zt-winctl i::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
}

.zt-min::before {
  width: 10px;
  border-top: 1px solid var(--zt-text);
  transform: translate(-50%, 0);
}

.zt-max::before {
  width: 9px;
  height: 9px;
  border: 1px solid var(--zt-text);
  border-radius: 2px;
  transform: translate(-50%, -50%);
}

.zt-close::before,
.zt-close::after {
  width: 12px;
  border-top: 1px solid var(--zt-text);
  transform: translate(-50%, 0) rotate(45deg);
}

.zt-close::after {
  transform: translate(-50%, 0) rotate(-45deg);
}

/* ---------- File Explorer ---------- */

.zt-addr {
  display: flex;
  flex: 0 0 36px;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border-bottom: 1px solid var(--zt-win-line);
  background: #f9f9f9;
}

.zt-arrows {
  color: var(--zt-muted);
  font-size: 15px;
}

.zt-crumbs {
  flex: 1;
  min-width: 0;
  padding: 4px 10px;
  overflow: hidden;
  border: 1px solid #e1e1e1;
  border-radius: 4px;
  background: #ffffff;
  white-space: nowrap;
}

.zt-xbody {
  display: flex;
  flex: 1;
  min-height: 0;
}

.zt-nav {
  flex: 0 0 96px;
  margin: 0;
  padding: 8px 6px;
  border-right: 1px solid #ececec;
  background: #fafafa;
  list-style: none;
}

.zt-nav li {
  padding: 5px 8px;
  border-radius: 4px;
}

.zt-nav .is-active {
  background: #e8e8e8;
}

.zt-narrow .zt-nav {
  display: none;
}

.zt-files {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
}

.zt-cols,
.zt-file {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
}

.zt-cols {
  height: 26px;
  border-bottom: 1px solid #ececec;
  color: var(--zt-muted);
}

.zt-cols span:first-child {
  grid-column: 1 / 3;
}

.zt-cols span:last-child,
.zt-file span:last-child {
  text-align: right;
}

.zt-list {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.zt-file {
  height: 28px;
  border: 1px solid transparent;
  border-radius: 4px;
  white-space: nowrap;
}

.zt-file > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.zt-file > span:nth-child(3) {
  color: var(--zt-muted);
}

.zt-file.is-selected {
  border-color: var(--zt-select-line);
  background: var(--zt-select);
}

.zt-zip {
  display: none;
}

.zt-zip.is-in {
  display: grid;
  animation: zt-pop 0.25s ease-out;
}

/* Rename box: Windows selects the base name of the new zip ("1") */
.zt-rename {
  padding: 1px 2px;
}

.zt-zip.is-editing .zt-rename {
  outline: 1px solid var(--zt-win-blue);
  background: #ffffff;
}

.zt-zip.is-editing .zt-sel {
  background: var(--zt-win-blue);
  color: #ffffff;
}

.zt-zip.is-editing .zt-typed::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 12px;
  margin-left: 1px;
  vertical-align: -2px;
  background: var(--zt-text);
}

/* ---------- Icons ---------- */

.zt-ico-pdf {
  position: relative;
  width: 12px;
  height: 15px;
  border: 1px solid #b9b9b9;
  border-radius: 2px;
  background: #ffffff;
}

.zt-ico-pdf::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: 2px;
  left: -1px;
  height: 5px;
  background: #d93025;
}

.zt-ico-folder,
.zt-ico-zip {
  position: relative;
  width: 16px;
  height: 12px;
  border-radius: 2px;
  background: #f4c542;
}

.zt-ico-folder::before,
.zt-ico-zip::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  width: 7px;
  height: 3px;
  border-radius: 2px 2px 0 0;
  background: #e2ae2a;
}

/* Zipper down the middle */
.zt-ico-zip::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 7px;
  width: 2px;
  background: repeating-linear-gradient(#6b5517 0 1px, transparent 1px 3px);
}

.zt-ico-small {
  transform: scale(0.85);
}

/* ---------- Browser + uploader ---------- */

.zt-tabbar {
  padding-left: 8px;
  background: #e8eaed;
}

.zt-tab {
  display: flex;
  flex: 1;
  min-width: 0;
  max-width: 220px;
  align-items: center;
  align-self: flex-end;
  gap: 8px;
  height: 26px;
  padding: 0 12px;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
  background: #ffffff;
  white-space: nowrap;
}

.zt-tab-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.zt-tab-dot {
  flex: 0 0 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--zt-accent);
}

.zt-page {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  color: #3c3c3c;
  font-family: var(--zt-site);
  font-size: 13px;
}

.zt-limit {
  margin: 0;
  color: var(--zt-muted);
  font-size: 12px;
}

.zt-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 2px dashed #c9d0d6;
  border-radius: 8px;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.zt-drop.is-over {
  border-color: var(--zt-accent);
  background: var(--zt-accent-soft);
  box-shadow: 0 0 0 4px var(--zt-accent-soft);
}

.zt-pick {
  padding: 5px 10px;
  border: 1px solid #c9d0d6;
  border-radius: 4px;
  background: #f6f7f8;
  font-size: 12px;
}

.zt-drag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

.zt-cloud {
  width: 34px;
  fill: none;
  stroke: var(--zt-muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.zt-qtitle {
  align-self: stretch;
  padding-top: 8px;
  border-top: 1px solid #eceff1;
  font-weight: 700;
}

.zt-queue {
  align-self: stretch;
  min-height: 34px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.zt-qitem {
  display: none;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid #e3e7ea;
  border-radius: 6px;
  background: #fafbfc;
}

.zt-qitem.is-in {
  display: grid;
  animation: zt-pop 0.3s ease-out;
}

.zt-sum {
  align-self: stretch;
  min-height: 16px;
  color: var(--zt-muted);
  font-size: 12px;
}

/* Disabled until a file is queued, like the live uploader */
.zt-upload {
  align-self: center;
  padding: 9px 18px;
  border-radius: 6px;
  background: #c8ced3;
  color: #ffffff;
  font-weight: 700;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.1s ease;
}

.zt-upload.is-ready {
  background: var(--zt-accent);
  color: var(--zt-ink);
}

.zt-upload.is-pressed {
  transform: scale(0.95);
}

.zt-upload.is-hidden {
  display: none;
}

.zt-progress {
  display: none;
  flex-direction: column;
  gap: 6px;
}

.zt-progress.is-in {
  display: flex;
}

.zt-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ebee;
}

.zt-bar i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--zt-accent);
}

.zt-progress-text {
  display: flex;
  justify-content: space-between;
  color: var(--zt-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.zt-done {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--zt-accent-strong);
  font-weight: 700;
}

.zt-done.is-in {
  display: flex;
  animation: zt-pop 0.3s ease-out;
}

.zt-check {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--zt-accent);
}

.zt-check::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 6px;
  width: 4px;
  height: 8px;
  border: solid var(--zt-ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---------- Right-click menu ---------- */

.zt-menu {
  position: absolute;
  z-index: 5;
  width: 220px;
  padding: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: #f9f9f9;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: scale(0.96);
  transform-origin: 0 0;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.zt-menu.is-open {
  opacity: 1;
  transform: none;
}

.zt-menu-icons {
  display: flex;
  justify-content: space-around;
  margin-bottom: 4px;
  padding: 2px 2px 8px;
  border-bottom: 1px solid #e6e6e6;
}

/* Line icons: cut, copy, rename, share, delete */
.zt-mi {
  width: 18px;
  height: 18px;
  background: #3b3b3b;
  -webkit-mask: var(--zt-icon) center / contain no-repeat;
  mask: var(--zt-icon) center / contain no-repeat;
}

.zt-mi-cut {
  --zt-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.4'%3E%3Ccircle cx='6' cy='15' r='2.5'/%3E%3Ccircle cx='14' cy='15' r='2.5'/%3E%3Cpath d='M7.5 13 14 3M12.5 13 6 3'/%3E%3C/svg%3E");
}

.zt-mi-copy {
  --zt-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.4'%3E%3Crect x='7' y='6' width='9' height='11' rx='1.5'/%3E%3Cpath d='M4 13V4.5A1.5 1.5 0 0 1 5.5 3H12'/%3E%3C/svg%3E");
}

.zt-mi-rename {
  --zt-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.4'%3E%3Crect x='2.5' y='6' width='15' height='8' rx='1.5'/%3E%3Cpath d='M10 3v14M8 3h4M8 17h4'/%3E%3C/svg%3E");
}

.zt-mi-share {
  --zt-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.4'%3E%3Cpath d='M12 4l5 4.5-5 4.5M17 8.5H9a5 5 0 0 0-5 5V16'/%3E%3C/svg%3E");
}

.zt-mi-delete {
  --zt-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.4'%3E%3Cpath d='M3.5 5h13M8 5V3h4v2M5 5l1 12h8l1-12'/%3E%3C/svg%3E");
}

.zt-mitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 34px;
  border-radius: 4px;
}

.zt-mitem-zip {
  padding-left: 10px;
}

.zt-mitem-zip .zt-ico-zip {
  margin: 0 4px 0 2px;
}

.zt-mitem.is-hover {
  background: rgba(0, 0, 0, 0.06);
}

.zt-msep {
  height: 1px;
  margin: 4px 2px;
  background: #e6e6e6;
}

/* ---------- Selection box, drag ghost, cursor ---------- */

.zt-marquee {
  position: absolute;
  z-index: 4;
  display: none;
  border: 1px solid #0078d4;
  background: rgba(0, 120, 212, 0.15);
}

.zt-marquee.is-on {
  display: block;
}

.zt-ghost {
  position: absolute;
  z-index: 6;
  top: 0;
  left: 0;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

.zt-ghost.is-on {
  display: flex;
}

.zt-copy {
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--zt-win-blue);
  color: #ffffff;
  font-size: 11px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.zt-ghost.is-over .zt-copy {
  opacity: 1;
}

.zt-cursor {
  position: absolute;
  z-index: 7;
  top: 0;
  left: 0;
  width: 18px;
  height: 26px;
  will-change: transform;
}

.zt-cursor svg {
  display: block;
  width: 18px;
  height: 26px;
  fill: #ffffff;
  stroke: #111111;
  stroke-width: 1.3;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

.zt-click {
  position: absolute;
  top: -9px;
  left: -9px;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  opacity: 0;
}

.zt-cursor.is-clicking .zt-click {
  animation: zt-click 0.4s ease-out;
}

@keyframes zt-click {
  from {
    opacity: 1;
    transform: scale(0.4);
  }
  to {
    opacity: 0;
    transform: scale(1.6);
  }
}

@keyframes zt-pop {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Site style guards ----------
   mtbid.css gives every <p> a 24px line height; the brand stylesheets have
   their own global rules. Text inside the tutorial keeps its own spacing. */
.zt p {
  line-height: 1.35;
}

/* ---------- Caption, pause button, steps ---------- */

.zt-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-top: 12px;
}

.zt-caption {
  flex: 1 1 260px;
  min-height: 1.4em;
  margin: 0;
  color: #222831;
  font-family: var(--zt-site);
  font-size: 15px;
  font-weight: 700;
}

.zt-caption b {
  margin-right: 6px;
  color: var(--zt-accent-strong);
  font-weight: 900;
}

.zt-caption small {
  display: block;
  color: var(--zt-muted);
  font-size: 12px;
  font-weight: 400;
}

.zt-toggle {
  padding: 6px 12px;
  border: 1px solid #c7ced6;
  border-radius: 999px;
  background: #ffffff;
  color: #3c3c3c;
  font-family: var(--zt-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.zt-toggle:hover {
  border-color: var(--zt-accent-strong);
  color: var(--zt-accent-strong);
}

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

/* The numbered steps are the text version of the animation: always read by
   screen readers, shown on screen only when the animation is still. */
.zt-steps {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.zt-note {
  display: block;
  color: var(--zt-muted);
  font-size: 0.85em;
}

/* ---------- Tips under the animation ---------- */
.zt-tips-title {
  margin: 18px 0 6px;
  color: #222831;
  font-size: 1.1rem;
}

.zt-tips {
  margin: 0;
  padding-left: 1.2em;
  list-style: disc;
  color: #3c3c3c;
}

/* Still mode: reduced motion. The stage shows the zip in the upload queue. */
.zt-static .zt-steps {
  position: static;
  width: auto;
  height: auto;
  margin: 14px 0 0;
  padding-left: 1.4em;
  overflow: visible;
  clip-path: none;
  white-space: normal;
  font-family: var(--zt-site);
  font-size: 15px;
  line-height: 1.5;
}

.zt-static .zt-footer,
.zt-static .zt-cursor {
  display: none;
}

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