/*
 * Gobbo Theme - Animaciones Dinámicas
 * Version: 1.1.0
 * Este archivo agrega animaciones y efectos dinámicos al tema Gobbo
 * sin modificar el header
 */

/* ============================================
   ANIMACIONES DE ENTRADA (FADE-IN, SLIDE-IN)
   ============================================ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   CLASES DE ANIMACIÓN PARA USO GENERAL
   ============================================ */

.animate-fadeIn {
  animation: fadeIn 0.6s ease-out forwards;
}

.animate-fadeInUp {
  animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fadeInLeft {
  animation: fadeInLeft 0.6s ease-out forwards;
}

.animate-fadeInRight {
  animation: fadeInRight 0.6s ease-out forwards;
}

.animate-scaleIn {
  animation: scaleIn 0.5s ease-out forwards;
}

.animate-slideInUp {
  animation: slideInUp 0.7s ease-out forwards;
}

/* Retrasos para animaciones escalonadas */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* ============================================
   MEJORAS DEL CARRUSEL PRINCIPAL
   ============================================ */

#carousel-img {
  position: relative;
  overflow: hidden;
}

#carousel-img .carousel-item {
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

#carousel-img .carousel-item img {
  transition: transform 6s ease;
}

#carousel-img .carousel-item.active img {
  transform: scale(1.05);
}

#carousel-img .carousel-caption {
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

#carousel-img .carousel-caption .card {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

#carousel-img .carousel-caption .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Indicadores del carrusel */
#carousel-img .carousel-indicators button {
  transition: all 0.3s ease;
  transform: scale(1);
}

#carousel-img .carousel-indicators button.active {
  transform: scale(1.3);
  background-color: var(--primary-main);
}

/* Controles del carrusel */
#carousel-img .carousel-control-prev,
#carousel-img .carousel-control-next {
  transition: all 0.3s ease;
  opacity: 0;
}

#carousel-img:hover .carousel-control-prev,
#carousel-img:hover .carousel-control-next {
  opacity: 0.8;
}

#carousel-img .carousel-control-prev:hover,
#carousel-img .carousel-control-next:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* ============================================
   MEJORAS DE TARJETAS (CARDS)
   ============================================ */

/* Efecto lift mejorado para todas las tarjetas */
.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  will-change: transform, box-shadow;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Tarjetas de notas de prensa */
#nota-prensa .card {
  position: relative;
  overflow: hidden;
}

#nota-prensa .card::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 ease;
}

#nota-prensa .card:hover::before {
  left: 100%;
}

#nota-prensa .card img {
  transition: transform 0.5s ease;
}

#nota-prensa .card:hover img {
  transform: scale(1.05);
}

/* Tarjetas de servicios */
#servicios .card {
  position: relative;
  overflow: hidden;
}

#servicios .card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background-color: var(--primary-main);
  transition: width 0.3s ease;
}

#servicios .card:hover::after {
  width: 100%;
}

/* Tarjetas de trámites */
#tramites .card {
  position: relative;
  overflow: hidden;
}

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

#tramites .card:hover::before {
  left: 100%;
}

/* ============================================
   BOTONES DINÁMICOS
   ============================================ */

.btn, .btn-gobbo, button[type="submit"], .boton {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn::after, .btn-gobbo::after, button[type="submit"]::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::after, .btn-gobbo:active::after {
  width: 300px;
  height: 300px;
}

.btn:hover, .btn-gobbo:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* ============================================
   ENLACES Y NAVEGACIÓN
   ============================================ */

a {
  position: relative;
  transition: color 0.3s ease;
}

a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-main);
  transition: width 0.3s ease;
}

a:hover::after {
  width: 100%;
}

/* Excluir botones de la línea inferior */
.btn::after, .btn-gobbo::after, .btn:hover::after, .btn-gobbo:hover::after {
  display: none;
}

/* Enlaces del footer */
footer a::after {
  height: 1px;
  bottom: 0;
}

/* ============================================
   REDES SOCIALES - ANIMACIÓN
   ============================================ */

.social-icon-link {
  display: inline-block;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.social-icon-link:hover {
  transform: translateY(-5px) scale(1.1);
  filter: brightness(1.2);
}

/* ============================================
   SECCIONES CON ENTRADA ANIMADA
   ============================================ */

/* Animación al hacer scroll */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-scale.active {
  opacity: 1;
  transform: scale(1);
}

/* ============================================
   PAGINACIÓN ANIMADA
   ============================================ */

.custom-pagination .page-item .page-link {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.custom-pagination .page-item .page-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.custom-pagination .page-item.active .page-link {
  animation: scaleIn 0.3s ease;
}

/* ============================================
   TABLAS INTERACTIVAS
   ============================================ */

table tbody tr {
  transition: background-color 0.3s ease, transform 0.2s ease;
}

table tbody tr:hover {
  background-color: var(--background-paper) !important;
  transform: scale(1.01);
}

table tbody tr:hover td {
  background-color: var(--background-paper) !important;
}

/* ============================================
   FORMULARIOS INTERACTIVOS
   ============================================ */

input[type="text"],
input[type="email"],
input[type="search"],
input[type="url"],
textarea,
select {
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
  border-color: var(--primary-main);
  box-shadow: 0 0 0 3px rgba(var(--primary-main-rgb), 0.1);
  outline: none;
}

/* ============================================
   IMÁGENES Y GALERÍAS
   ============================================ */

img {
  transition: transform 0.4s ease, filter 0.4s ease;
}

#galeria .thumbnail {
  transition: all 0.3s ease;
}

#galeria .thumbnail:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ============================================
   LOADING SPINNER
   ============================================ */

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

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--background-paper);
  border-top: 4px solid var(--primary-main);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ============================================
   PULSE EFFECT PARA ELEMENTOS IMPORTANTES
   ============================================ */

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* ============================================
   SHIMMER EFFECT PARA CARGA DE CONTENIDO
   ============================================ */

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

.shimmer {
  background: linear-gradient(
    90deg,
    var(--background-default) 25%,
    var(--background-paper) 50%,
    var(--background-default) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ============================================
   RESPONSIVE ANIMATIONS
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.shadow-hover {
  transition: box-shadow 0.3s ease;
}

.shadow-hover:hover {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.scale-hover {
  transition: transform 0.3s ease;
}

.scale-hover:hover {
  transform: scale(1.05);
}

.rotate-hover {
  transition: transform 0.3s ease;
}

.rotate-hover:hover {
  transform: rotate(5deg);
}

/* ============================================
   FOOTER MEJORAS
   ============================================ */

footer {
  position: relative;
}

footer #pie-pagina {
  transition: background-color 0.3s ease;
}

footer a[href^="mailto:"] {
  transition: color 0.3s ease;
}

footer a[href^="mailto:"]:hover {
  color: var(--primary-main) !important;
}

footer a[href^="tel:"] {
  transition: color 0.3s ease;
}

footer a[href^="tel:"]:hover {
  color: var(--primary-main) !important;
}
