/* ── Layout: nav bar (site-wide, fixed) → title → description → one big
   box → buttons → site footer below. Mirrors Deecliq Data Transfer's
   page recipe (views/tools/deecliq-transfer.php / its .css). ── */
.apn-fit.apn-scope {
  display: flex; flex-direction: column; gap: 14px;
  max-width: 1600px; margin: 0 auto;
  padding: 90px 4vw 60px;
}

.apn-hero { text-align: center; flex-shrink: 0; }
.apn-hero h1 {
  font-size: 1.5rem !important; font-weight: 800 !important;
  color: var(--brand, #10b981) !important;
  margin: 0 0 4px !important;
}
#apnScope .apn-hero p {
  font-size: .85rem !important; color: var(--txt-2, #64748b) !important;
  margin: 0 !important;
}

/* Card blends into the page background — only the dashed border below
   is the highlighted element, same idea as the transfer tool. */
#apnScope .apn-card {
  max-width: 100% !important; width: 100%;
  padding: 24px 32px !important;
  background: var(--page-bg, #f8fafc) !important;
  border: 1px solid var(--border, #e2e8f0) !important;
  box-shadow: none !important;
  margin: 0 auto !important;
}
.apn-upload-view { display: flex; flex-direction: column; }

.apn-upload-section { display: flex; min-height: 320px; }
.apn-scope .file-input-label {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center;
  padding: 26px 20px;
  border: 2px dashed var(--brand, #10b981);
  border-radius: 14px;
  cursor: pointer;
  text-align: center;
  color: var(--txt, #0f172a);
  background: transparent;
  transition: border-color .2s ease, background .2s ease;
  animation: apnBorderGlow 2.6s ease-in-out infinite;
}
.apn-scope .file-input-label:hover,
.apn-scope .file-input-label.apn-dragover {
  border-color: var(--brand-dark, #059669);
  background: rgba(16,185,129,.05);
}
@keyframes apnBorderGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
  50%      { box-shadow: 0 0 0 6px rgba(16,185,129,.08); }
}
.apn-scope .file-input-label i {
  color: var(--brand, #10b981);
  font-size: 2.2rem;
  animation: apnIconFloat 2.4s ease-in-out infinite;
}
@keyframes apnIconFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.apn-drop-title {
  font-weight: 700; margin-top: 10px; font-size: .95rem; color: var(--txt, #0f172a);
  animation: apnFadeUpFull .5s ease .1s both;
}
.apn-drop-sub {
  font-size: .8rem; opacity: .65; margin-top: 4px; color: var(--txt-2, #64748b);
  animation: apnFadeUpSub .5s ease .22s both;
}
@keyframes apnFadeUpFull {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes apnFadeUpSub {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: .65; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .apn-scope .file-input-label,
  .apn-scope .file-input-label i,
  .apn-drop-title, .apn-drop-sub { animation: none; }
}

.apn-file-row {
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--page-bg, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
}
.apn-file-row i.fa-file-pdf { font-size: 1.4rem; color: var(--brand, #10b981); }
.apn-file-name { font-weight: 700; font-size: .88rem; color: var(--txt, #0f172a); word-break: break-all; }
.apn-file-size { font-size: .76rem; color: var(--txt-2, #64748b); }
.apn-remove {
  background: none; border: none; cursor: pointer;
  color: var(--txt-2, #64748b); font-size: 1rem;
  padding: 6px;
}
.apn-remove:hover { color: var(--brand, #10b981); }

.apn-error {
  margin-top: 12px; padding: 10px 14px;
  border-radius: 10px;
  background: var(--page-bg, #f8fafc);
  border: 1px dashed var(--brand, #10b981);
  color: var(--txt, #0f172a); font-size: .85rem;
}

/* ── Processing: same big animated ring + counter as the transfer tool ── */
.apn-processing { padding: 30px 0; text-align: center; }
.apn-ring-wrap {
  position: relative;
  width: 140px; height: 140px;
  margin: 0 auto 18px;
}
.apn-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.apn-ring-track { fill: none; stroke: var(--border, #e2e8f0); stroke-width: 8; }
.apn-ring-fill {
  fill: none; stroke: var(--brand, #10b981); stroke-width: 8;
  stroke-linecap: round;
  transition: stroke .2s ease;
  filter: drop-shadow(0 0 6px rgba(16,185,129,.45));
}
.apn-ring-center {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--txt, #0f172a);
}
.apn-ring-count { font-size: 2.1rem; line-height: 1; }
.apn-ring-percent { font-size: 1.1rem; opacity: .7; margin-left: 2px; }
.apn-progress-text { font-size: .85rem; font-weight: 600; color: var(--txt, #0f172a); }
.apn-progress-meta { font-size: .76rem; margin-top: 4px; color: var(--txt-2, #64748b); }

.apn-result-icon { text-align: center; font-size: 2.6rem; color: #16a34a; margin-bottom: 6px; }
.apn-autosave {
  text-align: center; font-size: .8rem; color: var(--txt-2, #64748b);
  margin-top: 14px;
}
.apn-autosave strong { color: var(--brand, #10b981); }

/* _shared-polish.css's .controls rule never reaches this page (it only
   matches elements whose class attribute ends EXACTLY in "-scope", which
   "apn-scope apn-fit" doesn't) — so define it directly here instead of
   relying on that. */
#apnScope .controls {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  width: 100%;
}

/* ── Page Number Settings modal — opens right after a PDF is selected ── */
.apn-modal {
  position: fixed; inset: 0; z-index: 100001;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.apn-modal.apn-modal-open { display: flex; }
.apn-modal-backdrop {
  position: absolute; inset: 0; background: rgba(15,23,42,.6);
  animation: apnFadeIn .15s ease;
}
.apn-modal-box {
  position: relative; z-index: 1;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  padding: 28px 30px;
  border-radius: 18px;
  max-width: 640px; width: 100%;
  max-height: 86vh; overflow-y: auto;
  animation: apnPopIn .2s ease;
  box-shadow: 0 30px 60px rgba(0,0,0,.3);
}
.apn-modal-box h3 {
  display: flex; align-items: center; gap: 8px;
  color: var(--txt, #0f172a); margin: 0 0 4px; padding-right: 36px;
}
.apn-modal-box h3 i { color: var(--brand, #10b981); }
.apn-modal-file { font-size: .82rem; color: var(--txt-2, #64748b); margin: 0 0 18px; }
.apn-modal-x {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--page-bg, #f8fafc); color: var(--txt-2, #64748b); border: 1px solid var(--border, #e2e8f0);
  font-size: 1.1rem; line-height: 1; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.apn-modal-x:hover { background: var(--brand, #10b981); color: #fff; border-color: var(--brand, #10b981); }
@keyframes apnFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes apnPopIn {
  from { opacity: 0; transform: scale(.92) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .apn-modal-backdrop, .apn-modal-box { animation: none; }
}

.apn-settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.apn-hint { font-size: .8rem; color: var(--txt-2, #64748b); margin-top: 6px; }
.hidden { display: none !important; }

@media (max-width: 768px) {
  .apn-settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) and (min-width: 769px) {
  .apn-settings-grid { grid-template-columns: repeat(2, 1fr); }
}
