/**
 * Correcciones específicas para el modal de edición de URL
 */

/* Asegurar que el overlay del modal de edición de URL sea visible */
#url-edit-modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background-color: rgba(0, 0, 0, 0.5) !important;
  z-index: 9999 !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 20px !important;
}

/* El modal está oculto por defecto */
#url-edit-modal-overlay.hidden {
  display: none !important;
}

/* El modal está visible cuando no tiene la clase hidden */
#url-edit-modal-overlay:not(.hidden) {
  display: flex !important;
}

/* El modal en sí debe tener un estilo bien definido */
#url-edit-modal {
  background-color: white !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
  width: 90% !important;
  max-width: 500px !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  display: flex !important;
  flex-direction: column !important;
  opacity: 1 !important;
  border-top: 4px solid var(--primary-color) !important;
  margin: 0 auto !important; /* Centrar horizontalmente */
  position: relative !important; /* Asegurar que position: relative no sea sobrescrito */
  top: auto !important; /* Evitar posicionamiento fijo en top */
  left: auto !important; /* Evitar posicionamiento fijo en left */
}

/* Estilos específicos para los elementos del modal */
#url-edit-modal .modal-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 15px 20px !important;
  border-bottom: 1px solid #eee !important;
}

#url-edit-modal .modal-title {
  margin: 0 !important;
  font-size: 1.5rem !important;
  color: var(--primary-color) !important;
}

#url-edit-modal .modal-content {
  padding: 20px !important;
}

#url-edit-modal .modal-footer {
  display: flex !important;
  justify-content: flex-end !important;
  padding: 15px 20px !important;
  border-top: 1px solid #eee !important;
  gap: 10px !important;
}

/* Estilos para los campos del formulario */
#url-edit-modal .form-group {
  margin-bottom: 20px !important;
}

#url-edit-modal .form-label {
  display: block !important;
  margin-bottom: 5px !important;
  font-weight: 500 !important;
  color: var(--gray-700) !important;
}

#url-edit-modal .form-input {
  width: 100% !important;
  padding: 10px !important;
  border: 1px solid var(--gray-300) !important;
  border-radius: 4px !important;
  font-size: 1rem !important;
}

#url-edit-modal #edit-qr-code {
  background-color: var(--gray-100) !important;
  cursor: not-allowed !important;
}

#url-edit-modal .form-helper-text {
  display: block !important;
  font-size: 0.875rem !important;
  color: var(--gray-500) !important;
  margin-top: 5px !important;
}

/* Animación para filas actualizadas */
@keyframes highlightRow {
  0% {
    background-color: rgba(255, 255, 255, 1);
  }
  25% {
    background-color: rgba(0, 147, 221, 0.2);
  }
  100% {
    background-color: rgba(255, 255, 255, 1);
  }
}

/* Clase para filas que acaban de ser actualizadas */
.row-updated {
  animation: highlightRow 1.5s ease-in-out;
}

/* Animación para contadores actualizados */
@keyframes highlightCounter {
  0% {
    transform: scale(1);
    color: inherit;
  }
  50% {
    transform: scale(1.2);
    color: var(--primary-color);
  }
  100% {
    transform: scale(1);
    color: inherit;
  }
}

/* Clase para contadores que se acaban de actualizar */
.counter-updated {
  animation: highlightCounter 1.5s ease-in-out;
  font-weight: bold !important;
}

/* Asegurarnos de que las filas activas y pendientes tengan estilos bien definidos */
tr.active {
  background-color: rgba(240, 255, 240, 0.3) !important;
}

tr.pending {
  background-color: rgba(255, 250, 240, 0.3) !important;
}

/* Estilos para los badges de estado */
.status-badge-active {
  background-color: rgb(0, 200, 83) !important;
  color: white !important;
}

.status-badge-pending {
  background-color: rgb(255, 152, 0) !important;
  color: white !important;
}

/* Responsive */
@media (max-width: 640px) {
  #url-edit-modal {
    width: 95% !important;
  }
  
  #url-edit-modal .modal-title {
    font-size: 1.25rem !important;
  }
}