/***** ==========================
   Sección de la Imagen Generada
   ========================== *****/
   .image-output-section {
    width: 100%;
    max-width: 1000px; /* Aumentado de 800px */
    min-height: 700px; /* Aumentado de 700px */
    background: #2D2D42;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.2);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.toggle-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #E0E0FF;
    margin-bottom: 1rem;
}

/***** ==========================
   Imagen Generada
   ========================== *****/
   .image-preview-container {
    position: relative;
    width: 100%;
    max-width: 700px; /* Aumentado de 450px */
    min-height: 650px; /* Aumentado de 700px */
    background: #1E1E2F;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease-in-out;
}

.image-preview-container:hover {
    transform: scale(1.02);
}

.generated-image {
    width: 100%;
    height: auto; /* Cambiado de 'auto' para llenar el contenedor */
    object-fit: contain; /* Mantiene la relación de aspecto */
    border-radius: 8px;
    transition: opacity 0.3s ease-in-out;
    z-index: 1; /* Menor que el del botón (10) */
}

.generated-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  }

/***** ==========================
   Placeholder (Cuando no hay Imagen)
   ========================== *****/
.placeholder-text {
    color: #B0B0D9;
    font-size: 1rem;
    text-align: center;
    padding: 1rem;
}

/***** ==========================
   Mensaje de Error
   ========================== *****/
.error-message {
    color: #FF6B6B;
    font-weight: bold;
    font-size: 1rem;
}

/***** ==========================
   Modal para Ampliar la Imagen
   ========================== *****/
.modal {
    display: none; /* Oculto por defecto */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.modal.show {
    display: flex; /* Se muestra cuando se agrega la clase "show" */
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: transparent;
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

/***** ==========================
   Modal para Ampliar la Imagen
   ========================== *****/
   .modal-image {
    max-width: 100%;
    max-height: 90vh; /* Aumentado de 80vh */
    border-radius: 8px;
    box-shadow: 0px 6px 20px rgba(255, 255, 255, 0.3);
    animation: zoomIn 0.3s ease-in-out;
}


/***** ==========================
   Botón de Cerrar Modal
   ========================== *****/
.close {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 2rem;
    color: #FFF;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/***** ==========================
   Animación de Zoom
   ========================== *****/
@keyframes zoomIn {
    from {
        transform: scale(0.7);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/***** ==========================
   Diseño Responsivo
   ========================== *****/
@media (max-width: 768px) {
    .image-output-section {
        padding: 1rem;
    }

    .toggle-text {
        font-size: 1.1rem;
    }

    .modal-content {
        max-width: 95%;
    }
}

/***** ==========================
  Botón de Descarga
   ========================== *****/
/* Estilos para el botón de descarga */
.download-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    padding: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 10;
  }
  
  .download-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
  }
  
  .download-btn i {
    color: white;
    font-size: 1.2rem;
  }
  
  .download-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
  }
  
 /* Estilos Modal Imagen Generada */
.generated-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95); /* Fondo más oscuro */
    z-index: 1001; /* Mayor que el z-index de la galería */
    justify-content: center;
    align-items: center;
  }
  
  .generated-modal__content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    padding: 20px;
    background: #1a1a1a; /* Fondo diferenciado */
    border-radius: 8px;
  }
  
  .generated-modal__image {
    max-height: calc(90vh - 40px); /* Considera el padding */
    width: auto;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
  }
  
  .generated-modal__close {
    position: absolute;
    top: -15px;
    right: -15px;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
    transition: transform 0.2s;
  }
  
  .generated-modal__close:hover {
    transform: scale(1.2);
  }
  
  .generated-modal__message {
    color: #ff6b6b;
    text-align: center;
    font-size: 1.2rem;
    padding: 20px;
  }