

:root {
    --primary-color: #3a86ff;
    --primary-hover: #2a75ee;
    --background-color: #ffffff;

    --border-color: #e5e7eb;
    --border-radius: 12px;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.2s ease;
    --input-bg: #f9fafb;
    --input-border: #d1d5db;
    --input-focus: #3a86ff;
  }
  
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  /* Estilos personalizados adicionales */
  body {
    min-height: 100vh;
    background-color: #f8f9fa;
  }
  
  body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans",
      "Helvetica Neue", sans-serif;
    color: var(--text-color);
    line-height: 1.5;
    padding: 20px;
  }
  
  .container {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    max-width: 1600px;
    margin: 20px;
  }
  
  .card {
    border: none;
    border-radius: 0.75rem;
    height: 100%;
    background-color: var(--card-background);
    box-shadow: var(--shadow);
    overflow: hidden;
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    
  }
  .card-form {
    width: 100%;
  }
  
  .upload-card,
  .result-card {
    min-height: 500px;
  }
  
  .card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    padding-top: 1.25rem;
  }
  
  .card-header h5 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 4px;
  }
  
  .card-title {
    display: inline;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
  }
  
  .subtitle {
    color: var(--text-muted);
    font-size: 14px;
  }
  
  .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Controla el desbordamiento */
  }
  
  /* Upload Area */
  #drop-zone {
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    height: 100%;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
  }
  #drop-zone img {
    object-fit: contain;
    height: 100%;
    width: 100%;
    display: block;
  }
  #drop-zone:hover {
    border-color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.03);
  }
  
  #drop-zone.dragover {
    border-color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.05);
  }
  
  .upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    width: 100%;
    height: 100%;
    background-color: var(--input-bg);
  }
  
  .upload-icon {
    color: var(--text-muted);
    margin-bottom: 16px;
  }
  
  .upload-placeholder p {
    font-size: 1.4rem;
    color: var(--text-color);
    margin-bottom: 8px;
  }
  
  .upload-placeholder span {
    font-size: 1.2rem;
    color: var(--text-muted);
  }
  
  .file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
  }
  
  /* Form Elements */
  .form-group {
    margin-bottom: 20px;
  }
  
  label {
    display: block;
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 500;
  }
  
  .form-input,
  .form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background-color: var(--input-bg);
    font-size: 1.2rem;
    color: var(--text-color);
    transition: var(--transition);
  }
  
  .form-input:focus,
  .form-select:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
  }
  
  .select-wrapper {
    position: relative;
  }
  
  .select-wrapper::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-muted);
    pointer-events: none;
  }
  
  .form-select {
    appearance: none;
    padding-right: 30px;
  }
  
  /* Radio Buttons */
  .radio-group {
    display: flex;
    gap: 16px;
  }
  
  .radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
  }
  
  .radio-label input[type="radio"] {
    position: absolute;
    opacity: 0;
  }
  
  .radio-text {
    position: relative;
    padding-left: 28px;
    font-size: 15px;
  }
  
  .radio-text::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid var(--input-border);
    border-radius: 50%;
    transition: var(--transition);
  }
  
  .radio-text::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--primary-color);
    transition: var(--transition);
  }
  
  .radio-label input[type="radio"]:checked + .radio-text::before {
    border-color: var(--primary-color);
  }
  
  .radio-label input[type="radio"]:checked + .radio-text::after {
    transform: translateY(-50%) scale(1);
  }
  
  /* Tabs */
  .tabs {
    margin-top: 16px;
  }
  
  .tab-header {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
  }
  
  .tab-button {
    padding: 10px 16px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
  }
  
  .tab-button.active {
    color: var(--primary-color);
  }
  
  .tab-button::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transition: var(--transition);
  }
  
  .tab-button.active::after {
    transform: scaleX(1);
  }
  
  .tab-content {
    display: none;
  }
  
  .tab-content.active {
    display: block;
  }
  
  /* Color Picker */
  .color-input-group {
    display: flex;
    gap: 10px;
  }
  
  .color-picker {
    width: 40px;
    height: 40px;
    padding: 2px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background-color: var(--input-bg);
    cursor: pointer;
  }
  
  .form-control-color {
    max-width: 100%;
  }
  
  /* Button */
  .button {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
  }
  
  .primary-button {
    background-color: var(--primary-color);
    color: white;
    width: 100%;
  }
  
  .primary-button:hover {
    background-color: var(--primary-hover);
  }
  
  .color-option {
    border: 2px solid #ddd; 
    height: 40px; 
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
  }
  .color-option.selected {
    border: 3px solid #007bff !important;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
    transform: scale(1.05);
  }

  .color-option:hover {
      transform: scale(1.02);
      border-color: #007bff !important;
  }

  /* Preview Area */
  #preview-zone {
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
  }
  
  #preview-zone img {
    
    object-fit: contain;
    height: 100%;
    width: 100%;
    display: block;
  }

  .preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--input-bg);
    border-radius: var(--border-radius);
    width: 100%;
    height: 100%;
  }
  
  .preview-icon {
    color: var(--text-muted);
    margin-bottom: 16px;
  }
  
  .preview-placeholder p {
    color: var(--text-muted);
    font-size: 1.2rem;
  }
  
  /* Responsive */
  @media (max-width: 1600px) {
    .container {
      flex-direction: column;
    }
  
    .card {
      width: 100%;
    }
  }
  
  .nav-tabs .nav-link {
    color: #6c757d;
    font-size: 0.9rem;
  }
  
  .nav-tabs .nav-link.active {
    color: #0d6efd;
    font-weight: 500;
  }
  
  .form-label {
    font-weight: 500;
    font-size: 1.2rem;
  }
  
  .form-control:focus,
  .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
  }
  
  /* Para imágenes cargadas */
  .preview-image {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
  }
  
  /* Animación de carga para el preview-zone */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 200px;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  margin-top: 15px;
  color: #6c757d;
  font-size: 14px;
}

/* Animación alternativa con puntos pulsantes */
.loading-dots {
  display: flex;
  gap: 5px;
  margin-top: 10px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #007bff;
  animation: pulse 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes pulse {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Contenedor del tooltip */
.tooltip-container {
    position: relative;
    display: inline-block;
    padding-left: 2rem;
}

/* Ícono de información */
.info-icon {
    width: 2rem;
    height: 2rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1,5rem;
    font-weight: bold;
    cursor: help;
    transition: all 0.2s ease;
}

.info-icon:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

        /* Tooltip */
.tooltip {
    position: absolute;
    top: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    white-space: nowrap;
    max-width: 280px;
    white-space: normal;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}        

/* Mostrar tooltip en hover */
.tooltip-container:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

/* Variante de tooltip más amplio */
.tooltip-wide {
    max-width: 500px;
    min-width: 220px;
    padding: 16px 20px;
}

.tooltip-wide ul {
    margin: 8px 0 0 0;
    padding-left: 16px;
}

.tooltip-wide li {
    margin-bottom: 4px;
}

/* Tooltip posicionado a la derecha (alternativa) */
.tooltip-right {
    bottom: auto;
    left: 130%;
    top: 50%;
    transform: translateY(-50%);
}

.tooltip-right::after {
    top: 50%;
    left: -6px;
    transform: translateY(-50%);
    border-top-color: transparent;
    border-right-color: #2d3748;
}

.tooltip-container:hover .tooltip-right {
    opacity: 1;
    visibility: visible;
    left: 140%;
}
        