/* =========================================
   CONVERTIDOR DE DOCUMENTOS — scope .docs-app
   ========================================= */

.docs-app {
  color: var(--texto, #fff);
  font-family: 'Poppins', system-ui, sans-serif;
}

.docs-app .docs-header {
  text-align: center;
  margin-bottom: 26px;
}

.docs-app .docs-title {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #2D7DFF 0%, #5BA0F5 20%, #A8CBF5 45%, #E8F0FB 70%, #FFFFFF 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.docs-app .docs-sub {
  color: var(--muted, #A8B4C7);
  font-size: 1.05rem;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Tabs */
.docs-app .docs-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  background: rgba(10, 21, 38, .5);
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  justify-content: center;
}

.docs-app .docs-tab {
  flex: 1;
  min-width: 140px;
  padding: 14px 16px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted, #A8B4C7);
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: .2s;
  white-space: nowrap;
}

.docs-app .docs-tab:hover {
  background: rgba(45, 125, 255, .1);
  color: #fff;
}

.docs-app .docs-tab.active {
  background: #2D7DFF;
  color: #fff;
  box-shadow: 0 8px 20px rgba(45, 125, 255, .35);
}

/* Paneles */
.docs-app .docs-section {
  display: none;
  background: rgba(10, 21, 38, .7);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  gap: 20px;
  grid-template-columns: 320px 1fr;
}

.docs-app .docs-section.active {
  display: grid;
}

/* Controls */
.docs-app .docs-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.docs-app .docs-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.docs-app .docs-group label {
  font-size: .95rem;
  color: #DCE4F0;
  font-weight: 500;
}

.docs-app .docs-group input[type="file"],
.docs-app .docs-group input[type="text"],
.docs-app .docs-group select {
  padding: 12px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .1);
  color: #fff;
  border-radius: 10px;
  font-family: inherit;
  font-size: .95rem;
  outline: none;
  transition: .2s;
  width: 100%;
  box-sizing: border-box;
}

.docs-app .docs-group input:focus,
.docs-app .docs-group select:focus {
  border-color: #2D7DFF;
  background: rgba(45, 125, 255, .06);
}

.docs-app .docs-group input[type="range"] {
  width: 100%;
  accent-color: #2D7DFF;
  cursor: pointer;
}

/* Botones */
.docs-app button {
  padding: 13px 20px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(45, 125, 255, .1);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: .2s;
}

.docs-app button:hover:not(:disabled) {
  background: rgba(45, 125, 255, .25);
  border-color: #2D7DFF;
}

.docs-app button:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.docs-app .docs-btn-primary {
  background: #2D7DFF;
  border-color: #2D7DFF;
  box-shadow: 0 8px 24px rgba(45, 125, 255, .35);
}

.docs-app .docs-btn-primary:hover:not(:disabled) {
  background: #1F6FEB;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(45, 125, 255, .45);
}

.docs-app .docs-info {
  color: #A8B4C7;
  font-size: .9rem;
  line-height: 1.5;
  min-height: 20px;
  text-align: center;
}

.docs-app .docs-info.ok { color: #25D366; font-weight: 600; }
.docs-app .docs-info.error { color: #ff9c9c; }

/* Results */
.docs-app .docs-results {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 200px;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 6px;
}

.docs-app .docs-results:empty::before {
  content: 'Los resultados aparecerán acá.';
  color: #6b7a90;
  font-size: .95rem;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
}

/* Grid imágenes */
.docs-app .docs-img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.docs-app .docs-img-card {
  background: rgba(10, 21, 38, .6);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  overflow: hidden;
  transition: .25s;
}

.docs-app .docs-img-card:hover {
  border-color: rgba(45, 125, 255, .5);
  transform: translateY(-2px);
}

.docs-app .docs-img-card .thumb {
  aspect-ratio: 3 / 4;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.docs-app .docs-img-card .thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.docs-app .docs-img-card .body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.docs-app .docs-img-card .name {
  font-size: .85rem;
  color: #DCE4F0;
  font-weight: 500;
  word-break: break-all;
}

.docs-app .docs-img-card button {
  padding: 8px 12px;
  font-size: .85rem;
}

/* Textarea */
.docs-app textarea {
  width: 100%;
  min-height: 400px;
  padding: 16px;
  background: rgba(10, 21, 38, .5);
  border: 1px solid rgba(255, 255, 255, .08);
  color: #DCE4F0;
  border-radius: 12px;
  font-family: 'Courier New', monospace;
  font-size: .92rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}

.docs-app textarea:focus {
  border-color: #2D7DFF;
  background: rgba(45, 125, 255, .04);
}

/* Preview word */
.docs-app .docs-preview {
  background: #fff;
  color: #000;
  padding: 40px;
  border-radius: 12px;
  font-family: 'Times New Roman', serif;
  font-size: 12pt;
  line-height: 1.6;
  min-height: 400px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}

.docs-app .docs-preview img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 12px auto;
}

.docs-app .docs-preview h1 { font-size: 2em; margin: 0.67em 0; font-weight: bold; }
.docs-app .docs-preview h2 { font-size: 1.5em; margin: 0.75em 0; font-weight: bold; }
.docs-app .docs-preview h3 { font-size: 1.17em; margin: 0.83em 0; font-weight: bold; }
.docs-app .docs-preview p { margin: 1em 0; }
.docs-app .docs-preview ul, .docs-app .docs-preview ol { margin: 1em 0; padding-left: 2em; }
.docs-app .docs-preview table { border-collapse: collapse; margin: 1em 0; }
.docs-app .docs-preview table td, .docs-app .docs-preview table th {
  border: 1px solid #ccc;
  padding: 6px 10px;
}

/* Lista archivos (merge/split) */
.docs-app .docs-file-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.docs-app .docs-file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(10, 21, 38, .6);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  transition: .2s;
}

.docs-app .docs-file-item:hover {
  border-color: rgba(45, 125, 255, .4);
}

.docs-app .docs-file-item .order {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(45, 125, 255, .15);
  color: #2D7DFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
}

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

.docs-app .docs-file-item .info .name {
  font-size: .95rem;
  color: #fff;
  font-weight: 500;
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-app .docs-file-item .info .size {
  font-size: .8rem;
  color: #A8B4C7;
}

.docs-app .docs-file-item button {
  padding: 8px 12px;
  font-size: .85rem;
  flex-shrink: 0;
}

/* Spinner */
.docs-app .docs-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, .2);
  border-top-color: #2D7DFF;
  border-radius: 50%;
  animation: docs-spin .7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes docs-spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 900px) {
  .docs-app .docs-section.active {
    grid-template-columns: 1fr;
  }

  .docs-app .docs-tabs {
    flex-direction: column;
  }

  .docs-app .docs-tab {
    min-width: 100%;
  }

  .docs-app .docs-results {
    max-height: none;
  }

  .docs-app .docs-preview {
    padding: 22px;
  }
}

@media (max-width: 520px) {
  .docs-app .docs-img-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}