/**
 * NEMESYS Animations & Effects - CSS
 * Add this file to your Kadence child theme or paste into Additional CSS
 * Version: 1.0
 */

/* ==========================================================================
   PAGE LOAD ANIMATIONS
   ========================================================================== */

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

/* Container class - animates all direct children with stagger */
.animate-fade-in-up > * {
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
}

.animate-fade-in-up > *:nth-child(1) { animation-delay: 0.1s; }
.animate-fade-in-up > *:nth-child(2) { animation-delay: 0.2s; }
.animate-fade-in-up > *:nth-child(3) { animation-delay: 0.3s; }
.animate-fade-in-up > *:nth-child(4) { animation-delay: 0.4s; }
.animate-fade-in-up > *:nth-child(5) { animation-delay: 0.5s; }
.animate-fade-in-up > *:nth-child(6) { animation-delay: 0.6s; }

/* Single element class */
.fade-in-up {
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
}

.fade-in-up-delay-1 { animation-delay: 0.1s; }
.fade-in-up-delay-2 { animation-delay: 0.2s; }
.fade-in-up-delay-3 { animation-delay: 0.3s; }
.fade-in-up-delay-4 { animation-delay: 0.4s; }
.fade-in-up-delay-5 { animation-delay: 0.5s; }


/* ==========================================================================
   FLOATING ANIMATIONS
   ========================================================================== */

/* Drone Float - Main floating animation for product images */
@keyframes droneFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-15px) rotate(0.8deg);
    }
    50% {
        transform: translateY(-8px) rotate(-0.5deg);
    }
    75% {
        transform: translateY(-20px) rotate(0.3deg);
    }
}

.drone-float {
    animation: droneFloat 8s ease-in-out infinite;
}

/* Subtle version */
@keyframes droneFloatSubtle {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.drone-float-subtle {
    animation: droneFloatSubtle 6s ease-in-out infinite;
}

/* Hero Background Float - Very subtle, borderline imperceptible */
@keyframes heroFloat {
    0%, 100% {
        transform: translate(-50%, -50%) translateY(0);
    }
    50% {
        transform: translate(-50%, -50%) translateY(-20px);
    }
}

.hero-bg-float {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: heroFloat 12s ease-in-out infinite;
}

/* Even more minimal */
@keyframes heroFloatMinimal {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-12px);
    }
}

.hero-bg-float-minimal {
    animation: heroFloatMinimal 15s ease-in-out infinite;
}


/* ==========================================================================
   SHADOW & GLOW ANIMATIONS
   ========================================================================== */

/* Shadow Pulse - Syncs with droneFloat */
@keyframes shadowPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.4;
    }
    25% {
        transform: scale(0.85);
        opacity: 0.25;
    }
    50% {
        transform: scale(0.9);
        opacity: 0.3;
    }
    75% {
        transform: scale(0.8);
        opacity: 0.2;
    }
}

.shadow-pulse {
    animation: shadowPulse 8s ease-in-out infinite;
}

/* Pre-styled floating shadow element */
.floating-shadow {
    width: 250px;
    height: 40px;
    background: radial-gradient(ellipse, rgba(0,0,0,0.4) 0%, transparent 70%);
    filter: blur(10px);
    animation: shadowPulse 8s ease-in-out infinite;
}

.floating-shadow-light {
    background: radial-gradient(ellipse, rgba(0,0,0,0.15) 0%, transparent 70%);
    filter: blur(15px);
}

/* Glow Pulse */
@keyframes glowPulse {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.15);
    }
}

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

/* Pre-styled floating glow element */
.floating-glow {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(214, 95, 0, 0.2) 0%, transparent 60%);
    animation: glowPulse 6s ease-in-out infinite;
    pointer-events: none;
}

.floating-glow-light {
    background: radial-gradient(circle, rgba(214, 95, 0, 0.15) 0%, transparent 60%);
}


/* ==========================================================================
   BACKGROUND DRIFT ANIMATIONS
   ========================================================================== */

/* Slow Drift 1 - For decorative background elements */
@keyframes droneDrift1 {
    0%, 100% {
        transform: translateY(0) translateX(0) rotate(0deg);
    }
    33% {
        transform: translateY(-20px) translateX(-15px) rotate(1deg);
    }
    66% {
        transform: translateY(10px) translateX(10px) rotate(-0.5deg);
    }
}

.drone-drift-1 {
    animation: droneDrift1 25s ease-in-out infinite;
}

/* Slow Drift 2 - Mirrored version */
@keyframes droneDrift2 {
    0%, 100% {
        transform: scaleX(-1) translateY(0) translateX(0);
    }
    50% {
        transform: scaleX(-1) translateY(-25px) translateX(20px);
    }
}

.drone-drift-2 {
    animation: droneDrift2 30s ease-in-out infinite;
}

/* Generic slow drift */
@keyframes slowDrift {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    50% {
        transform: translateY(-15px) translateX(10px);
    }
}

.slow-drift {
    animation: slowDrift 20s ease-in-out infinite;
}


/* ==========================================================================
   BACKGROUND PATTERNS
   ========================================================================== */

/* Grid Background */
.bg-grid {
    position: relative;
}

.bg-grid::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 80px 80px;
    opacity: 0.4;
    pointer-events: none;
    z-index: 1;
}

/* Ensure grid appears above cover overlay */
.wp-block-cover.bg-grid::before {
    z-index: 1;
}

.bg-grid-fade::before {
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

.bg-grid-fade-bottom::before {
    mask-image: linear-gradient(to bottom, black 0%, transparent 80%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 80%);
}

.bg-grid-fade-bottom-left::before {
    mask-image: radial-gradient(ellipse at 20% 80%, black 0%, transparent 50%);
    -webkit-mask-image: radial-gradient(ellipse at 20% 80%, black 0%, transparent 50%);
}

.bg-grid-fade-top-right::before {
    mask-image: radial-gradient(ellipse at 80% 20%, black 0%, transparent 50%);
    -webkit-mask-image: radial-gradient(ellipse at 80% 20%, black 0%, transparent 50%);
}

/* Light mode grid */
.bg-grid-light::before {
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.06) 1px, transparent 1px);
}

/* Diagonal Grid */
.bg-diagonal-grid {
    position: relative;
}

.bg-diagonal-grid::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(45deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(-45deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.2;
    pointer-events: none;
    z-index: 0;
}

.bg-diagonal-grid-fade-right::before {
    mask-image: radial-gradient(ellipse at 90% 50%, black 0%, transparent 45%);
    -webkit-mask-image: radial-gradient(ellipse at 90% 50%, black 0%, transparent 45%);
}

/* Accent Glow Backgrounds */
.bg-accent-glow-top-right {
    position: relative;
}

.bg-accent-glow-top-right::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(214, 95, 0, 0.15) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

.bg-accent-glow-bottom-left {
    position: relative;
}

.bg-accent-glow-bottom-left::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 10% 90%, rgba(214, 95, 0, 0.15) 0%, transparent 35%);
    pointer-events: none;
    z-index: 0;
}

.bg-accent-glow-center {
    position: relative;
}

.bg-accent-glow-center::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(214, 95, 0, 0.12) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Light mode accent glows */
.bg-accent-glow-light-top-right::after {
    background: radial-gradient(circle at 80% 20%, rgba(214, 95, 0, 0.08) 0%, transparent 40%);
}

.bg-accent-glow-light-bottom-left::after {
    background: radial-gradient(circle at 10% 90%, rgba(214, 95, 0, 0.08) 0%, transparent 35%);
}


/* ==========================================================================
   HOVER EFFECTS
   ========================================================================== */

/* Card Lift */
.card-lift {
    transition: transform 0.3s ease;
}

.card-lift:hover {
    transform: translateY(-8px);
}

/* Card Lift with Shadow (Light Mode) */
.card-lift-shadow {
    transition: all 0.4s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

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

/* Card Lift with Border Accent */
.card-lift-accent {
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.card-lift-accent:hover {
    transform: translateY(-8px);
    border-color: rgba(214, 95, 0, 0.4);
}

/* Image Scale on Hover */
.img-scale-container {
    overflow: hidden;
}

.img-scale-container img {
    transition: transform 0.4s ease;
}

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

.img-scale-container-lg:hover img {
    transform: scale(1.1);
}

/* Top Border Reveal */
.border-reveal-top {
    position: relative;
    overflow: hidden;
}

.border-reveal-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #D65F00;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
    z-index: 10;
}

.border-reveal-top:hover::before {
    transform: scaleX(1);
}

/* Arrow Slide Effect */
.arrow-slide {
    position: relative;
}

.arrow-slide .arrow {
    position: absolute;
    bottom: 24px;
    right: 24px;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.2s ease;
    color: #D65F00;
    font-size: 20px;
}

.arrow-slide:hover .arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Number Box Highlight */
.number-box {
    width: 80px;
    height: 80px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 36px;
    color: #555555;
    transition: all 0.3s ease;
}

.number-box-parent:hover .number-box {
    color: #ffffff;
    background: #D65F00;
    border-color: #D65F00;
}

.number-box-color:hover {
    color: #D65F00;
    border-color: #D65F00;
}


/* ==========================================================================
   SCROLL-TRIGGERED ANIMATIONS (Requires JavaScript)
   ========================================================================== */

/* Initial hidden state */
.scroll-fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Staggered children */
.scroll-fade-in-stagger > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-fade-in-stagger.visible > *:nth-child(1) { transition-delay: 0.1s; }
.scroll-fade-in-stagger.visible > *:nth-child(2) { transition-delay: 0.2s; }
.scroll-fade-in-stagger.visible > *:nth-child(3) { transition-delay: 0.3s; }
.scroll-fade-in-stagger.visible > *:nth-child(4) { transition-delay: 0.4s; }
.scroll-fade-in-stagger.visible > *:nth-child(5) { transition-delay: 0.5s; }
.scroll-fade-in-stagger.visible > *:nth-child(6) { transition-delay: 0.6s; }

.scroll-fade-in-stagger.visible > * {
    opacity: 1;
    transform: translateY(0);
}


/* ==========================================================================
   NAVIGATION SCROLL STATE
   ========================================================================== */

/* Dark Mode */
nav.scrolled,
.site-header.scrolled,
#masthead.scrolled,
header.scrolled {
    background: rgba(5, 5, 5, 0.98) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Light Mode */
body.light-mode nav.scrolled,
body.light-mode .site-header.scrolled,
body.light-mode header.scrolled {
    background: rgba(255, 255, 255, 0.98) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 20px rgba(0,0,0,0.05);
}


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

/* Ensure positioned elements stay above backgrounds */
.z-content {
    position: relative;
    z-index: 1;
}

/* Background decoration container */
.bg-decoration {
    position: absolute;
    pointer-events: none;
    opacity: 0.08;
    z-index: 0;
}

.bg-decoration img {
    width: 100%;
    height: auto;
}

/* Hide on tablet and below */
@media (max-width: 1024px) {
    .bg-decoration,
    .drone-drift-1,
    .drone-drift-2,
    .hero-bg-float {
        display: none;
    }
}


/* ==========================================================================
   PRODUCT HERO STYLES
   ========================================================================== */

/* Product Hero Light - positions the product card */
.product-hero-light {
    position: relative;
}

.product-hero-light .wp-block-cover__inner-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    position: relative;
}

/* Product card - positioned in upper right */
.product-hero-card {
    position: absolute !important;
    top: 20%;
    right: 5%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    z-index: 5;
}

.product-hero-card img {
    max-width: 100%;
    height: auto;
}

/* Inline block helper */
.inline-block {
    display: inline-block !important;
    width: auto !important;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .product-hero-card {
        position: relative !important;
        top: auto;
        right: auto;
        max-width: 300px;
        margin-top: 40px;
    }
}

@media (max-width: 768px) {
    .product-hero-card {
        max-width: 250px;
    }
}

/* ==========================================================================
   ACCESSIBILITY - Reduced Motion
   ========================================================================== */

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

    .drone-float,
    .drone-float-subtle,
    .hero-bg-float,
    .hero-bg-float-minimal,
    .shadow-pulse,
    .glow-pulse,
    .drone-drift-1,
    .drone-drift-2,
    .slow-drift {
        animation: none !important;
    }

    .scroll-fade-in,
    .scroll-fade-in-stagger > * {
        opacity: 1 !important;
        transform: none !important;
    }
}
