/* 
 * Config Sidebar 
 * Glassmorphism design con smooth animations y accesibilidad
 */

.config-sidebar {
  width: 400px;
  height: 100vh;
  background: linear-gradient(135deg, #23233a 0%, #3A455B 60%, #4A3B6B 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid var(--border-light);
  padding: var(--spacing-lg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  color: var(--text-primary);
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1000;
  transform: translateX(100%);
  
  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--surface-variant) transparent;
}

/* Overlay para cuando el sidebar está abierto */
.config-sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(2px);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.config-sidebar-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

/* Animaciones para mostrar/ocultar el sidebar */
.config-sidebar.visible {
  transform: translateX(0);
}

.config-sidebar.hidden {
  transform: translateX(100%);
}

.config-sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, 
    rgba(255, 255, 255, 0.05) 0%, 
    transparent 100%);
  pointer-events: none;
}

.config-sidebar::-webkit-scrollbar {
  width: 6px;
}

.config-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.config-sidebar::-webkit-scrollbar-thumb {
  background: var(--surface-variant);
  border-radius: var(--radius-full);
  transition: background 0.2s;
}

.config-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--border-focus);
}

/* Sidebar header */
.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--border-light);
}

.sidebar-header h5 {
  margin: 0;
  font-size: var(--font-size-lg);
  font-weight: 700;
  background: linear-gradient(90deg, #87CEEB, #b983ff, #87CEEB);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  letter-spacing: -0.02em;
}

/* Fallback para navegadores que no soportan click en el texto */
@supports not (background-clip: text) {
  .sidebar-header h5 {
    color: var(--text-primary);
  }
}

/*  cabecera con gradiente - todo:  usar sidebar-header*/
.config-sidebar h5:not(.sidebar-header h5) {
  margin-bottom: var(--spacing-lg);
  font-weight: 700;
  font-size: var(--font-size-lg);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  border-bottom: 2px solid;
  border-image: linear-gradient(90deg, var(--primary), var(--accent)) 1;
  padding-bottom: var(--spacing-sm);
  letter-spacing: -0.02em;
}

.sidebar-header h5 {
  margin: 0;
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

/* Close button */
/* .close-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--spacing-xs);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.close-btn:hover {
  background: var(--surface-variant);
  color: var(--text-primary);
  transform: scale(1.1);
}

.close-btn:active {
  transform: scale(0.95);
} */

/* Form groups */
.form-group {
  margin-bottom: var(--spacing-md);
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: 600;
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  letter-spacing: 0.01em;
}

/* Label  para el selector de modelos */
.model-label {
  font-size: var(--font-size-sm) !important;
  font-weight: 600 !important;
  color: var(--text-primary) !important;
  display: flex !important;
  align-items: center !important;
  gap: var(--spacing-xs) !important;
  margin-bottom: var(--spacing-sm) !important;
  letter-spacing: 0.01em;
}

/* Controles de formulario con glassmorphism */
.form-control {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  color: var(--text-primary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  font-family: inherit;
  line-height: 1.5;
}

.form-control:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  background: rgba(255, 255, 255, 0.1);
}

.form-control:hover:not(:focus) {
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.05);
}

.form-control::placeholder {
  color: var(--text-secondary);
  opacity: 0.8;
}

/* Información adicional de los formularios */
.model-info {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-top: var(--spacing-xs);
  opacity: 0.8;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}

/* Indicador del modelo seleccionado */
.selected-model-info {
  font-size: var(--font-size-xs);
  color: var(--success, #10b981);
  margin-top: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: rgba(16, 185, 129, 0.1);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--success, #10b981);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.selected-model-info strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Selector de capas gpu */
select.form-control {
  cursor: pointer;
  background: rgba(80, 80, 80, 0.8);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23ffffff' opacity='0.7' d='M8 12L3 7h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--spacing-sm) center;
  background-size: 16px;
  padding-right: var(--spacing-xl);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

select.form-control:focus {
  background: rgba(100, 100, 100, 0.9);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

select.form-control:hover:not(:focus) {
  background: rgba(90, 90, 90, 0.85);
  border-color: var(--border-focus);
}

/* Select deshabilitado */
select.form-control:disabled {
  background: rgba(60, 60, 60, 0.5);
  opacity: 0.6;
  cursor: not-allowed;
  color: var(--text-secondary);
}

select.form-control:disabled option {
  background: rgba(60, 60, 60, 0.5);
  color: var(--text-secondary);
}

/* Estilos específicos para el select de modelos */
select.model-select {
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

select.model-select:focus {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15), 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Opción placeholder */
option.placeholder-option {
  background: rgba(50, 50, 50, 0.95) !important;
  color: var(--text-secondary) !important;
  font-style: italic;
  font-weight: 400;
}

/* Estilos  para las opciones de modelos */
select.form-control option.model-option {
  background: rgba(70, 70, 70, 0.95);
  color: var(--text-primary);
  padding: var(--spacing-sm) var(--spacing-md);
  border: none;
  font-weight: 500;
  font-size: var(--font-size-sm);
  line-height: 1.4;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

select.form-control option.model-option:hover,
select.form-control option.model-option:focus {
  background: linear-gradient(135deg, rgba(100, 100, 100, 0.95), rgba(120, 120, 120, 0.95));
  color: var(--text-primary);
  font-weight: 600;
}

select.form-control option.model-option:last-child {
  border-bottom: none;
}

/* Estilos para las opciones del select */
select.form-control option {
  background: rgba(70, 70, 70, 0.95);
  color: var(--text-primary);
  padding: var(--spacing-xs) var(--spacing-sm);
  border: none;
}

select.form-control option:hover,
select.form-control option:focus {
  background: rgba(100, 100, 100, 0.95);
  color: var(--text-primary);
}

/* Flecha personalizada del select*/
select.form-control {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23ffffff' opacity='0.7' d='M8 12L3 7h10z'/%3E%3C/svg%3E");
}

select.form-control::-ms-expand {
  display: none;
}

/* Textarea  */
textarea.form-control {
  min-height: 100px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.6;
}

/* Input numerico sin spiners */
input[type="number"].form-control {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"].form-control::-webkit-outer-spin-button,
input[type="number"].form-control::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* button group */
.config-buttons {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-xl);
  flex-wrap: wrap;
}

/*  Botones con glassmorphism */
.btn {
  --btn-height: 44px;
  --btn-width: auto;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: 600;
  border: none;
  transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: var(--btn-height);
  height: var(--btn-height); /* Altura fija usando variable */
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 100px;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.02em;
  box-sizing: border-box; /* Asegura que el padding no afecte el tamaño total */
  max-height: var(--btn-height); /* Evita que crezca */
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.2), 
    transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  box-shadow: var(--shadow-lg);
  /* Eliminar transform para evitar cambios de tamaño */
}

.btn-secondary:hover {
  background: var(--surface-variant);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
  /* Eliminar transform para evitar cambios de tamaño */
}

.btn:active {
  /* No usar transform para evitar cambios de tamaño */
  box-shadow: var(--shadow-sm);
}

.btn:disabled:not(.loading) {
  cursor: not-allowed;
  opacity: 0.6;
  /* Mantener el mismo tamaño pero cambiar color */
  box-shadow: var(--shadow-sm) !important;
  transform: none !important;
}

/* Estilos específicos para cada tipo de botón deshabilitado */
.btn-primary:disabled:not(.loading) {
  background: var(--primary-dark);
  color: rgba(255, 255, 255, 0.7);
}

.btn-secondary:disabled:not(.loading) {
  background: var(--surface-variant);
  color: var(--text-secondary);
}

.btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Estado de carga - solución fixed */
.btn.loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
  transform: none !important; /* Forzar sin transformación */
  opacity: 1;
  box-shadow: inherit !important; /* Mantener la misma sombra */
  /* Asegurar que las dimensiones sean exactamente iguales */
  width: var(--btn-width, auto);
  height: var(--btn-height, 44px) !important;
  padding: var(--spacing-sm) var(--spacing-md) !important;
}

/* Mantener los estilos específicos para cada tipo de botón exactamente iguales */
.btn-primary.loading {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
  box-shadow: var(--shadow-md) !important;
  border: none !important;
}

.btn-secondary.loading {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-sm) !important;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 2; /* Asegurar que esté por encima de otros elementos */
  box-sizing: border-box; /* Asegurar que el borde no afecte el tamaño */
  pointer-events: none; /* No interferir con los eventos del botón */
}

.btn-primary.loading::after {
  border-top-color: white;
}

.btn-secondary.loading::after {
  border-top-color: var(--text-primary);
}

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

/* Slider para capas gpu */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: var(--surface-variant);
  border-radius: var(--radius-full);
  outline: none;
  margin: var(--spacing-sm) 0;
  transition: all 0.3s ease;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}

.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-md);
  transition: all 0.2s ease;
}

.slider::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}

.slider:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.slider-value {
  color: var(--primary);
  font-weight: 600;
  font-size: var(--font-size-sm);
  background: var(--surface-variant);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-left: var(--spacing-xs);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-top: -4px;
  margin-bottom: var(--spacing-sm);
}

.slider-labels span {
  font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
  .config-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1000;
    transform: translateX(100%);
    box-shadow: var(--shadow-xl);
    width: min(320px, 100vw);
    backdrop-filter: blur(30px);
  }
  
  .config-sidebar.visible {
    transform: translateX(0);
  }
  
  .config-buttons {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
  
  .btn {
    --btn-height: 48px; /* Actualizar la variable CSS */
    min-height: var(--btn-height);
    height: var(--btn-height);
    flex: none;
  }
}

@media (max-width: 480px) {
  .config-sidebar {
    width: 100vw;
    padding: var(--spacing-md);
  }
  
  .config-sidebar h5 {
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-md);
  }
  
  .form-group {
    margin-bottom: var(--spacing-sm);
  }
  
  .form-control {
    padding: var(--spacing-sm);
    font-size: var(--font-size-base);
  }
  
  textarea.form-control {
    min-height: 80px;
  }
  
  .btn {
    --btn-height: 52px; /* Actualizar la variable CSS para móviles */
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-base);
    min-height: var(--btn-height);
    height: var(--btn-height);
  }
  
  .config-buttons {
    margin-top: var(--spacing-md);
    gap: var(--spacing-xs);
  }
}

/* Accessibilidad */
.form-control:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .config-sidebar,
  .btn,
  .form-control,
  .btn::before {
    transition: none;
    animation: none;
  }
}

/* Soporte para contraste alto */
@media (prefers-contrast: high) {
  .config-sidebar {
    background: var(--surface);
    border-color: var(--border);
  }
  
  .form-control {
    background: var(--surface);
    border-width: 2px;
  }
  
  .btn-primary {
    background: var(--primary);
  }
  
  .btn-secondary {
    border-width: 2px;
  }
  
  .slider {
    background: var(--border);
  }
  
  .slider::-webkit-slider-thumb {
    background: var(--primary);
  }
  
  .slider::-moz-range-thumb {
    background: var(--primary);
  }
}

/* ===== SELECTOR  DE MODELOS ===== */

/* Botón trigger del selector */
.model-selector-trigger {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #333333; /* Igual que la tarjeta */
  border: 1px solid #444; /* Igual que la tarjeta */
  padding: 0 !important;
  margin: 0;
  border-radius: var(--radius-md);
}

/* Display del modelo seleccionado */
.selected-model-display {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  padding: 2px 4px; /* Padding mínimo */
  border-radius: var(--radius-md);
  background: #333333;
  border: 1px solid #444;
  margin-bottom: 2px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

/* Indicador de visión para el modelo seleccionado */
.selected-model-display.has-vision .model-icon {
  color: #b9b610;
  text-shadow: 0 0 8px rgba(185, 182, 16, 0.3);
}

.model-icon {
  font-size: 1.2em;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.model-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.model-badges {
  display: flex;
  gap: var(--spacing-xs);
  align-items: center;
  flex-wrap: wrap; /* Para permitir que las etiquetas fluyan si hay muchas */
}

.model-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: var(--font-size-sm);
}

.model-size {
  font-size: var(--font-size-xs);
  color: var(--primary);
  background: rgba(99, 102, 241, 0.2);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.model-quantization {
  font-size: var(--font-size-xs);
  color: #10b981;
  background: rgba(16, 185, 129, 0.2);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Etiqueta de visión para el modelo seleccionado  */
.model-vision {
  font-size: var(--font-size-xs);
  color: #b9b610;
  background: rgba(185, 182, 16, 0.2);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-transform: capitalize;
  border: 1px solid rgba(185, 182, 16, 0.3);
}

/* Placeholder display */
.placeholder-display {
  color: var(--text-secondary);
  font-style: italic;
  min-height: 48px; /* Igual que .model-card */
  display: flex;
  align-items: center;
  padding: 8px 8px;
  border-radius: var(--radius-md);
  background: #333333;
  border: 1px solid #444;
  box-sizing: border-box;
  width: 100%; /* Ocupa todo el ancho del selector */
  min-width: 0;
}

/* Flecha dropdown */
.dropdown-arrow {
  font-size: 0.75em;
  margin-left: 2px;
  vertical-align: middle;
  transition: transform 0.2s;
  color: var(--primary); /* Color acorde a la interfaz */
}

.dropdown-arrow.open {
  transform: rotate(180deg);
  color: var(--primary); /* Mantener color en estado abierto */
}

/* Dropdown container */
.model-selector-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1001;
  background: #2a2a2a;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  margin-top: 2px;
  max-height: 300px;
  overflow: hidden;
  /* Eliminar transform de la animación para evitar salto visual */
  animation: fadeInDropdown 0.18s ease-out;
}

@keyframes fadeInDropdown {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Container de cards */
.model-cards-container {
  max-height: 300px;
  overflow-y: auto;
  padding: 0 1px; /* Padding mínimo horizontal y sin padding vertical */
  background: #2a2a2a;
  
  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: #444444 transparent;
}

.model-cards-container::-webkit-scrollbar {
  width: 6px;
}

.model-cards-container::-webkit-scrollbar-track {
  background: transparent;
}

.model-cards-container::-webkit-scrollbar-thumb {
  background: #444444;
  border-radius: var(--radius-full);
}

/* Model Cards */
.model-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px; /* Más altura y espacio horizontal */
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  position: relative;
  margin-bottom: 4px;
  background: #333333;
  min-height: 48px; /* Altura mínima para evitar que se vean aplastadas */
}

.model-card:hover {
  background: #404040;
  transform: translateX(4px);
  border-color: #555555;
}

.model-card.selected {
  background: #1e3a8a;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.model-card.selected:hover {
  background: #1e40af;
}

/* Modelo con capacidad de visión */
.model-card.has-vision {
  border-left: 3px solid #b9b610;
  background: linear-gradient(135deg, #333333, #3d3b2a);
}

.model-card.has-vision:hover {
  background: linear-gradient(135deg, #404040, #4a4534);
}

.model-card.has-vision.selected {
  border-left: 3px solid #b9b610;
  background: linear-gradient(135deg, #1e3a8a, #3a371a);
}

.model-card.has-vision.selected:hover {
  background: linear-gradient(135deg, #1e40af, #4a4320);
}

/* Icono del card */
.model-card-icon {
  font-size: 1.5em;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  flex-shrink: 0;
}

/* Card Info */
.model-card-info {
  flex: 1;
  min-width: 0;
  /* Asegura que los badges no se vean afectados por el check */
}

.model-card-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  line-height: 1.3;
  margin-bottom: 6px; /* Más espacio vertical respecto a los badges */
}

.model-card-meta {
  display: flex;
  gap: var(--spacing-xs);
  align-items: center;
}

.model-meta-size {
  font-size: var(--font-size-xs);
  color: var(--primary);
  background: rgba(99, 102, 241, 0.2);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.model-card-plain {
  background: #232b3a;
  border: 1px solid #2d384d;
  box-shadow: 0 1px 4px 0 rgba(30,40,60,0.18);
  border-radius: 10px;
  color: #e3e8f0;
  transition: box-shadow 0.2s, border 0.2s, background 0.2s, color 0.2s;
}
.model-card-plain:hover {
  background: #2e3a4e;
  border: 1.5px solid #3a4a6b;
  box-shadow: 0 4px 16px 0 rgba(40,60,100,0.22);
  color: #fff;
}

.model-meta-quantization {
  font-size: var(--font-size-xs);
  color: #10b981;
  background: rgba(16, 185, 129, 0.2);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.model-meta-type {
  font-size: var(--font-size-xs);
  color: var(--accent);
  background: rgba(139, 92, 246, 0.2);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  text-transform: capitalize;
}

.model-meta-vision {
  font-size: var(--font-size-xs);
  color: #b9b610;
  background: rgba(185, 182, 16, 0.2);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-transform: capitalize;
  border: 1px solid rgba(185, 182, 16, 0.3);
}

.model-meta-weight {
  font-size: var(--font-size-xs);
  color: #f59e42;
  background: rgba(245, 158, 66, 0.18);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  border: 1px solid rgba(245, 158, 66, 0.25);
}

/* Indicador seleccionado */
.selected-indicator {
  font-size: 16px;
  color: var(--success, #10b981);
  font-weight: bold;
  flex-shrink: 0;
  margin-left: 0;
  position: absolute;
  right: 8px;
  top: 2px;
  transform: none;
  z-index: 2;
  animation: checkmark 0.3s ease-in-out;
}

@keyframes checkmark {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* Responsive */
@media (max-width: 480px) {
  .model-selector-dropdown {
    max-height: 250px;
  }
  
  .model-card {
    padding: var(--spacing-xs) var(--spacing-sm);
  }
  
  .model-card-name {
    font-size: var(--font-size-xs);
  }
}

/* ===== FIN SELECTOR  ===== */

/* Estilos para el header de configuración */
.config-title-gradient {
  background: linear-gradient(90deg, #b983ff 0%, #87CEEB 100%);
  border-bottom: 2.5px solid #e0e0e0;
  border-radius: 0 0 18px 18px;
  padding: 1.2rem 1.5rem 1.1rem 1.5rem;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.config-title-text {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  background: none;
  border: none;
  padding: 0;
}

.config-title-text-gradient {
  background: linear-gradient(90deg, #87CEEB, #b983ff, #87CEEB);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.01em;
  line-height: 1.2;
}
