/* Animaciones y microinteracciones para la aplicación */

/* Spinner de carga principal */
.spinner {
  display: inline-block;
  width: 50px;
  height: 50px;
  border: 5px solid rgba(var(--bs-primary-rgb), 0.3);
  border-radius: 50%;
  border-top-color: var(--bs-primary);
  animation: spin 1s ease-in-out infinite;
  margin: 20px auto;
}

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

/* Púlsación */
.pulse {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(var(--bs-primary-rgb), 0.7);
  }
  
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(var(--bs-primary-rgb), 0);
  }
  
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(var(--bs-primary-rgb), 0);
  }
}

/* Puntos de carga */
.loading-dots {
  display: inline-flex;
  align-items: center;
  height: 20px;
}

.loading-dots span {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--bs-primary);
  margin: 0 3px;
}

.loading-dots span:nth-child(1) {
  animation: bounce 1.5s 0.0s infinite ease-in-out;
}

.loading-dots span:nth-child(2) {
  animation: bounce 1.5s 0.2s infinite ease-in-out;
}

.loading-dots span:nth-child(3) {
  animation: bounce 1.5s 0.4s infinite ease-in-out;
}

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

/* Efecto rebote */
.bounce-in {
  animation: bounceIn 0.6s;
}

@keyframes bounceIn {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.9;
  }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* Efecto de desvanecimiento */
.fade-in-up {
  animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* Shimmer effect para contenido en carga */
.shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.5) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Success checkmark animation */
.checkmark {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: block;
  stroke-width: 2;
  stroke: #fff;
  stroke-miterlimit: 10;
  box-shadow: inset 0px 0px 0px var(--bs-success);
  animation: fill-success .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
  position: relative;
  margin: 0 auto;
}

.checkmark-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 2;
  stroke-miterlimit: 10;
  stroke: var(--bs-success);
  fill: none;
  animation: stroke .6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: stroke .3s cubic-bezier(0.65, 0, 0.45, 1) .8s forwards;
}

@keyframes stroke {
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes scale {
  0%, 100% {
    transform: none;
  }
  50% {
    transform: scale3d(1.1, 1.1, 1);
  }
}

@keyframes fill-success {
  100% {
    box-shadow: inset 0px 0px 0px 30px var(--bs-success);
  }
}

/* Error X animation */
.cross {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: block;
  stroke-width: 2;
  stroke: #fff;
  stroke-miterlimit: 10;
  margin: 0 auto;
  box-shadow: inset 0px 0px 0px var(--bs-danger);
  animation: fill-error .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}

.cross-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 2;
  stroke-miterlimit: 10;
  stroke: var(--bs-danger);
  fill: none;
  animation: stroke .6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.cross-line {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: stroke .3s cubic-bezier(0.65, 0, 0.45, 1) .8s forwards;
}

@keyframes fill-error {
  100% {
    box-shadow: inset 0px 0px 0px 30px var(--bs-danger);
  }
}

/* Hover effects */
.hover-float {
  transition: opacity 0.3s ease;
}

.hover-float:hover {
  opacity: 0.8;
}

.hover-grow {
  transition: opacity 0.3s ease;
}

.hover-grow:hover {
  opacity: 0.9;
}

/* Button animation */
.btn-animated {
  position: relative;
  overflow: hidden;
}

.btn-animated:after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

.btn-animated:focus:not(:active)::after {
  animation: ripple 1s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  20% {
    transform: scale(25, 25);
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    transform: scale(40, 40);
  }
}

/* Estado de espera */
.waiting {
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
}

.waiting div {
  position: absolute;
  top: 33px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--bs-primary);
  animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.waiting div:nth-child(1) {
  left: 8px;
  animation: waiting1 0.6s infinite;
}

.waiting div:nth-child(2) {
  left: 8px;
  animation: waiting2 0.6s infinite;
}

.waiting div:nth-child(3) {
  left: 32px;
  animation: waiting2 0.6s infinite;
}

.waiting div:nth-child(4) {
  left: 56px;
  animation: waiting3 0.6s infinite;
}

@keyframes waiting1 {
  0% {
    transform: scale(0);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes waiting3 {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(0);
  }
}

@keyframes waiting2 {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(24px, 0);
  }
}

/* Overlay de carga */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(var(--bs-dark-rgb), 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.loading-overlay.show {
  opacity: 1;
  visibility: visible;
}

.loading-content {
  text-align: center;
  color: white;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 30px;
  border-radius: 10px;
}

/* Progreso de carga */
.progress-load {
  height: 4px;
  width: 100%;
  position: relative;
  overflow: hidden;
  background-color: rgba(var(--bs-primary-rgb), 0.1);
  border-radius: 2px;
}

.progress-load:before {
  content: '';
  position: absolute;
  left: -50%;
  height: 4px;
  width: 40%;
  background-color: var(--bs-primary);
  animation: loading-progress 2s linear infinite;
}

@keyframes loading-progress {
  from {
    left: -50%;
  }
  to {
    left: 100%;
  }
}

/* Botón con animación de latido para crear primera empresa - COLOR CIAN ACTUALIZADO */
.heartbeat-button-container {
  padding: 2rem;
}

.heartbeat-button {
  display: inline-block !important;
  text-decoration: none !important;
  color: inherit !important;
  background: linear-gradient(135deg, #00bcd4, #0097a7) !important;
  border-radius: 20px !important;
  padding: 2rem 3rem !important;
  box-shadow: 0 10px 30px rgba(0, 188, 212, 0.3) !important;
  transition: all 0.3s ease !important;
  position: relative !important;
  overflow: hidden !important;
  animation: heartbeat 3s ease-in-out infinite !important;
  min-width: 500px !important;
  max-width: 600px !important;
}

.heartbeat-button-large {
  transform: scale(1.05) !important;
}

.heartbeat-button:hover {
  box-shadow: 0 15px 40px rgba(0, 188, 212, 0.4) !important;
  text-decoration: none !important;
  color: inherit !important;
}

.heartbeat-button-large:hover {
  /* No transform effect to prevent movement */
}

.heartbeat-button:active {
  transform: translateY(-2px) !important;
}

.heartbeat-icon {
  font-size: 3rem;
  color: white;
  margin-bottom: 1rem;
  animation: heartbeat-icon 1.5s ease-in-out infinite;
}

.heartbeat-text h3 {
  color: white;
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.heartbeat-text p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Animación de latido para el botón completo */
@keyframes heartbeat {
  0% {
    transform: scale(1);
  }
  20% {
    transform: scale(1.03);
  }
  40% {
    transform: scale(1);
  }
  60% {
    transform: scale(1.03);
  }
  80% {
    transform: scale(1);
  }
  100% {
    transform: scale(1);
  }
}

/* Animación de latido para el icono */
@keyframes heartbeat-icon {
  0% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.06);
  }
  50% {
    transform: scale(1);
  }
  75% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}


/* Efecto de brillo que se mueve */
.heartbeat-button::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;
}

.heartbeat-button:hover::before {
  left: 100%;
}

/* Responsive */
@media (max-width: 768px) {
  .heartbeat-button {
    padding: 1.5rem 2rem !important;
  }

  .heartbeat-button-large {
    transform: scale(1) !important;
  }

  .heartbeat-text h3 {
    font-size: 1.5rem !important;
  }
}