/* ═══════════════════════════════════════
   ADD PAGE NUMBERS TO PDF — Page-specific styles
   Inherits header/footer/trust-pills from filecraftyhub.css
   ═══════════════════════════════════════ */

/* ── HERO ── */
.numbering-hero {
  background: linear-gradient(160deg, #1e40af 0%, #2563eb 55%, #3b82f6 100%);
  padding: 36px 0 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.numbering-hero::before {
  content: '';
  position: absolute;
  width: 340px; height: 340px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  top: -100px; right: -80px;
  pointer-events: none;
}

.tool-hero-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.tool-hero-icon { font-size: 2.8rem; line-height: 1; filter: drop-shadow(0 2px 8px rgba(0,0,0,.2)); }

.tool-hero-title {
  font-size: clamp(1.4rem, 4vw, 2.1rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -.5px;
  line-height: 1.1;
  text-align: left;
}

.tool-hero-sub {
  color: rgba(255,255,255,.8);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
  margin-top: 4px;
}

.numbering-hero .trust-pills { justify-content: center; }
.numbering-hero .trust-pills span {
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,.22);
}

/* ── WRAPPER ── */
.numbering-container { padding-top: 28px; padding-bottom: 48px; }

/* ── MAIN CARD ── */
.numbering-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,.08);
  padding: 28px 24px;
  border: 1.5px solid #e2e8f0;
  margin-bottom: 20px;
}

/* ── DROP ZONE ── */
.drop-zone {
  border: 2.5px dashed #94a3b8;
  border-radius: 16px;
  padding: 40px 20px 32px;
  text-align: center;
  background: #f8fafc;
  transition: border-color .25s, background .25s, transform .2s;
  cursor: pointer;
  margin-bottom: 24px;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: #2563eb;
  background: #eff6ff;
  transform: scale(1.01);
}

.drop-icon { font-size: 2.8rem; color: #2563eb; opacity: .7; margin-bottom: 10px; line-height: 1; }
.drop-zone h3 { font-size: 1.05rem; font-weight: 700; color: #1e293b; margin-bottom: 4px; }
.drop-zone p  { color: #64748b; font-size: 0.82rem; }

/* ── PDF INFO BAR ── */
.pdf-info-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f1f5f9;
  border-radius: 14px;
  padding: 14px 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.pdf-info-icon { font-size: 2rem; color: #ef4444; }
.pdf-info-details { flex: 1; }

.pdf-info-details strong {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
  display: block;
  word-break: break-word;
}

.page-badge {
  display: inline-block;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 30px;
  margin-top: 6px;
}

.icon-clear-btn {
  background: #fee2e2;
  color: #ef4444;
  border: none;
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all .2s;
}
.icon-clear-btn:hover { background: #ef4444; color: #fff; }

/* ── POSITION PREVIEW PANEL ── */
.position-preview-panel {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid #e2e8f0;
}

.position-preview-panel h4,
.global-style-panel h4,
.sections-header h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.position-preview-container {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.page-preview {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

.preview-page {
  width: 280px; height: 360px;
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.preview-content { position: relative; width: 100%; height: 100%; }

.preview-position {
  position: absolute;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
  background: #e2e8f0;
  color: #475569;
  transition: all .2s;
  cursor: pointer;
  z-index: 10;
  font-family: monospace;
}

.preview-position:hover { background: #2563eb; color: #fff; transform: scale(1.05); }
.preview-position.active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,.4);
}

.top-left    { top: 12px; left: 12px; }
.top-center  { top: 12px; left: 50%; transform: translateX(-50%); }
.top-right   { top: 12px; right: 12px; }
.bottom-left { bottom: 12px; left: 12px; }
.bottom-center { bottom: 12px; left: 50%; transform: translateX(-50%); }
.bottom-right  { bottom: 12px; right: 12px; }

.preview-center-text {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  transition: all .2s;
}

#livePreviewText { font-weight: 600; transition: all .2s; }

.preview-hint { font-size: 0.7rem; color: #64748b; text-align: center; margin-top: 12px; }

/* ── GLOBAL STYLE PANEL ── */
.global-style-panel {
  background: #f8fafc;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
}

.style-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.style-control label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.size-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.size-control input[type="range"] {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  background: #e2e8f0;
  border-radius: 2px;
  accent-color: #2563eb;
}

.size-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  background: #2563eb;
  border-radius: 50%;
  cursor: pointer;
}

.size-control span { min-width: 40px; font-size: 0.75rem; font-weight: 600; color: #2563eb; }

.color-control {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.color-control input[type="color"] {
  width: 50px; height: 36px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
}

.color-preview { width: 28px; height: 28px; border-radius: 6px; border: 1px solid #e2e8f0; }
#colorCode { font-size: 0.7rem; font-family: monospace; color: #64748b; }

/* ── SECTIONS PANEL ── */
.sections-panel {
  background: #f8fafc;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
}

.sections-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.sections-header h4 { margin: 0; }

.btn-add-section {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background .2s;
}
.btn-add-section:hover { background: #1d4ed8; }

.sections-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  max-height: 400px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.section-card {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  transition: all .2s;
}

.section-card:hover { border-color: #2563eb; box-shadow: 0 2px 8px rgba(37,99,235,.1); }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.section-title { font-weight: 700; font-size: 0.85rem; color: #1e293b; }

.section-actions { display: flex; gap: 6px; }

.section-actions button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  transition: all .2s;
  font-family: inherit;
}

.section-actions .delete-btn    { color: #ef4444; }
.section-actions .delete-btn:hover { background: #fee2e2; }
.section-actions .duplicate-btn { color: #2563eb; }
.section-actions .duplicate-btn:hover { background: #eff6ff; }

.section-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.section-field { display: flex; flex-direction: column; gap: 4px; }

.section-field label { font-size: 0.65rem; font-weight: 600; color: #64748b; }

.section-field input,
.section-field select {
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}

.section-field input:focus,
.section-field select:focus { border-color: #2563eb; }

.section-preview {
  margin-top: 8px;
  padding: 6px 10px;
  background: #f1f5f9;
  border-radius: 6px;
  font-size: 0.7rem;
  color: #2563eb;
  font-family: monospace;
  word-break: break-word;
}

.sections-info {
  font-size: 0.7rem;
  color: #64748b;
  padding: 10px;
  background: #eef2ff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── ACTION BUTTONS ── */
.action-buttons { text-align: center; margin-bottom: 20px; }

.btn-primary {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: background .2s, transform .15s;
}

.btn-primary:hover  { background: #1d4ed8; transform: translateY(-1px); }
.btn-primary:active { transform: scale(.98); }

/* ── STATUS ── */
.status {
  padding: 14px 18px;
  border-radius: 12px;
  margin: 14px 0;
  font-weight: 600;
  font-size: 0.88rem;
  text-align: center;
  display: none;
}

.status.success { background: #f0fdf4; color: #16a34a; border: 1px solid #86efac; }
.status.error   { background: #fef2f2; color: #ef4444; border: 1px solid #fecaca; }
.status.info    { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }

/* ── DOWNLOAD SECTION ── */
.download-section {
  display: none;
  margin-top: 20px;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 16px;
  padding: 20px;
  animation: fadeUp .3s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.download-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.download-icon  { font-size: 2rem; color: #16a34a; flex-shrink: 0; }
.download-label { font-weight: 800; font-size: 0.95rem; color: #14532d; }

.auto-download-text {
  font-size: 0.78rem;
  color: #16a34a;
  font-weight: 600;
  margin-top: 4px;
}

.download-btn {
  width: 100%;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .2s;
}

.download-btn:hover  { background: #15803d; }
.download-btn:active { transform: scale(.98); }

/* ── HOW IT WORKS ── */
.how-it-works {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  background: #fff;
  border-radius: 16px;
  border: 1.5px solid #e2e8f0;
  flex-wrap: wrap;
}

.how-step { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 80px; }

.step-num {
  width: 32px; height: 32px;
  background: #2563eb;
  color: #fff;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.how-step strong { font-size: 0.82rem; font-weight: 700; color: #1e293b; }
.how-step span   { font-size: 0.72rem; color: #64748b; }
.how-arrow       { color: #94a3b8; font-size: 0.85rem; }

/* ── NAV ── */
.nav-all { background: rgba(255,255,255,.2) !important; font-weight: 700 !important; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .numbering-card   { padding: 16px; }
  .preview-page     { width: 240px; height: 320px; }
  .preview-position { font-size: 9px; padding: 4px 7px; }
  .style-controls   { grid-template-columns: 1fr; }
  .section-content  { grid-template-columns: 1fr 1fr; }
  .sections-header  { flex-direction: column; align-items: stretch; }
  .btn-add-section  { justify-content: center; }
}

@media (max-width: 480px) {
  .tool-hero-inner  { flex-direction: column; text-align: center; }
  .tool-hero-title,
  .tool-hero-sub    { text-align: center; }
  .preview-page     { width: 200px; height: 280px; }
  .section-content  { grid-template-columns: 1fr; }
  .how-arrow        { display: none; }
  .how-it-works     { gap: 16px; }
  .download-inner   { flex-direction: column; text-align: center; }
}