/* ── Layout: nav bar → title → description → one big box → buttons →
   footer. Same recipe as Deecliq Data Transfer (the project default). ── */
.afd-fit.afd-scope {
  display: flex; flex-direction: column; gap: 14px;
  max-width: 1600px; margin: 0 auto;
  padding: 90px 4vw 60px;
}

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

#afdScope .afd-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;
}
.afd-input-view { display: flex; flex-direction: column; }

.afd-input-section { display: flex; }
.afd-dropzone {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 24px 20px;
  border: 2px dashed var(--brand, #4f46e5);
  border-radius: 14px;
  cursor: text;
  text-align: center;
  color: var(--txt, #0f172a);
  background: transparent;
  transition: border-color .2s ease, background .2s ease;
}
.afd-dropzone:hover,
.afd-dropzone.afd-focused {
  border-color: var(--brand-dark, #4338ca);
  background: rgba(79,70,229,.05);
}
.afd-dropzone i {
  color: var(--brand, #4f46e5);
  font-size: 1.8rem;
}
.afd-drop-title { font-weight: 700; margin-top: 8px; margin-bottom: 14px; font-size: .92rem; color: var(--txt, #0f172a); }

#afdScope #afdUrlInput {
  width: 100%; min-height: 220px;
  font-family: 'Consolas', 'Monaco', monospace; font-size: 13px;
  resize: vertical;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: var(--page-bg, #f8fafc);
  color: var(--txt, #0f172a);
  padding: 14px;
}

.afd-count-row {
  text-align: center; font-size: .8rem; color: var(--txt-2, #64748b);
  margin-top: 10px;
}

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

#afdScope .controls {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  width: 100%;
}

#afdScope #afdDownloadBtn {
  background: linear-gradient(135deg, var(--brand, #4f46e5), var(--brand-dark, #4338ca));
  border: none;
  padding: 13px 26px;
  font-weight: 700;
  font-size: .95rem;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(79,70,229,.35);
  transition: transform .15s ease, box-shadow .15s ease;
}
#afdScope #afdDownloadBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(79,70,229,.45);
}
#afdScope #afdDownloadBtn:active { transform: translateY(0); }

/* ── Processing: same big animated ring + counter used across the
   project's tools (Deecliq Data Transfer, Add Page Numbers to PDF). ── */
.afd-processing { padding: 30px 0; text-align: center; }
.afd-ring-wrap {
  position: relative;
  width: 140px; height: 140px;
  margin: 0 auto 18px;
}
.afd-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.afd-ring-track { fill: none; stroke: var(--border, #e2e8f0); stroke-width: 8; }
.afd-ring-fill {
  fill: none; stroke: var(--brand, #4f46e5); stroke-width: 8;
  stroke-linecap: round;
  transition: stroke .2s ease;
  filter: drop-shadow(0 0 6px rgba(79,70,229,.45));
}
.afd-ring-center {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--txt, #0f172a);
}
.afd-ring-count { font-size: 2.1rem; line-height: 1; }
.afd-ring-percent { font-size: 1.1rem; opacity: .7; margin-left: 2px; }
.afd-progress-text { font-size: .85rem; font-weight: 600; color: var(--txt, #0f172a); }
.afd-progress-meta { font-size: .76rem; margin-top: 4px; color: var(--txt-2, #64748b); word-break: break-all; }

.afd-result-icon { text-align: center; font-size: 2.6rem; color: #16a34a; margin-bottom: 6px; }

.afd-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin: 18px 0 6px; max-width: 600px; margin-left: auto; margin-right: auto; }
.afd-stat-card {
  background: var(--page-bg, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  color: var(--txt, #0f172a);
  padding: 18px 14px; border-radius: 14px; text-align: center;
}
.afd-stat-card.afd-stat-good { border-color: #16a34a; }
.afd-stat-card.afd-stat-good .afd-stat-number { color: #16a34a; }
.afd-stat-card.afd-stat-bad { border-color: #dc2626; }
.afd-stat-card.afd-stat-bad .afd-stat-number { color: #dc2626; }
.afd-stat-number { font-size: 1.8rem; font-weight: 800; margin-bottom: 4px; }
.afd-stat-label { font-size: .82rem; color: var(--txt-2, #64748b); }

.afd-howto-card {
  background: var(--page-bg, #f8fafc) !important;
  border: 1px solid var(--border, #e2e8f0) !important;
  border-radius: 14px !important;
  padding: 20px 22px !important;
  margin-top: 10px !important;
}
.afd-howto { color: var(--txt-2, #64748b); line-height: 1.8; padding-left: 20px; font-size: .88rem; margin-bottom: 14px; }
.afd-note { font-size: .82rem; color: var(--txt-2, #64748b); display: flex; align-items: flex-start; gap: 8px; margin: 0; }

.afd-shake { animation: afdShake .4s ease; }
@keyframes afdShake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(7px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(3px); }
}

@media (prefers-reduced-motion: reduce) {
  .afd-ring-fill { transition: none; }
  .afd-shake { animation: none; }
}

/* ── Centered message popup — used instead of the corner toast for this
   tool, so messages never land behind/under the chatbot bubble. ── */
.afd-popup {
  position: fixed; inset: 0; z-index: 100002;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.afd-popup.afd-popup-open { display: flex; }
.afd-popup-backdrop {
  position: absolute; inset: 0; background: rgba(15,23,42,.6);
  animation: afdPopupFadeIn .15s ease;
}
.afd-popup-box {
  position: relative; z-index: 1;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  padding: 28px 30px;
  border-radius: 18px;
  max-width: 420px; width: 100%;
  text-align: center;
  animation: afdPopupPopIn .2s ease;
  box-shadow: 0 30px 60px rgba(0,0,0,.3);
  white-space: pre-line;
}
.afd-popup-icon { font-size: 2.2rem; margin-bottom: 10px; }
.afd-popup-box.afd-popup-info .afd-popup-icon    { color: var(--brand, #4f46e5); }
.afd-popup-box.afd-popup-success .afd-popup-icon { color: #16a34a; }
.afd-popup-box.afd-popup-warning .afd-popup-icon { color: #d97706; }
.afd-popup-box.afd-popup-error .afd-popup-icon    { color: #dc2626; }
.afd-popup-msg { color: var(--txt, #0f172a); font-size: .92rem; line-height: 1.6; margin-bottom: 18px; text-align: left; }
.afd-popup-ok { padding: 9px 28px !important; }
@keyframes afdPopupFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes afdPopupPopIn {
  from { opacity: 0; transform: scale(.9) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .afd-popup-backdrop, .afd-popup-box { animation: none; }
}
