/* ========================================================================
   Fahralarm - Energetic Professional GPS Tracking
   Animations Stylesheet: Dynamic Motion & Energy
   ======================================================================== */

/* ========================================================================
   Global Animation Settings
   ======================================================================== */

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

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

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

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

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

/* ========================================================================
   Scroll-Based Animations
   ======================================================================== */

.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
}

.scroll-animate.animated {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Staggered delays for multiple elements */
.scroll-animate:nth-child(1).animated {
    animation-delay: 0s;
}

.scroll-animate:nth-child(2).animated {
    animation-delay: 0.1s;
}

.scroll-animate:nth-child(3).animated {
    animation-delay: 0.2s;
}

.scroll-animate:nth-child(4).animated {
    animation-delay: 0.3s;
}

.scroll-animate:nth-child(5).animated {
    animation-delay: 0.4s;
}

.scroll-animate:nth-child(6).animated {
    animation-delay: 0.5s;
}

/* ========================================================================
   Navigation Animations
   ======================================================================== */

.nav {
    animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobile hamburger animation */
.nav-toggle.active .hamburger:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle.active .hamburger:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-toggle.active .hamburger:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.nav-mobile {
    animation: fadeIn 0.3s ease-out;
}

/* ========================================================================
   Button Hover Effects
   ======================================================================== */

.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

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

/* ========================================================================
   Card Hover Effects - Enhanced
   ======================================================================== */

.feature-card,
.product-card,
.contact-card,
.pricing-card {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Gradient border reveal on hover */
@keyframes borderReveal {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Icon pulse on card hover */
.feature-card:hover .feature-icon,
.contact-card:hover .contact-icon {
    animation: iconPulse 1s ease-in-out;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.1) rotate(5deg);
    }
    75% {
        transform: scale(1.05) rotate(-3deg);
    }
}

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

/* Title reveal with stagger */
.hero-title-item:nth-child(1) {
    --delay: 0s;
}

.hero-title-item:nth-child(2) {
    --delay: 0.15s;
}

.hero-title-item:nth-child(3) {
    --delay: 0.3s;
}

/* Floating mockup image */
@keyframes floatImage {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* Glowing orbs in hero */
@keyframes pulseGlow {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* Shimmer effect removed per user request */

/* ========================================================================
   Background Animations
   ======================================================================== */

/* Animated gradient mesh */
@keyframes meshShift {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1) rotate(0deg);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1) rotate(2deg);
    }
}

/* Flowing grid background */
@keyframes gridFlow {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

/* ========================================================================
   Section Title Animations
   ======================================================================== */

/* Gradient underline expansion */
@keyframes expandWidth {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

/* Title fade in with underline */
.section-title {
    animation: fadeIn 0.8s ease-out;
}

/* ========================================================================
   Pricing Card Animations
   ======================================================================== */

.pricing-amount {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.pricing-amount:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 16px rgba(14, 165, 233, 0.15);
}

/* ========================================================================
   FAQ Accordion Animations
   ======================================================================== */

.faq-answer {
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-icon {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item {
    transition: all 0.3s ease;
}

.faq-item:hover {
    transform: translateX(4px);
}

/* ========================================================================
   Cookie Banner Animation
   ======================================================================== */

.cookie-banner {
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ========================================================================
   Loading & Spinner Animations
   ======================================================================== */

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

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(14, 165, 233, 0.1);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========================================================================
   Gradient Animation on Elements
   ======================================================================== */

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animated-gradient {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* ========================================================================
   Link Hover Effects
   ======================================================================== */

.nav-link,
.footer-link {
    position: relative;
}

.nav-link::after,
.footer-link::after {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================================================
   Page Load Animation
   ======================================================================== */

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

body {
    animation: pageEnter 0.6s ease-out;
}

/* ========================================================================
   Glow Pulse Animation
   ======================================================================== */

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(14, 165, 233, 0.15);
    }
    50% {
        box-shadow: 0 4px 16px rgba(14, 165, 233, 0.25);
    }
}

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

/* ========================================================================
   Reduced Motion Support
   ======================================================================== */

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

    .scroll-animate {
        opacity: 1;
        transform: none;
    }

    .hero-title-item,
    .hero-description,
    .hero-cta,
    .hero-image {
        opacity: 1;
        transform: none;
        animation: none;
    }

    .mockup-img {
        animation: none;
    }

    .hero::before,
    .hero::after {
        animation: none;
    }

    body::before,
    .background-texture {
        animation: none;
    }
}

/* ========================================================================
   Performance Optimization
   ======================================================================== */

/* Use hardware acceleration for smoother animations */
.btn,
.feature-card,
.product-card,
.contact-card,
.hero-title-word {
    will-change: transform;
}

/* Remove will-change after animation completes */
.animated {
    animation-fill-mode: forwards;
}

.animated:not(:hover) {
    will-change: auto;
}
