/* ============================================================
   PDF to Image — export.css
   Step 3: render progress, download button states
   ============================================================ */


/* ══════════════════════════════════════════
   1. PROGRESS BAR (shown while pdf.js renders pages + zips them)
   ══════════════════════════════════════════ */
.ip-pdf2img-progress {
  margin: 4px 0 20px;
}

.ip-pdf2img-progress[hidden] {
  display: none;
}

.ip-pdf2img-progress__bar {
  width: 100%;
  height: 8px;
  border-radius: 9999px;
  background: var(--ip-line);
  overflow: hidden;
}

.ip-pdf2img-progress__fill {
  height: 100%;
  width: 0%;
  border-radius: 9999px;
  background: var(--ip-brand);
  transition: width 0.2s ease;
}

.ip-pdf2img-progress__label {
  margin: 8px 0 0;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ip-ink-soft);
}


/* ══════════════════════════════════════════
   2. DOWNLOAD BUTTON + DONE TICK
   The tick is a distinct circular badge that pops in *beside* the
   Download button once a build succeeds — the card always just
   reads as "these are your images" and the tick is what says "done".
   ══════════════════════════════════════════ */
.ip-pdf2img-downloadgroup {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ip-pdf2img-downloadgroup .ip-pdf2img-btn {
  flex: 1;
}

.ip-pdf2img-donetick {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  background: var(--ip-success);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(30,142,90,0.35);
  transform: scale(0);
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

.ip-pdf2img-donetick svg {
  width: 19px;
  height: 19px;
}

.ip-pdf2img-donetick.is-visible {
  transform: scale(1);
  opacity: 1;
}

.ip-pdf2img-btn--primary.is-busy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  pointer-events: none;
}

.ip-pdf2img-btn--primary.is-busy::before {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  animation: ipSpin 0.7s linear infinite;
  flex-shrink: 0;
}


/* ══════════════════════════════════════════
   3. INDIVIDUAL DOWNLOADS — collapsible list shown under the result
      card once conversion finishes, when there's more than one image.
      Lets someone grab a single page's PNG/JPG/WEBP without opening
      the zip, while the zip stays the one-tap default below it.
   ══════════════════════════════════════════ */
.ip-pdf2img-indiv {
  margin-top: 16px;
  border: 1.5px solid var(--ip-line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.ip-pdf2img-indiv[hidden] {
  display: none;
}

.ip-pdf2img-indiv__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ip-ink);
  cursor: pointer;
  text-align: left;
}

.ip-pdf2img-indiv__toggle svg:first-child {
  width: 17px;
  height: 17px;
  color: var(--ip-brand-dark);
  flex-shrink: 0;
}

.ip-pdf2img-indiv__toggle span {
  flex: 1;
}

.ip-pdf2img-indiv__chevron {
  width: 16px;
  height: 16px;
  color: var(--ip-ink-soft);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.ip-pdf2img-indiv__toggle[aria-expanded="true"] .ip-pdf2img-indiv__chevron {
  transform: rotate(180deg);
}

.ip-pdf2img-indiv__toggle:hover {
  background: var(--ip-bg);
}

.ip-pdf2img-indiv__list {
  max-height: 260px;
  overflow-y: auto;
  border-top: 1.5px solid var(--ip-line);
}

.ip-pdf2img-indiv__list[hidden] {
  display: none;
}

.ip-pdf2img-indiv__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
}

.ip-pdf2img-indiv__row:not(:last-child) {
  border-bottom: 1px solid var(--ip-line);
}

.ip-pdf2img-indiv__page {
  flex-shrink: 0;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 9999px;
  background: var(--ip-bg);
  color: var(--ip-ink-soft);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ip-pdf2img-indiv__info {
  flex: 1;
  min-width: 0;
}

.ip-pdf2img-indiv__name {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ip-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ip-pdf2img-indiv__size {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ip-ink-soft);
  margin-top: 1px;
}

.ip-pdf2img-indiv__dl {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--ip-line);
  background: var(--ip-bg);
  color: var(--ip-ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ip-pdf2img-indiv__dl svg {
  width: 16px;
  height: 16px;
}

.ip-pdf2img-indiv__dl:hover,
.ip-pdf2img-indiv__dl:focus-visible {
  background: var(--ip-brand-soft);
  border-color: var(--ip-brand-soft);
  color: var(--ip-brand-dark);
  outline: none;
}

.ip-pdf2img-indiv__dl:active {
  transform: scale(0.92);
}

.ip-pdf2img-indiv__dl.is-done {
  background: var(--ip-brand);
  border-color: var(--ip-brand);
  color: #fff;
}


/* ══════════════════════════════════════════
   4. "START OVER" LINK — quiet exit back to Step 1
   ══════════════════════════════════════════ */
.ip-pdf2img-startover {
  display: block;
  margin: 18px auto 0;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ip-ink-soft);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ip-pdf2img-startover:hover {
  color: var(--ip-brand-dark);
}
