.wrapper {
  max-width: 1200px;
  margin: 0 auto;
  /* margin-top: 80px; */
  padding: 20px;
}
.wrapper h1 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 2.5rem;
}
.wrapper h1 .resaltado {
  color: #6c3cfa;
}
.subtitle {
  text-align: center;
  font-size: 1.1em;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: #fff;
  padding: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.dark-mode .container{
  background-color: #2A3443;
}
.image-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.image-box {
  display: flex; /* 👈 importante */
  flex-direction: column; /* 👈 organiza en columna */
  text-align: center;
  flex-direction: column;
  align-items: center;
  background: white;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.dark-mode .image-box{
  background-color: #0D1B2A;
}

canvas {
  max-width: 350px;
  max-height: 350px;
  border-radius: 8px;
  border: 2px solid #ddd;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-direction: row;
}

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;
}

#cartoonizeBtn {
  background: #6c3cfa;
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 550;
  font-size: 16px;
  white-space: nowrap;
  margin: 5px;
  transition: transform 0.2s;
}

#cartoonizeBtn:hover {
  transform: translateY(-2px);
}

#cartoonizeBtn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.progress {
  display: none;
  margin: 20px 0;
  padding: 15px;
  background: #e3f2fd;
  border-radius: 8px;
  border-left: 4px solid #2196f3;
}

.progress-bar {
  width: 100%;
  height: 10px;
  background: #ddd;
  border-radius: 5px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4caf50, #8bc34a);
  width: 0%;
  transition: width 0.3s ease;
}

.model-status {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  color: #856404;
  padding: 10px;
  border-radius: 5px;
  margin: 10px 0;
}

.model-status.loaded {
  background: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
  margin: 20px 0;
}

/* Media query para dispositivos móviles y tablets */
@media (max-width: 768px) {
  .wrapper {
    margin-top: 80px;
  }
  .wrapper h1{
    font-size: 2rem;
  }
  .control-group {
    width: 100%;
    flex-direction: column;
    gap: 10px;
  }

  .control-group label {
    width: auto;
    text-align: center;
  }

  button {
    width: 100%;
  }

  input[type="file"] {
    width: 100%;
    border: 2px solid #ddd;
    border-radius: 6px;
    margin-left: 0;
  }

  .container {
    padding: 20px;
  }

  canvas {
    max-width: 300px;
    max-height: auto;
  }
}
/* ========================================================================================= */
/*                 Color fijo para letras del "progressText" del cartonify.js                 */
/* ========================================================================================= */
#progressText {
  color: #37474F !important; /* Slate Gray: oscuro pero no negro */
}

/* ========================================================================================== */
/*                                          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;
}

.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;
}

.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;
  }
}
/* ============================================================================================ */
/*                                   Botón de descragar imagen                                  */
/* ============================================================================================ */
.download-btn {
    margin-top: 10px; /* 👈 agrega espacio debajo del canvas */
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #6c3cfacc;
    border: 2px solid #6c3cfa;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.download-btn i {
    font-size: 18px;
}
.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}
.download-btn.show {
    display: inline-flex !important;
    animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 768px) {
    .image-container {
        flex-direction: column;
    }
    
    .download-btn {
        justify-content: center;
    }
}
/* ============================================================================================== */
/*                                   Modal para ampliar imágenes                                  */
/* ============================================================================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    animation: zoomIn 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 50px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10000;
}

.modal-close:hover,
.modal-close:focus {
    color: #bbb;
    transform: scale(1.1);
}

.modal-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 15px 0;
    font-size: 18px;
    font-weight: 500;
}

/* Cursor pointer en los canvas */
#originalCanvas,
#cartoonCanvas {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#originalCanvas:hover,
#cartoonCanvas:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Animaciones */
@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95%;
        max-height: 70vh;
    }
    
    .modal-close {
        top: 10px;
        right: 20px;
        font-size: 40px;
    }
    
    .modal-caption {
        font-size: 16px;
        padding: 10px 0;
    }
}