/* Estilos para validaciones de formulario de proyectos */

/* Indicadores de pestañas */
#stepperTabs .nav-link.has-error {
  position: relative;
}

#stepperTabs .nav-link.has-error::after {
  content: '⚠';
  position: absolute;
  top: -5px;
  right: -5px;
  background: #dc3545;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

#stepperTabs .nav-link.is-valid {
  position: relative;
}

#stepperTabs .nav-link.is-valid::after {
  content: '✓';
  position: absolute;
  top: -5px;
  right: -5px;
  background: #28a745;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

/* Para pestañas activas - mantener texto blanco y solo mostrar icono */
#stepperTabs .nav-link.active {
  color: white !important;
}

#stepperTabs .nav-link.active.has-error::after {
  background: #dc3545;
  color: white;
  box-shadow: 0 0 0 2px white;
}

#stepperTabs .nav-link.active.is-valid::after {
  background: #28a745;
  color: white;
  box-shadow: 0 0 0 2px white;
}

/* Contador de caracteres */
.char-counter {
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.char-counter.text-success {
  color: #28a745 !important;
}

.char-counter.text-danger {
  color: #dc3545 !important;
}

.char-counter.text-warning {
  color: #ffc107 !important;
}

.char-counter.text-info {
  color: #17a2b8 !important;
}

.char-counter.text-muted {
  color: #6c757d !important;
}

/* Contador de caracteres del SMS */
#sms-char-count {
  font-weight: bold;
  transition: color 0.2s ease;
}

.char-counter-info {
  font-size: 0.8rem;
  opacity: 0.8;
}

.url-warning {
  background-color: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.25rem;
  margin-top: 0.5rem;
}

/* Mensajes de error */
.invalid-feedback {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #dc3545;
}

/* Estados de campos */
.form-control.is-valid {
  border-color: #28a745;
  padding-right: calc(1.5em + 0.75rem);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid {
  border-color: #dc3545;
  padding-right: calc(1.5em + 0.75rem);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23dc3545' viewBox='-2 -2 7 7'%3e%3cpath stroke='%23dc3545' d='M0 0l3 3m0-3L0 3'/%3e%3ccircle r='.5'/%3e%3ccircle cx='3' r='.5'/%3e%3ccircle cy='3' r='.5'/%3e%3ccircle cx='3' cy='3' r='.5'/%3e%3c/svg%3E");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Animaciones para transiciones suaves */
.form-control,
.nav-link {
  transition: all 0.15s ease-in-out;
}

/* Estilos para campos de texto */
textarea.form-control.is-valid,
textarea.form-control.is-invalid {
  background-position: top calc(0.375em + 0.1875rem) right calc(0.375em + 0.1875rem);
}

/* Indicadores de progreso */
.tab-progress {
  position: relative;
}

.tab-progress::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #007bff;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.tab-progress.is-valid::after {
  background-color: #28a745;
  transform: scaleX(1);
}

.tab-progress.has-error::after {
  background-color: #dc3545;
  transform: scaleX(1);
}

/* Responsive */
@media (max-width: 768px) {
  .char-counter {
    font-size: 0.8rem;
  }
  
  .invalid-feedback {
    font-size: 0.8rem;
  }
}
