.header {
  max-width: 1200px;
  margin: 0 auto;
  /*margin-top: 80px;*/
  padding: 20px;
}
.header h1 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 2.5rem;
}
.header h1 .resaltado {
  color: #6c3cfa;
}
.header p {
  text-align: center;
  font-size: 1.1em;
}

.wrapper {
  max-width: 1200px;
  margin: 0 auto;
  margin-bottom: 20px;
  text-align: center;
  justify-content: center;
  align-items: center;
}
@media (max-width: 768px) {
  .header h1 {
    font-size: 2rem;
  }
}
.container {
  padding: 30px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.dark-mode .container {
  background-color: #2a3443;
}
.upload-box {
  display: flex;
  flex-direction: row;
  gap: 15px;
  align-items: center;
}

.image-preview img {
  max-width: 100%;
  max-height: 80px;
  border-radius: 10px;
  border: 2px solid red;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}

.image-preview img:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}
/* ================================================================================================ */
/*                                Botón Toggle para pantallas pequeñas                              */
/* ================================================================================================ */
.format-controls-wrapper {
  margin: 20px 0;
}

.toggle-format-btn {
  display: none;
  width: 100%;
  padding: 12px 20px;
  background: #6c3cfa;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s;
}

.toggle-format-btn:hover {
  background: #6c3cfa;
}

.toggle-icon {
  font-size: 1.5rem;
  font-weight: bold;
  line-height: 1;
  transition: transform 0.3s;
}

.toggle-format-btn.active .toggle-icon {
  transform: rotate(45deg);
}
/* =============================================================================================== */
/*                                  Controles de formato de Texto                                  */
/* =============================================================================================== */
.format-controls {
  margin-top: 20px;
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  border: 1px solid #d0e7ff;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.control-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #6c3cfa;
  display: flex;
  align-items: center;
  gap: 5px;
}

.control-group input[type="range"] {
  width: 100%;
  cursor: pointer;
}

.control-group input[type="color"] {
  width: 100%;
  height: 40px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
}

.control-group select {
  padding: 8px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-family: "Poppins", sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  background: white;
}

.control-group select:focus,
.control-group input[type="color"]:focus {
  outline: none;
  border-color: #6c3cfa;
}
.style-btn {
  width: 100%;
  padding: 10px;
  background: #fff;
  color: #6c3cfa;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
/* Responsive adjustments */
@media (max-width: 768px) {
  .header {
    margin-top: 80px;
  }
  .toggle-format-btn {
    display: flex;
  }

  .format-controls {
    display: none;
    grid-template-columns: 1fr;
    padding: 15px;
    margin-top: 0;
  }

  .format-controls.show {
    display: grid;
    animation: slideDown 0.3s ease-out;
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
/* =================================================================================================== */
/* Modal de la imagen */
/* =================================================================================================== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 90%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: zoomIn 0.3s;
}

@keyframes zoomIn {
  from {
    transform: translate(-50%, -50%) scale(0.8);
  }
  to {
    transform: translate(-50%, -50%) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.modal-close:hover {
  color: #f44336;
}

input[type="file"] {
  flex: 1;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  font-size: clamp(0.875rem, 2vw, 1rem);
  transition: border-color 0.3s;
}

input[type="file"]:hover {
  border-color: #6c3cfa;
}

input[type="file"]::file-selector-button {
  background: #6c3cfa;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  margin-right: 10px;
  font-family: "Poppins", sans-serif;
  transition: background 0.3s;
}

input[type="file"]::file-selector-button:hover {
  background: #1a66d4;
}

#btnOCR {
  background: #6c3cfa;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 12px 30px;
  cursor: pointer;
  font-weight: 550;
  transition: 0.3s;
  font-size: 16px;
  white-space: nowrap;
}

#btnOCR:hover {
  transform: translateY(-2px);
}

#btnOCR:active {
  transform: translateY(0);
}

#loading {
  margin-top: 15px;
  font-weight: 600;
  font-size: clamp(0.875rem, 2vw, 1rem);
  color: #6c3cfa;
}

.hidden {
  display: none;
}

.output {
  background: #f0f7ff;
  margin-top: 20px;
  padding: 20px;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  text-align: left;
  white-space: pre-wrap;
  font-family: "Poppins", sans-serif, monospace;
  font-size: clamp(0.75rem, 1.5vw, 0.875rem);
  max-height: 400px;
  overflow-y: auto;
  word-break: break-word;
  color: #1a1a1a;
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 15px;
  width: 100%;
}
.output-header h3 {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.25rem);
  text-align: left;
  flex: 0 0 auto;
}
.btn-copy {
  background: #10b981;
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 15px;
  transition: background 0.3s ease;
}
.btn-copy:hover {
  background: #059669;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-copy.copied {
  background: #6366f1;
}
/* Responsive adjustments */
@media (max-width: 768px) {
  .upload-box {
    flex-direction: column;
  }

  input[type="file"] {
    width: 100%;
  }

  button {
    width: 100%;
  }

  .container {
    padding: 20px;
  }

  .output {
    max-height: 300px;
    padding: 15px;
  }
}

/* ===================================================================================================== */
/*                                            Contenido de muestra                                       */
/* ===================================================================================================== */
.contenido {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 20px;
}

.contenido h2 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 2rem;
}
.image-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

.image-box {
  flex: 1;
  max-width: 450px;
}

.image-box img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
}

.arrow-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 120px;
}

.chevron {
  width: 35px;
  height: 60px;
  transition: stroke 0.3s ease;
}

.chevron.active {
  stroke: #ff3333;
}

.chevron.inactive {
  stroke: #d1d1d1;
}

/* Responsive para móviles */
@media (max-width: 768px) {
  .container {
    padding: 20px;
  }

  h1 {
    font-size: 2rem;
  }
  h2 {
    font-size: 1.5rem;
  }

  .image-container {
    flex-direction: column;
    gap: 60px;
  }

  .image-box {
    width: 100%;
    max-width: 100%;
  }

  .image-box img {
    height: auto;
  }

  .arrow-wrapper {
    min-width: auto;
    flex-direction: column;
    gap: 3px;
  }

  .chevron {
    width: 80px;
    height: 45px;
    transform: rotate(90deg);
  }
}
/* ========================================================================================== */
/*                                          Pasos                                             */
/* ========================================================================================== */
.pasos {
  max-width: 1200px;
  margin: 0 auto;
  margin-top: 80px;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 40px;
  align-items: start;
}

.pasos-header {
  position: sticky;
  top: 40px;
  text-align: left;
}

.help-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: #fff;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(255, 215, 0, 0.3);
}

.help-text {
  font-size: 15px;
  margin-bottom: 8px;
}

.pasos-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 15px;
}

.pasos-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.paso-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
/* Modo oscuro */
.dark-mode .paso-card {
  background-color: #2a3443;
  border-color: #333;
  color: #f8f9fa;
}
.paso-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.paso-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
  text-align: left;
}

.paso-number {
  background: #6c3cfa;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 6px;
}

.paso-title {
  font-size: 18px;
  font-weight: 600;
}

.paso-description {
  font-size: 16px;
  line-height: 1.7;
  text-align: left;
}

@media (max-width: 768px) {
  .pasos {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 20px;
  }

  .pasos-header {
    position: relative;
    top: 0;
    text-align: center;
  }

  .help-icon {
    margin: 0 auto 20px;
  }

  .pasos-title {
    font-size: 28px;
  }
}
