/* ======================================
   ASPROCOMUR - Scroll Animations & Effects
   BEM naming convention
   ====================================== */

/* ====== SCROLL REVEAL ====== */
[data-animate] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-animate].visible {
  opacity: 1;
  transform: translateY(0);
}

[data-animate="fade-up"] {
  transform: translateY(40px);
}

[data-animate="fade-down"] {
  transform: translateY(-40px);
}

[data-animate="fade-left"] {
  transform: translateX(40px);
}

[data-animate="fade-right"] {
  transform: translateX(-40px);
}

[data-animate="fade-left"].visible,
[data-animate="fade-right"].visible {
  transform: translateX(0);
}

[data-animate="scale-up"] {
  transform: scale(0.9);
}

[data-animate="scale-up"].visible {
  transform: scale(1);
}

[data-animate="zoom-in"] {
  transform: scale(0.85);
}

[data-animate="zoom-in"].visible {
  transform: scale(1);
}

/* Stagger animation delays */
[data-animate-delay="100"] { transition-delay: 100ms; }
[data-animate-delay="200"] { transition-delay: 200ms; }
[data-animate-delay="300"] { transition-delay: 300ms; }
[data-animate-delay="400"] { transition-delay: 400ms; }
[data-animate-delay="500"] { transition-delay: 500ms; }
[data-animate-delay="600"] { transition-delay: 600ms; }

/* ====== PARALLAX ====== */
.parallax {
  will-change: transform;
  transition: transform 0.1s linear;
}

/* ====== HERO ANIMATIONS ====== */
.hero-title {
  animation: heroSlideUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.2s;
  opacity: 0;
  transform: translateY(40px);
}

.hero-subtitle {
  animation: heroSlideUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.5s;
  opacity: 0;
  transform: translateY(30px);
}

.hero-actions {
  animation: heroSlideUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.8s;
  opacity: 0;
  transform: translateY(20px);
}

.hero-badge {
  animation: heroSlideUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.1s;
  opacity: 0;
  transform: translateY(20px);
}

@keyframes heroSlideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ====== FLOATING SHAPES (decorative) ====== */
.section-hero::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(241, 6, 96, 0.15) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  animation: floatSlow 20s ease-in-out infinite;
  z-index: 1;
  pointer-events: none;
}

.section-hero::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(241, 6, 96, 0.1) 0%, transparent 70%);
  bottom: -100px;
  left: -100px;
  animation: floatSlow 15s ease-in-out infinite reverse;
  z-index: 1;
  pointer-events: none;
}

@keyframes floatSlow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ====== CARD HOVER EFFECTS ====== */
.card-activity,
.card-post,
.card-service,
.card-comarca {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-activity:hover,
.card-post:hover,
.card-service:hover,
.card-comarca:hover {
  transform: translateY(-8px);
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.15);
}

/* ====== BADGE GLOW ====== */
.badge--type {
  box-shadow: 0 0 0 0 rgba(241, 6, 96, 0.4);
}

.card-activity:hover .badge--type {
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(241, 6, 96, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(241, 6, 96, 0); }
}

/* ====== COUNTER ANIMATION ====== */
.stat-item__number {
  transition: color 0.3s;
}

.stat-item:hover .stat-item__number {
  color: var(--color-primary-dark);
}

/* ====== SMOOTH IMAGE LOADING ====== */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.5s ease;
}

img[loading="lazy"].loaded,
img.loaded {
  opacity: 1;
}

/* ====== SCROLL PROGRESS BAR ====== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--color-primary);
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ====== COMARCA CARD HOVER ====== */
.card-comarca__image {
  transition: transform var(--transition-slow);
}

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

/* ====== NAVIGATION ACTIVE INDICATOR ====== */
.main-nav__link.is-active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
}

/* ====== LOADING SKELETON ====== */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-gray-100) 25%,
    var(--color-gray-200) 50%,
    var(--color-gray-100) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

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

/* ====== BUTTON RIPPLE EFFECT ====== */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 10%, transparent 10.01%);
  transform: scale(10);
  opacity: 0;
  transition: transform 0.5s, opacity 0.3s;
}

.btn:active::after {
  transform: scale(0);
  opacity: 1;
  transition: 0s;
}

/* ====== SMOOTH SCROLL TO TOP ====== */
.scroll-top {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-8);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xl);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition-base);
  z-index: 999;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top:hover {
  background: var(--color-primary-dark);
  transform: translateY(-4px);
}

/* ====== FLOAT CARD ANIMATION ====== */
.hero-float-card {
  animation: floatCard 3s ease-in-out infinite;
}

.hero-float-card--2 {
  animation-delay: 1.5s;
}

@keyframes floatCard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ====== ABOUT ACCENT BOX ANIMATION ====== */
.about-accent-box {
  animation: floatCard 4s ease-in-out infinite;
  animation-delay: 0.5s;
}
