@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #09090f;
  --surface: #12121d;
  --surface-hover: #19192a;
  --border: #29283c;
  --purple: #a78bfa;
  --violet: #8b5cf6;
  --text: #f5f3ff;
  --muted: #a09db5;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  background:
    radial-gradient(ellipse at 50% 0%, #29124a 0%, transparent 43%), var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.navbar {
  max-width: 1180px;
  margin: auto;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -1px;
}

.logo > span:last-child {
  color: var(--purple);
  margin-left: -9px;
}

.logo-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  color: white;
  box-shadow: 0 0 24px #8b5cf655;
}

.navbar nav {
  display: flex;
  gap: 30px;
  color: var(--muted);
  font-size: 13px;
}

.navbar nav a:hover {
  color: white;
}

.nav-button {
  padding: 11px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  transition: border-color 0.2s;
}

.nav-button:hover {
  border-color: var(--purple);
}

.hero {
  text-align: center;
  max-width: 850px;
  margin: 76px auto 100px;
  padding: 0 24px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border: 1px solid #8b5cf644;
  background: #8b5cf611;
  border-radius: 30px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.3px;
  color: #d8c8ff;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: #a78bfa;
  border-radius: 50%;
  box-shadow: 0 0 12px #a78bfa;
}

.hero h1 {
  margin-top: 28px;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.1;
  letter-spacing: -3px;
  font-weight: 800;
}

.hero h1 span {
  background: linear-gradient(90deg, #c4b5fd, #8b5cf6, #e879f9);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.hero-description {
  max-width: 550px;
  margin: 22px auto 32px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.upload-zone {
  padding: 38px 20px;
  border: 1px dashed #6d4db2;
  border-radius: 20px;
  background: linear-gradient(145deg, #171326cc, #10101aee);
  transition:
    border-color 0.2s,
    background 0.2s;
}

.upload-zone.dragging {
  border-color: #c4b5fd;
  background: #8b5cf622;
}

.upload-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border: 1px solid #8b5cf666;
  background: #8b5cf622;
  border-radius: 15px;
  color: #c4b5fd;
  font-size: 30px;
}

.upload-zone h2 {
  font-size: 19px;
  margin-bottom: 10px;
}

.upload-zone > p {
  color: var(--muted);
  font-size: 12px;
}

.primary-button {
  display: inline-block;
  margin: 22px 0 16px;
  padding: 14px 22px;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  border-radius: 10px;
  color: white;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 25px #7c3aed33;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px #7c3aed66;
}

.upload-zone .upload-note {
  font-size: 10px;
}

.file-list {
  margin-top: 14px;
  text-align: left;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 9px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.file-symbol {
  color: #c4b5fd;
  font-weight: 800;
}

.file-info {
  min-width: 0;
  flex: 1;
}

.file-info strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.file-info small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.file-remove {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: #e9d5ff;
  cursor: pointer;
}

.file-remove:hover {
  border-color: #a78bfa;
}

.privacy-note {
  margin-top: 24px;
  color: var(--muted);
  font-size: 11px;
}

.privacy-note span {
  color: var(--purple);
}

.tools-section,
.how-section {
  max-width: 1180px;
  margin: 0 auto 100px;
  padding: 0 24px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--purple);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
}

.section-heading h2,
.how-section h2 {
  font-size: clamp(25px, 4vw, 36px);
  letter-spacing: -1px;
}

.tool-count {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.tool-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(145deg, #151521, #101018);
  transition:
    transform 0.2s,
    border-color 0.2s;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: #7954bc;
}

.tool-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  margin-bottom: 22px;
  font-size: 24px;
}

.purple {
  background: #8b5cf622;
  color: #c4b5fd;
}
.pink {
  background: #ec489922;
  color: #f9a8d4;
}
.blue {
  background: #3b82f622;
  color: #93c5fd;
}
.green {
  background: #10b98122;
  color: #6ee7b7;
}

.tool-tag {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 1px;
}

.tool-card h3 {
  margin: 10px 0;
  font-size: 16px;
}

.tool-card p {
  min-height: 60px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.tool-action {
  display: inline-block;
  margin-top: 18px;
  color: #c4b5fd;
  font-size: 11px;
  font-weight: 700;
}

.how-section {
  padding-top: 50px;
  text-align: center;
  border-top: 1px solid var(--border);
}

.how-section > p:last-child {
  margin-top: 15px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px max(24px, calc((100% - 1132px) / 2));
  border-top: 1px solid var(--border);
}

footer .logo {
  font-size: 18px;
}

footer .logo-icon {
  width: 29px;
  height: 29px;
  font-size: 15px;
}

footer p {
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 850px) {
  .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    margin-top: 55px;
  }
}

@media (max-width: 560px) {
  .navbar {
    padding: 18px;
  }

  .navbar nav {
    display: none;
  }

  .nav-button {
    padding: 10px;
    font-size: 10px;
  }

  .hero {
    padding: 0 18px;
    margin: 45px auto 75px;
  }

  .hero h1 {
    letter-spacing: -2px;
  }

  .upload-zone {
    padding: 30px 14px;
  }

  .tools-section,
  .how-section {
    padding: 0 18px;
  }

  .tool-card {
    padding: 16px;
  }

  .tool-card p {
    min-height: 80px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  footer {
    align-items: start;
    flex-direction: column;
  }
}

.merge-controls {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  text-align: center;
}

.merge-controls[hidden] {
  display: none;
}

.merge-controls p {
  color: var(--muted);
  font-size: 12px;
}

.merge-controls .primary-button {
  border: none;
  font-family: inherit;
}

#mergeMessage {
  margin-top: 12px;
  line-height: 1.6;
}

#mergeMessage:empty {
  display: none;
}

.merge-controls .primary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.file-remove {
  min-width: 34px;
  font-size: 14px;
  transition:
    background 0.2s,
    border-color 0.2s;
}

.file-remove:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.file-remove:not(:disabled):hover {
  background: #8b5cf622;
}

.split-controls {
  margin-top: 20px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
}

.split-controls[hidden] {
  display: none;
}

.split-controls h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

.split-controls p {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.split-controls label {
  display: block;
  margin-bottom: 9px;
  font-size: 12px;
  color: var(--text);
}

.split-controls input {
  width: 100%;
  padding: 13px;
  margin-bottom: 5px;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: none;
  background: #09090f;
  color: white;
  font-family: inherit;
}

.split-controls input:focus {
  border-color: var(--purple);
}

.split-controls .primary-button {
  border: none;
  font-family: inherit;
}

#splitMessage {
  margin-top: 12px;
}

.split-controls .primary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ===== SELECTOR VISUAL DE PAGINAS ===== */

.page-selection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 25px 0 20px;
}

.page-selection-header h3 {
  color: var(--text);
  font-size: 19px;
}

#pageTotal {
  color: var(--muted);
  font-size: 11px;
}

/* Cuadricula de paginas */

.page-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 25px;
}

/* Tarjetas individuales */

.page-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;

  background: #242424;
  border: 2px solid #414141;
  border-radius: 17px;

  color: #aaaaaa;
  cursor: pointer;

  transition: all 0.2s ease;
}

.page-card:hover {
  transform: translateY(-3px);
  border-color: #9560f5;
}

/* Icono del documento */

.page-card .page-icon {
  width: 30px;
  height: 30px;
  color: #aaaaaa;
}

/* Numero de pagina */

.page-card .page-number {
  font-size: 25px;
  font-weight: 700;
  color: #ffffff;
}

/* Pagina seleccionada */

.page-card.selected {
  background: #211535;
  border-color: #9560f5;
  color: #b58aff;
  box-shadow: 0 0 12px #9560f522;
}

.page-card.selected .page-icon {
  color: #b58aff;
}

.page-card.selected::after {
  content: "✓";
  position: absolute;
  top: 7px;
  right: 9px;
  color: #b58aff;
  font-size: 12px;
  font-weight: 800;
}

/* Resumen de seleccion */

.page-selection-summary {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin: 25px 0;
  color: var(--muted);
  font-size: 15px;
}

.page-selection-summary span {
  color: #b58aff;
  font-size: 27px;
}

.page-selection-summary strong {
  font-weight: 500;
}

/* Boton seleccionar todas */

.secondary-button {
  padding: 11px 17px;
  margin-bottom: 15px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #191526;
  color: #c4b5fd;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: 0.2s;
}

.secondary-button:hover {
  border-color: #9560f5;
  background: #25183b;
}

/* Adaptacion a celulares */

@media (max-width: 560px) {
  .page-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
  }

  .page-card {
    border-radius: 12px;
  }

  .page-card .page-number {
    font-size: 21px;
  }

  .page-selection-summary {
    font-size: 12px;
  }
}

/* Miniaturas reales de documentos PDF */

.page-card {
  aspect-ratio: auto;
  padding: 9px;
  gap: 9px;
  min-width: 0;
}

.page-preview {
  display: block;
  width: 100%;
  height: auto;
  background: white;
  border-radius: 5px;
}

.page-card .page-number {
  padding: 4px;
  font-size: 20px;
}

.page-card.selected .page-preview {
  outline: 2px solid #9560f5;
}

@media (max-width: 560px) {
  .page-card {
    padding: 6px;
  }

  .page-card .page-number {
    font-size: 17px;
  }
}

/* ===== DIVISION AUTOMATICA ===== */

.auto-split-controls {
  margin-top: 22px;
  padding: 22px;
  background: linear-gradient(145deg, #171326, #101018);
  border: 1px solid var(--border);
  border-radius: 17px;
}

.auto-split-controls[hidden] {
  display: none;
}

.auto-split-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.auto-split-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #8b5cf622;
  color: #c4b5fd;
  font-size: 25px;
}

.auto-split-heading h3 {
  font-size: 17px;
  margin-bottom: 5px;
}

.auto-split-heading p {
  color: var(--muted);
  font-size: 11px;
}

.auto-split-controls label {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
}

.interval-input {
  display: flex;
  align-items: center;
  gap: 12px;
}

.interval-input input {
  width: 100px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #09090f;
  color: white;
  font-family: inherit;
  font-size: 16px;
  outline: none;
}

.interval-input input:focus {
  border-color: var(--purple);
}

.interval-input span {
  color: var(--muted);
  font-size: 12px;
}

.auto-split-info {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 20px 0;
  padding: 13px;
  border-radius: 10px;
  background: #8b5cf611;
}

.auto-split-info span {
  color: #c4b5fd;
}

.auto-split-info p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.auto-split-controls .primary-button {
  width: 100%;
  border: none;
  font-family: inherit;
}

#autoSplitMessage {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.auto-split-controls .primary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ===== COMPRESION PDF ===== */

.compress-controls {
  margin-top: 22px;
  padding: 22px;
  background: linear-gradient(145deg, #171326, #101018);
  border: 1px solid var(--border);
  border-radius: 17px;
}

.compress-controls[hidden] {
  display: none;
}

.compress-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.compress-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #8b5cf622;
  color: #c4b5fd;
  font-size: 28px;
}

.compress-heading h3 {
  font-size: 17px;
  margin-bottom: 5px;
}

.compress-heading p {
  color: var(--muted);
  font-size: 11px;
}

.compress-controls label {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
}

.compress-controls select {
  width: 100%;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #09090f;
  color: white;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

.compress-controls select:focus {
  border-color: var(--purple);
}

.compress-info {
  display: flex;
  gap: 10px;
  margin: 20px 0;
  padding: 13px;
  border-radius: 10px;
  background: #8b5cf611;
}

.compress-info span {
  color: #c4b5fd;
}

.compress-info p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.compress-controls .primary-button {
  width: 100%;
  border: none;
  font-family: inherit;
}

#compressMessage {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.compress-controls .primary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.compress-controls .primary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#compressMessage {
  overflow-wrap: anywhere;
}

/* ===== COMPARADOR DE COMPRESION ===== */

.compression-results {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #100d1b;
}

.compression-results[hidden] {
  display: none;
}

.compression-results h4 {
  margin-bottom: 18px;
  font-size: 14px;
}

.size-comparison {
  display: grid;
  gap: 18px;
}

.size-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  font-size: 12px;
}

.size-item span {
  color: var(--muted);
}

.size-track {
  grid-column: 1 / -1;
  height: 9px;
  overflow: hidden;
  border-radius: 20px;
  background: #292435;
}

.size-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  transition: width 0.5s ease;
}

.original-bar {
  background: #8b5cf6;
}

.compressed-bar {
  background: #06b6d4;
}

.compression-saving {
  margin-top: 20px;
  font-size: 25px;
  font-weight: 800;
  color: #a78bfa;
}

.compression-saving.increased {
  color: #f59e0b;
}

#compressionStatus {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}

/* Estados del comparador */

.compression-saving.increased {
  color: #f59e0b;
}

#compressionStatus {
  overflow-wrap: anywhere;
}

#compressMessage {
  overflow-wrap: anywhere;
}

/* ===== IMAGENES A PDF ===== */

.image-pdf-controls {
  margin-top: 22px;
  padding: 22px;
  background: linear-gradient(145deg, #171326, #101018);
  border: 1px solid var(--border);
  border-radius: 17px;
}

.image-pdf-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.image-pdf-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #8b5cf622;
  font-size: 23px;
}

.image-pdf-heading h3 {
  font-size: 17px;
  margin-bottom: 5px;
}

.image-pdf-heading p {
  color: var(--muted);
  font-size: 11px;
}

.image-upload-area {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 9px;
  border: 2px dashed #8b5cf655;
  border-radius: 13px;
  background: #8b5cf609;
  cursor: pointer;
  transition: 0.2s;
}

.image-upload-area:hover {
  border-color: #a78bfa;
  background: #8b5cf615;
}

.upload-icon {
  color: #c4b5fd;
  font-size: 32px;
}

.image-upload-area strong {
  font-size: 13px;
}

.image-upload-area > span:last-child {
  color: var(--muted);
  font-size: 11px;
}

.image-pdf-counter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  margin-bottom: 12px;
  font-size: 12px;
}

#clearImagesButton {
  background: transparent;
  border: none;
  color: #c4b5fd;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.image-preview-card {
  position: relative;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #09090f;
}

.image-preview-card img {
  width: 100%;
  height: 115px;
  object-fit: contain;
  border-radius: 6px;
  background: #171326;
}

.image-preview-card span {
  display: block;
  overflow: hidden;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-preview-card button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: #7f1d1d;
  color: white;
  cursor: pointer;
}

.image-pdf-controls > label:not(.image-upload-area) {
  display: block;
  margin: 18px 0 9px;
  font-size: 12px;
  font-weight: 600;
}

#imagePdfName {
  width: 100%;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #09090f;
  color: white;
  font-family: inherit;
  outline: none;
}

#imagePdfName:focus {
  border-color: var(--purple);
}

.image-pdf-controls .primary-button {
  width: 100%;
  margin-top: 18px;
  border: none;
  font-family: inherit;
}

.image-pdf-controls .primary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#imagePdfMessage {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

/* ===== PDFLAB 2.0 - NAVEGACION ===== */

.workspace-screen {
  max-width: 950px;
  margin: 55px auto 100px;
  padding: 0 24px;
}

.workspace-screen[hidden] {
  display: none;
}

.workspace-header {
  margin-bottom: 35px;
  text-align: center;
}

.back-button {
  display: block;
  margin-bottom: 30px;
  padding: 11px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--purple);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

.back-button:hover {
  border-color: var(--purple);
}

.workspace-header h1 {
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 800;
  letter-spacing: -1.5px;
}

.workspace-header p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

#workspaceContent {
  width: 100%;
}

/* PDFLAB 2.0 - Ocultar elementos inactivos */

[hidden] {
  display: none !important;
}

/* ===== PDFLAB 2.0 - CENTRAR ZONA DE CARGA ===== */

.workspace-screen .upload-zone {
  width: 100%;
  text-align: center;
}

.workspace-screen .upload-zone h2,
.workspace-screen .upload-zone p {
  text-align: center;
}

.workspace-screen .upload-zone .primary-button {
  display: inline-block;
  text-align: center;
}

.workspace-screen .upload-zone .upload-icon {
  margin-left: auto;
  margin-right: auto;
}

/* ===== PDFLAB 2.0 - CENTRAR DIVIDIR PDF ===== */

.workspace-screen .split-controls {
  width: 100%;
  text-align: center;
}

.workspace-screen .split-controls .page-selection-header {
  justify-content: center;
  text-align: center;
}

.workspace-screen .split-controls .page-selection-summary {
  justify-content: center;
  text-align: center;
}

.workspace-screen .split-controls .secondary-button,
.workspace-screen .split-controls .primary-button {
  display: inline-block;
  vertical-align: middle;
}

.workspace-screen #splitMessage {
  margin-top: 18px;
  text-align: center;
  line-height: 1.7;
}

/* ===== PDFLAB 2.0 - CENTRAR COMPRESION ===== */

.workspace-screen .compress-controls {
  width: 100%;
  text-align: center;
}

.workspace-screen .compress-heading {
  justify-content: center;
}

.workspace-screen .compress-info {
  justify-content: center;
  text-align: left;
}

.workspace-screen .compress-controls label {
  text-align: center;
}

.workspace-screen .compress-controls select {
  max-width: 480px;
  display: block;
  margin: 0 auto;
}

.workspace-screen .compression-results {
  text-align: left;
}

.workspace-screen #compressMessage {
  text-align: center;
}

/* ===== PDFLAB 2.0 - GALERÍA DE IMÁGENES ===== */

.workspace-screen .image-pdf-controls {
  width: 100%;
}

.workspace-screen .image-pdf-heading {
  justify-content: center;
}

.workspace-screen .image-upload-area {
  text-align: center;
}

.workspace-screen .image-preview-grid {
  margin-top: 20px;
}

.workspace-screen .image-preview-card {
  transition:
    transform 0.2s,
    border-color 0.2s;
}

.workspace-screen .image-preview-card:hover {
  transform: translateY(-3px);
  border-color: var(--purple);
}

.workspace-screen .image-pdf-controls > label:not(.image-upload-area) {
  text-align: center;
}

.workspace-screen #imagePdfName {
  display: block;
  max-width: 480px;
  margin: 0 auto;
}

.workspace-screen #imagePdfMessage {
  text-align: center;
}

/* ===== PDFLAB - ORDENAR IMÁGENES ===== */

.image-order-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.image-order-controls button {
  position: static;
  width: 34px;
  height: 30px;
  border: 1px solid #8b5cf655;
  border-radius: 8px;
  background: #241936;
  color: #c4b5fd;
  font-size: 17px;
  cursor: pointer;
  transition: 0.2s;
}

.image-order-controls button:hover:not(:disabled) {
  background: #7c3aed;
  color: white;
}

.image-order-controls button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ===== PDFLAB - OPCIONES IMAGENES A PDF ===== */

.image-pdf-options {
  margin: 24px 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #100d1b;
}

.image-pdf-options h4 {
  margin-bottom: 20px;
  text-align: center;
  font-size: 15px;
}

.image-option-group {
  margin-bottom: 16px;
}

.image-option-group:last-child {
  margin-bottom: 0;
}

.image-option-group label {
  display: block;
  margin-bottom: 8px;
  color: #c4b5fd;
  font-size: 12px;
  font-weight: 600;
}

.image-option-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #171326;
  color: white;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  outline: none;
}

.image-option-group select:focus {
  border-color: #8b5cf6;
}

/* ===== PDFLAB - ARRASTRAR IMÁGENES ===== */

.image-upload-area.dragging {
  border-color: #c4b5fd;
  background: #8b5cf62a;
  box-shadow: 0 0 25px #8b5cf622;
  transform: scale(1.01);
}

.image-upload-area.dragging .upload-icon {
  transform: translateY(-5px);
}

.image-upload-area .upload-icon {
  transition: transform 0.2s ease;
}

/* ===== PDFLAB - DUPLICAR IMÁGENES ===== */

.image-preview-card {
  position: relative;
}

.image-duplicate-button {
  position: absolute;
  top: 8px;
  left: 8px;
  right: auto;
  width: 30px;
  height: 30px;
  border: 1px solid #a78bfa;
  border-radius: 8px;
  background: #241936;
  color: #e9d5ff;
  font-size: 21px;
  cursor: pointer;
  z-index: 2;
  transition: 0.2s;
}

.image-duplicate-button:hover {
  background: #7c3aed;
  color: white;
  transform: scale(1.08);
}

/* ===== PDFLAB - ROTACIÓN DE IMÁGENES ===== */

.image-rotation-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.image-rotation-controls button {
  position: static;
  width: 38px;
  height: 32px;
  border: 1px solid #8b5cf655;
  border-radius: 8px;
  background: #241936;
  color: #c4b5fd;
  font-size: 22px;
  cursor: pointer;
  transition: 0.2s;
}

.image-rotation-controls button:hover {
  background: #7c3aed;
  color: white;
}

.image-preview-card img {
  object-fit: contain;
  transition: transform 0.2s ease;
}

/* ===== PDFLAB - MINIATURAS GIRADAS ===== */

.image-preview-container {
  width: 100%;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 10px;
  background: #171326;
}

.image-preview-container img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}

/* Reducir la imagen al girar 90 o 270 grados */
.image-preview-container img.image-rotated-sideways {
  transform-origin: center;
  scale: 0.75;
}

/* ===== PDFLAB - PROGRESO DE IMÁGENES ===== */

.image-pdf-progress {
  margin-top: 18px;
  margin-bottom: 12px;
}

.image-progress-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: #c4b5fd;
  font-size: 13px;
}

.image-progress-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #302544;
}

.image-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7c3aed, #c4b5fd);
  transition: width 0.2s ease;
}

/* ===== PDFLAB - VISTA PREVIA DEL PDF ===== */

.image-pdf-preview {
  margin-top: 28px;
  padding: 22px;
  border: 1px solid #8b5cf644;
  border-radius: 16px;
  background: #100d1b;
}

.image-pdf-preview h3 {
  color: #e9d5ff;
  text-align: center;
  margin-bottom: 8px;
}

.preview-description {
  text-align: center;
  color: #a99cbd;
  font-size: 13px;
  margin-bottom: 20px;
}

.pdf-preview-viewer {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 250px;
  padding: 18px;
  border-radius: 12px;
  background: #20192c;
  overflow: auto;
}

#imagePdfPreviewCanvas {
  display: block;
  max-width: 100%;
  height: auto;
  background: white;
  box-shadow: 0 6px 24px #0006;
}

.pdf-preview-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.pdf-preview-navigation button {
  padding: 10px 14px;
  border: 1px solid #8b5cf666;
  border-radius: 9px;
  background: #241936;
  color: #e9d5ff;
  cursor: pointer;
}

.pdf-preview-navigation button:hover:not(:disabled) {
  background: #7c3aed;
}

.pdf-preview-navigation button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#previewPageCounter {
  color: #c4b5fd;
  font-size: 13px;
  text-align: center;
}

@media (max-width: 480px) {
  .pdf-preview-navigation {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ===== NEON PIXEL 2.0 ===== */
:root {
  --bg: #080711;
  --surface: #141020;
  --surface-hover: #20172f;
  --border: #3a2b50;
  --purple: #c5a5ff;
  --violet: #8b5cf6;
  --muted: #b3a8c8;
}
body {
  background:
    radial-gradient(ellipse at 50% -10%, #43216c66, transparent 53%),
    radial-gradient(ellipse at 100% 50%, #25113b55, transparent 45%), #080711;
}
.navbar {
  position: relative;
  z-index: 2;
}
.nav-button {
  background: #a78bfa18;
  border-color: #a78bfa55;
}
.hero {
  position: relative;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -30px 15% auto;
  height: 260px;
  background: #9f55ff12;
  filter: blur(85px);
  pointer-events: none;
  z-index: -1;
}
.hero h1 {
  letter-spacing: -0.055em;
}
.hero-description {
  font-size: 16px;
}
.status {
  box-shadow: 0 0 24px #8b5cf622;
}
.trust-strip {
  max-width: 1120px;
  margin: -30px auto 90px;
  padding: 20px 24px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px 35px;
  border: 1px solid #8b5cf62e;
  border-radius: 18px;
  background: #160f23a8;
  color: #d0b8fa;
  font-size: 12px;
  font-weight: 600;
}
.tool-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border-color: #6e4b8e55;
  background: linear-gradient(155deg, #20162d, #110d1b 75%);
  box-shadow: 0 10px 28px #0002;
}
.tool-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, #b580ff88, transparent);
  opacity: 0;
  transition: opacity 0.2s;
}
.tool-card:hover::before {
  opacity: 1;
}
.tool-card:hover {
  border-color: #b47aff;
  box-shadow: 0 18px 42px #6e30b722;
}
.tool-action {
  font-size: 12px;
}
.primary-button {
  border: 0;
  font-family: inherit;
  background: linear-gradient(120deg, #a36aff, #753be1 60%, #ae52e5);
  box-shadow: 0 6px 22px #7c3aed45;
}
.primary-button:focus-visible,
.tool-card:focus-visible,
.back-button:focus-visible {
  outline: 2px solid #e4c9ff;
  outline-offset: 4px;
}
.workspace-screen {
  max-width: 980px;
}
.workspace-header h1 {
  background: linear-gradient(100deg, #fff, #c5a5ff);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}
.merge-controls,
.split-controls,
.auto-split-controls,
.compress-controls,
.image-pdf-controls {
  border-color: #76519d55;
  background: linear-gradient(150deg, #1c142a, #100d19);
  box-shadow: 0 15px 45px #0003;
}
.upload-zone {
  border-color: #9b65d788;
  background: linear-gradient(135deg, #23153699, #110d1dcc);
}
.file-item {
  border-color: #68428b66;
}
.process-progress {
  margin: 18px auto 8px;
  max-width: 680px;
  padding: 18px;
  border: 1px solid #a56bf766;
  border-radius: 16px;
  background: linear-gradient(130deg, #241535, #140f22);
  box-shadow: 0 0 24px #8b5cf61c;
  text-align: left;
}
.process-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  color: #e4d2ff;
  font-size: 13px;
  font-weight: 600;
}
.process-progress-percent {
  color: #d5b3ff;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.process-progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 30px;
  background: #352443;
}
.process-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7540eb, #b86bff, #ed82ed);
  box-shadow: 0 0 15px #b86bff99;
  transition: width 0.22s ease;
}
.process-progress-detail {
  margin-top: 10px !important;
  color: #afa0c8 !important;
  font-size: 11px !important;
  overflow-wrap: anywhere;
}
.process-progress.completed {
  border-color: #7dd3b766;
}
.process-progress.completed .process-progress-fill {
  background: linear-gradient(90deg, #7c3aed, #38d9b2);
}
.image-progress-bar {
  background: linear-gradient(90deg, #7540eb, #b86bff, #ed82ed);
}
.image-pdf-progress {
  padding: 16px;
  border: 1px solid #a56bf755;
  border-radius: 14px;
  background: #1b112b;
}
.page-card {
  background: #1b1428;
  border-color: #63457b;
}
.page-card.selected {
  border-color: #c194ff;
}
@media (max-width: 560px) {
  .trust-strip {
    margin: -20px 18px 60px;
    justify-content: flex-start;
    gap: 12px 20px;
  }
  .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .tool-card {
    padding: 16px;
  }
  .tool-card p {
    min-height: 95px;
  }
  .file-item {
    flex-wrap: wrap;
  }
  .file-info {
    flex-basis: calc(100% - 65px);
  }
  .process-progress {
    padding: 14px;
  }
  .workspace-screen {
    padding: 0 16px;
  }
  .page-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =====================================
   BOTÓN DE DONACIONES - PDFLab
===================================== */

.donate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 11px 20px;
  border-radius: 12px;

  background: linear-gradient(135deg, #8b5cf6, #c026d3);
  color: #ffffff;

  font-weight: 700;
  text-decoration: none;

  border: 1px solid rgba(255, 255, 255, 0.2);

  box-shadow: 0 0 15px rgba(139, 92, 246, 0.35);

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    filter 0.25s ease;
}

.donate-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 25px rgba(192, 38, 211, 0.65);
  filter: brightness(1.12);
}

.donate-btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 4px;
}

@media (max-width: 768px) {
  .donate-btn {
    padding: 10px 14px;
    font-size: 13px;
  }
}

/* =====================================
   PDFLab - Ventana de donaciones
===================================== */

.donation-modal[hidden] {
  display: none !important;
}

.donation-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 5, 15, 0.78);
  backdrop-filter: blur(8px);
}

.donation-modal-content {
  position: relative;
  width: 100%;
  max-width: 430px;
  padding: 36px 28px;
  border-radius: 22px;
  border: 1px solid rgba(168, 85, 247, 0.45);
  background: linear-gradient(145deg, #1c1630, #10101e);
  box-shadow: 0 0 45px rgba(139, 92, 246, 0.25);
  text-align: center;
  color: #ffffff;
}

.donation-close {
  position: absolute;
  top: 14px;
  right: 18px;
  border: none;
  background: transparent;
  color: #c4b5d9;
  font-size: 30px;
  cursor: pointer;
}

.donation-heart {
  font-size: 48px;
  margin-bottom: 14px;
}

.donation-modal-content h2 {
  font-size: 25px;
  margin-bottom: 14px;
  color: #ffffff;
}

.donation-modal-content p {
  color: #c4b5d9;
  line-height: 1.7;
  margin-bottom: 25px;
}

.donation-support-btn {
  display: block;
  padding: 14px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #8b5cf6, #c026d3);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.35);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.donation-support-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 28px rgba(192, 38, 211, 0.6);
}

.donation-skip {
  display: block;
  margin: 20px auto 0;
  border: none;
  background: transparent;
  color: #b9a9d3;
  font-size: 13px;
  cursor: pointer;
}

.donation-skip:hover {
  color: #ffffff;
  text-decoration: underline;
}

.donation-close:focus-visible,
.donation-support-btn:focus-visible,
.donation-skip:focus-visible {
  outline: 2px solid #d8b4fe;
  outline-offset: 4px;
}

@media (max-width: 480px) {
  .donation-modal-content {
    padding: 32px 20px;
  }

  .donation-modal-content h2 {
    font-size: 21px;
  }
}
