/* ========================================
   STAZ.TECH - Animations & Transitions
   ======================================== */

/* Fade-up animation for scroll reveals */
.fade-up {
    opacity: 0;
    -webkit-transform: translateY(30px);
    transform: translateY(30px);
    -webkit-transition: opacity 0.6s ease, -webkit-transform 0.6s ease;
    transition: opacity 0.6s ease, transform 0.6s ease;
    will-change: opacity, transform;
}

.fade-up.visible {
    opacity: 1;
    -webkit-transform: translateY(0);
    transform: translateY(0);
}

/* Staggered delays for sequential animations */
.fade-up:nth-child(1) { transition-delay: 0.1s; }
.fade-up:nth-child(2) { transition-delay: 0.2s; }
.fade-up:nth-child(3) { transition-delay: 0.3s; }
.fade-up:nth-child(4) { transition-delay: 0.4s; }
.fade-up:nth-child(5) { transition-delay: 0.5s; }
.fade-up:nth-child(6) { transition-delay: 0.6s; }
.fade-up:nth-child(7) { transition-delay: 0.7s; }
.fade-up:nth-child(8) { transition-delay: 0.8s; }

/* Fade-in animation (used for contact page and others) */
.fade-in {
    opacity: 0;
    -webkit-transform: translateY(20px);
    transform: translateY(20px);
    -webkit-transition: opacity 0.8s ease, -webkit-transform 0.8s ease;
    transition: opacity 0.8s ease, transform 0.8s ease;
    will-change: opacity, transform;
}

.fade-in.visible {
    opacity: 1;
    -webkit-transform: translateY(0);
    transform: translateY(0);
}

/* Legacy keyframe animation for backward compatibility */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Hero Section Animations
   ======================================== */

/* Hero CTA button hover effects */
.hero-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 57, 53, 0.6);
    background: linear-gradient(135deg, #F44336 0%, #D32F2F 100%);
}

.hero-cta-button:active {
    transform: translateY(0);
}

.hero-cta-button:focus {
    outline: 2px solid #6ee7b7;
    outline-offset: 2px;
}

.hero a[href]:not(.hero-cta-button):hover {
    border-color: rgba(255,255,255,0.6);
    background-color: rgba(255,255,255,0.05);
}

/* ========================================
   Neural Network Animations (Index Page)
   ======================================== */

@keyframes neural-node-pulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.3);
    }
}

@keyframes neural-connection-pulse {
    0%, 100% {
        opacity: 0.2;
    }
    50% {
        opacity: 0.5;
    }
}

.neural-node {
    animation: neural-node-pulse 3s ease-in-out infinite;
}

.neural-connection {
    animation: neural-connection-pulse 4s ease-in-out infinite;
}

.neural-network-bg {
    animation: subtle-shift 20s ease-in-out infinite;
}

@keyframes subtle-shift {
    0%, 100% {
        transform: translateX(0) translateY(0);
    }
    25% {
        transform: translateX(5px) translateY(-5px);
    }
    50% {
        transform: translateX(-5px) translateY(5px);
    }
    75% {
        transform: translateX(5px) translateY(5px);
    }
}

/* ========================================
   Process & Methodology Animations
   ======================================== */

.process-step-circle:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(228, 25, 55, 0.5);
}

/* Method card hover for cybersecurity page */
.method-card:hover {
    box-shadow: 0 8px 24px rgba(228, 25, 55, 0.15);
    transform: translateY(-4px);
}

.method-card:hover .method-number {
    animation: pulse-number 1.5s ease-in-out infinite;
}

@keyframes pulse-number {
    0%, 100% {
        transform: scale(1.1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* ========================================
   Cybersecurity Page Animations
   ======================================== */

/* Pulsing halo effect */
@keyframes pulse-halo {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.2;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.15);
        opacity: 0.35;
    }
}

/* Grid movement animation */
@keyframes grid-move {
    0% {
        background-position: 0 0, 0 0;
    }
    100% {
        background-position: 50px 50px, 50px 50px;
    }
}

/* Scanning effect */
@keyframes scan {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
}

/* Benefit card hover */
.benefit-card:hover {
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(228, 25, 55, 0.12);
    transform: translateY(-4px);
}

.benefit-card:hover div {
    transform: scale(1.15);
}

/* Audit card hover effects */
.audit-card:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

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

/* Deliverable item hover */
.deliverable-item:hover .deliverable-icon {
    color: #E53935;
    transform: translateY(-3px);
}

.deliverable-item:hover {
    transform: scale(1.02);
}

/* Differentiator card hover */
.diff-card:hover {
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

.diff-card:hover .diff-icon {
    transform: scale(1.15);
}

/* CTA button hover */
.cta-button:hover {
    border-color: var(--blanc);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

/* ========================================
   Card & Section Hover Effects
   ======================================== */

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(229, 57, 53, 0.2);
}

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

/* ========================================
   Intersection Observer Utilities
   ======================================== */

/* Elements start hidden and become visible with intersection observer */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Loading & Transition States
   ======================================== */

.loading {
    opacity: 0.5;
    pointer-events: none;
}

.transitioning {
    transition: all 0.3s ease;
}

/* ========================================
   Responsive Adjustments
   ======================================== */

@media (max-width: 768px) {
    .fade-up {
        transform: translateY(20px);
    }

    .hero-cta-button:hover {
        transform: translateY(-1px);
    }

    .process-step-circle:hover {
        transform: scale(1.05) rotate(3deg);
    }

    /* Reduce animation intensity on mobile for better performance */
    .neural-network-bg {
        animation-duration: 30s;
    }
}

/* ========================================
   Accessibility - Respect user preferences
   ======================================== */

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

    .fade-up,
    .fade-in {
        opacity: 1;
        transform: none;
    }
}
