/* ========================================
   ANIMATIONS.CSS - Syrtec
   Animaciones suaves y corporativas
   ======================================== */

/* ========================================
   KEYFRAMES
   ======================================== */

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    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);
    }
}

/* Scale */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleUp {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.05);
    }
}

/* Slide */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Shimmer / Skeleton */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Pulse */
@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes pulseGlow {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(0, 153, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(0, 153, 255, 0);
    }
}

/* Float / Levitate */
@keyframes float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes floatSlow {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

/* Rotate */
@keyframes rotateSlow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Typing (para carga) */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    0%,
    100% {
        border-color: transparent;
    }
    50% {
        border-color: var(--color-accent);
    }
}

/* Counters (para números) */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   CLASES DE ANIMACIÓN
   ======================================== */

/* Fade Animations */
.animate-fade-in {
    animation: fadeIn 0.8s ease both;
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease both;
}

.animate-fade-in-down {
    animation: fadeInDown 0.8s ease both;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s ease both;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s ease both;
}

/* Scale Animations */
.animate-scale-in {
    animation: scaleIn 0.6s ease both;
}

.animate-scale-up {
    animation: scaleUp 0.4s ease both;
    transform-origin: center;
}

/* Slide Animations */
.animate-slide-left {
    animation: slideInLeft 0.7s ease both;
}

.animate-slide-right {
    animation: slideInRight 0.7s ease both;
}

/* Float Animations */
.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-float-slow {
    animation: floatSlow 4s ease-in-out infinite;
}

/* Pulse */
.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

/* Rotate */
.animate-rotate-slow {
    animation: rotateSlow 20s linear infinite;
}

/* ========================================
   DELAYS
   ======================================== */
.delay-1 {
    animation-delay: 0.1s;
}
.delay-2 {
    animation-delay: 0.2s;
}
.delay-3 {
    animation-delay: 0.3s;
}
.delay-4 {
    animation-delay: 0.4s;
}
.delay-5 {
    animation-delay: 0.5s;
}
.delay-6 {
    animation-delay: 0.6s;
}
.delay-7 {
    animation-delay: 0.7s;
}
.delay-8 {
    animation-delay: 0.8s;
}
.delay-9 {
    animation-delay: 0.9s;
}
.delay-10 {
    animation-delay: 1s;
}

/* ========================================
   DURACIONES
   ======================================== */
.duration-fast {
    animation-duration: 0.4s !important;
}
.duration-normal {
    animation-duration: 0.8s !important;
}
.duration-slow {
    animation-duration: 1.2s !important;
}
.duration-slower {
    animation-duration: 1.6s !important;
}

/* ========================================
   ELEMENTOS ESPECÍFICOS
   ======================================== */

/* Hero Section */
.hero__title {
    animation: fadeInUp 1s ease both;
}

.hero__subtitle {
    animation: fadeInUp 1s ease 0.2s both;
}

.hero__buttons {
    animation: fadeInUp 1s ease 0.4s both;
}

/* About Section Stats */
.stat {
    animation: countUp 0.6s ease both;
}

.stat:nth-child(1) {
    animation-delay: 0.2s;
}
.stat:nth-child(2) {
    animation-delay: 0.4s;
}
.stat:nth-child(3) {
    animation-delay: 0.6s;
}

/* Service Cards - Staggered */
.service-card {
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.service-card:nth-child(1) {
    animation-delay: 0.1s;
}
.service-card:nth-child(2) {
    animation-delay: 0.2s;
}
.service-card:nth-child(3) {
    animation-delay: 0.3s;
}
.service-card:nth-child(4) {
    animation-delay: 0.4s;
}
.service-card:nth-child(5) {
    animation-delay: 0.5s;
}
.service-card:nth-child(6) {
    animation-delay: 0.6s;
}
.service-card:nth-child(7) {
    animation-delay: 0.7s;
}
.service-card:nth-child(8) {
    animation-delay: 0.8s;
}

/* Sector Cards - Staggered */
.sector-card {
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.sector-card:nth-child(1) {
    animation-delay: 0.05s;
}
.sector-card:nth-child(2) {
    animation-delay: 0.1s;
}
.sector-card:nth-child(3) {
    animation-delay: 0.15s;
}
.sector-card:nth-child(4) {
    animation-delay: 0.2s;
}
.sector-card:nth-child(5) {
    animation-delay: 0.25s;
}
.sector-card:nth-child(6) {
    animation-delay: 0.3s;
}
.sector-card:nth-child(7) {
    animation-delay: 0.35s;
}

/* Why Cards - Staggered */
.why-card {
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.why-card:nth-child(1) {
    animation-delay: 0.1s;
}
.why-card:nth-child(2) {
    animation-delay: 0.2s;
}
.why-card:nth-child(3) {
    animation-delay: 0.3s;
}
.why-card:nth-child(4) {
    animation-delay: 0.4s;
}
.why-card:nth-child(5) {
    animation-delay: 0.5s;
}
.why-card:nth-child(6) {
    animation-delay: 0.6s;
}

/* Project Items - Staggered */
.project-item {
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.project-item:nth-child(1) {
    animation-delay: 0.1s;
}
.project-item:nth-child(2) {
    animation-delay: 0.2s;
}
.project-item:nth-child(3) {
    animation-delay: 0.3s;
}
.project-item:nth-child(4) {
    animation-delay: 0.4s;
}
.project-item:nth-child(5) {
    animation-delay: 0.5s;
}
.project-item:nth-child(6) {
    animation-delay: 0.6s;
}

/* Brand Items - Staggered */
.brand-item {
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

.brand-item:nth-child(1) {
    animation-delay: 0.05s;
}
.brand-item:nth-child(2) {
    animation-delay: 0.1s;
}
.brand-item:nth-child(3) {
    animation-delay: 0.15s;
}
.brand-item:nth-child(4) {
    animation-delay: 0.2s;
}
.brand-item:nth-child(5) {
    animation-delay: 0.25s;
}
.brand-item:nth-child(6) {
    animation-delay: 0.3s;
}
.brand-item:nth-child(7) {
    animation-delay: 0.35s;
}
.brand-item:nth-child(8) {
    animation-delay: 0.4s;
}

/* ========================================
   INTERSECTION OBSERVER - CLASES
   ======================================== */
/* Estas clases se activan con JavaScript */
.observe {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.observe.visible {
    opacity: 1;
    transform: translateY(0);
}

.observe-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.observe-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.observe-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.observe-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.observe-scale {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.observe-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* ========================================
   HOVER EFFECTS
   ======================================== */

/* Imagen con zoom suave */
.hover-zoom {
    overflow: hidden;
    transition: var(--transition-slow);
}

.hover-zoom img {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-zoom:hover img {
    transform: scale(1.06);
}

/* Tarjeta con elevación */
.hover-lift {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

/* Botón con efecto shine */
.hover-shine {
    position: relative;
    overflow: hidden;
}

.hover-shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 40%,
        rgba(255, 255, 255, 0.15) 50%,
        transparent 60%
    );
    transform: translateX(-100%) rotate(45deg);
    transition: transform 0.6s ease;
}

.hover-shine:hover::after {
    transform: translateX(100%) rotate(45deg);
}

/* ========================================
   LOADING / SKELETON
   ======================================== */
.skeleton {
    background: var(--color-gray-100);
    background-image: linear-gradient(
        90deg,
        var(--color-gray-100) 25%,
        var(--color-gray-200) 50%,
        var(--color-gray-100) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    border-radius: var(--radius-md);
}

/* ========================================
   SCROLL INDICATOR
   ======================================== */
.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: float 2s ease-in-out infinite;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.scroll-indicator .mouse {
    width: 24px;
    height: 38px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    position: relative;
}

.scroll-indicator .mouse::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 8px;
    background: var(--color-white);
    border-radius: 4px;
    animation: scrollWheel 1.5s ease-in-out infinite;
}

@keyframes scrollWheel {
    0%,
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    50% {
        opacity: 0.2;
        transform: translateX(-50%) translateY(10px);
    }
}

/* ========================================
   COUNTER ANIMATION (para números)
   ======================================== */
.counter-number {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

/* ========================================
   MOBILE MENU ANIMATION
   ======================================== */
.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 30, 61, 0.6);
    z-index: 98;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   PROGRESS BAR (para loading)
   ======================================== */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--gradient-accent);
    z-index: 9999;
    transition: width 0.3s ease;
}

/* ========================================
   TOAST / NOTIFICACIONES
   ======================================== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    background: var(--color-primary);
    color: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    max-width: 400px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    border-left: 4px solid #22c55e;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.info {
    border-left: 4px solid var(--color-accent);
}

/* ========================================
   RESPONSIVE AJUSTES PARA ANIMACIONES
   ======================================== */
@media (max-width: 768px) {
    .service-card,
    .sector-card,
    .why-card,
    .project-item,
    .brand-item {
        animation-duration: 0.6s !important;
    }

    .service-card:nth-child(n),
    .sector-card:nth-child(n),
    .why-card:nth-child(n),
    .project-item:nth-child(n),
    .brand-item:nth-child(n) {
        animation-delay: 0.05s !important;
    }

    .hero__title {
        animation-duration: 0.6s !important;
    }

    .hero__subtitle {
        animation-duration: 0.6s !important;
        animation-delay: 0.15s !important;
    }

    .hero__buttons {
        animation-duration: 0.6s !important;
        animation-delay: 0.3s !important;
    }
}