/* Data Zenix - 3D Animations and Modern Effects
   Enhanced modern animations and 3D transformations */

:root {
    /* Sync color scheme with main styles.css */
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #10b981;
    --secondary-dark: #059669;
    --secondary-light: #34d399;
    --accent-color: #8b5cf6;
    --accent-color-light: #a78bfa;
    --accent-color-dark: #7c3aed;
    --text-color: #1e293b;
    --text-light: #64748b;
    --bg-dark: #0f172a;
    --bg-light: #f8fafc;
    --white: #ffffff;
    --black: #000000;
    --primary-color-rgb: 37, 99, 235;
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    --gradient-dark: linear-gradient(135deg, var(--bg-dark), var(--primary-dark));
    --gradient-light: linear-gradient(135deg, var(--bg-light), var(--secondary-light));
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 15px 30px rgba(0, 0, 0, 0.1);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    --border-radius-full: 50%;
}

/* Core Animation Classes */
.animated {
    animation-duration: 1s;
    animation-fill-mode: both;
}

/* Base Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.scale-in {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.rotate-in {
    opacity: 0;
    transform: rotate(-15deg) scale(0.9);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.rotate-in.visible {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Staggered Animation */
.appear-stagger > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

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

/* Reveal Animation */
.reveal {
    position: relative;
    overflow: hidden;
}

.reveal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    transform: translateX(-100%);
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

.reveal.active::after {
    transform: translateX(100%);
}

/* 3D Card Effects */
.card-3d {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.6s ease;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    background-color: var(--white);
    border-radius: var(--border-radius-md);
    overflow: hidden;
}

.card-3d:hover {
    box-shadow: var(--shadow-xl);
}

.card-3d .card-content {
    backface-visibility: hidden;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.card-3d .icon-animated {
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.card-3d .btn-3d {
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), 
                box-shadow 0.6s ease,
                background-color 0.3s ease;
}

/* Tilt Card Effect */
.tilt-card {
    position: relative;
    transform-style: preserve-3d;
    transform: perspective(1000px);
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), 
                box-shadow 0.6s ease;
    box-shadow: var(--shadow-md);
    background-color: var(--white);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    cursor: pointer;
}

.tilt-card-inner {
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.tilt-card:hover {
    box-shadow: var(--shadow-xl);
}

/* Layer Card Effect */
.layer-card {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: var(--shadow-md);
    border-radius: var(--border-radius-md);
    background-color: var(--white);
    overflow: visible;
    cursor: pointer;
}

.layer-card::before, 
.layer-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100% - 10px);
    height: calc(100% - 10px);
    background-color: rgba(var(--primary-color-rgb, 37, 99, 235), 0.05);
    border-radius: var(--border-radius-md);
    z-index: -1;
    transform: translate3d(var(--layer-offset-x, 10px), var(--layer-offset-y, 10px), -10px);
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.layer-card::after {
    background-color: rgba(var(--primary-color-rgb, 37, 99, 235), 0.1);
    transform: translate3d(var(--layer-offset-x, 20px), var(--layer-offset-y, 20px), -20px);
}

.layer-card:hover::before {
    transform: translate3d(15px, 15px, -10px);
}

.layer-card:hover::after {
    transform: translate3d(30px, 30px, -20px);
}

/* 3D Image Effects */
.img-tilt, .img-3d, .img-hover-3d {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), 
                box-shadow 0.6s ease;
    overflow: hidden;
    border-radius: var(--border-radius-md);
}

.img-tilt img, .img-3d img, .img-hover-3d img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

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

/* Flip Card Effect */
.flip-card {
    perspective: 1000px;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--border-radius-md);
    background-color: var(--white);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
}

.flip-card-back {
    transform: rotateY(180deg);
    background-color: var(--primary-color);
    color: var(--white);
}

/* Hero Section 3D Effect */
.hero-section {
    position: relative;
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    overflow: hidden;
}

.hero-title-3d, .hero-content, .hero-cta {
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.hero-title-3d {
    transform: translateZ(50px);
}

.hero-content {
    transform: translateZ(25px);
}

.hero-cta {
    transform: translateZ(40px);
}

/* Mouse Trail Effect */
.mouse-trail {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(var(--primary-color-rgb, 37, 99, 235), 0.5);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    mix-blend-mode: screen;
}

/* 3D Text Effect */
.text-3d {
    color: var(--primary-color);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1),
                 0 2px 0 rgba(0, 0, 0, 0.05),
                 0 3px 0 rgba(0, 0, 0, 0.025),
                 0 4px 4px rgba(0, 0, 0, 0.1);
    transition: text-shadow 0.3s ease;
}

/* Parallax Elements */
.parallax-wrapper {
    position: relative;
    overflow: hidden;
}

.parallax-element {
    position: absolute;
    transition: transform 0.1s cubic-bezier(0.455, 0.03, 0.515, 0.955);
}

.scroll-parallax {
    position: relative;
    transition: transform 0.1s cubic-bezier(0.455, 0.03, 0.515, 0.955);
}

/* Progress Bars */
.progress-container {
    width: 100%;
    background-color: rgba(var(--primary-color-rgb, 37, 99, 235), 0.1);
    border-radius: var(--border-radius-full);
    margin-bottom: 15px;
    height: 10px;
    position: relative;
    overflow: hidden;
}

.progress-bar {
    width: 0;
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--border-radius-full);
    transition: width 1.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
                rgba(255, 255, 255, 0) 0%,
                rgba(255, 255, 255, 0.3) 50%,
                rgba(255, 255, 255, 0) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

/* Circular Progress */
.circular-progress {
    position: relative;
    width: 120px;
    height: 120px;
}

.circular-progress svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circular-progress-value {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 8;
    stroke-dasharray: 283; /* Circumference of a circle with r=45 */
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    stroke-linecap: round;
}

.circular-progress-bg {
    fill: none;
    stroke: rgba(var(--primary-color-rgb, 37, 99, 235), 0.1);
    stroke-width: 8;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
}

/* Counter Animation */
.counter-animation {
    font-size: 40px;
    font-weight: bold;
    color: var(--primary-color);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.counter-animation.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Custom Cursor */
.custom-cursor {
    position: fixed;
    width: 40px;
    height: 40px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
    mix-blend-mode: exclusion;
}

.cursor-dot {
    position: fixed;
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    width: 0;
    background: var(--gradient-primary);
    z-index: 9998;
    transition: width 0.1s ease;
}

/* Button 3D Effect */
.btn-3d {
    position: relative;
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
                box-shadow 0.4s ease;
}

.btn-3d::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 5px;
    left: 0;
    background-color: var(--primary-dark);
    border-radius: var(--border-radius-md);
    transform: translateZ(-1px);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.btn-3d:hover {
    transform: translateY(-3px) translateZ(10px);
}

.btn-3d:active {
    transform: translateY(0) translateZ(0);
    transition: transform 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.btn-3d:active::before {
    transform: translateZ(-2px);
    transition: transform 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Section Title with Animation */
.section-title-animated {
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section-title-animated.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-title-animated::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: var(--border-radius-full);
    transition: width 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
    transition-delay: 0.3s;
}

.section-title-animated.visible::after {
    width: 60px;
}

/* CSS Variables for component-specific animation timing */
.animation-delay-100 { animation-delay: 100ms; }
.animation-delay-200 { animation-delay: 200ms; }
.animation-delay-300 { animation-delay: 300ms; }
.animation-delay-400 { animation-delay: 400ms; }
.animation-delay-500 { animation-delay: 500ms; }
.animation-delay-600 { animation-delay: 600ms; }
.animation-delay-700 { animation-delay: 700ms; }
.animation-delay-800 { animation-delay: 800ms; }
.animation-delay-900 { animation-delay: 900ms; }
.animation-delay-1000 { animation-delay: 1000ms; }

/* Duration modifiers */
.animation-duration-300 { animation-duration: 300ms; }
.animation-duration-500 { animation-duration: 500ms; }
.animation-duration-700 { animation-duration: 700ms; }
.animation-duration-1000 { animation-duration: 1000ms; }
.animation-duration-1500 { animation-duration: 1500ms; }
.animation-duration-2000 { animation-duration: 2000ms; }

/* Easing functions */
.ease-in-out { transition-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1.000); }
.ease-out-back { transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.275); }
.ease-in-back { transition-timing-function: cubic-bezier(0.6, -0.28, 0.735, 0.045); }
.ease-elastic { transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55); }

/* Responsive Adjustments */
@media (max-width: 768px) {
    .hero-title-3d, .hero-content, .hero-cta {
        transform: none !important;
    }
    
    .hero-section {
        transform: none !important;
    }
    
    .card-3d, .tilt-card, .layer-card {
        transform: none !important;
    }
    
    .card-3d:hover, .tilt-card:hover, .layer-card:hover {
        transform: none !important;
    }
    
    .custom-cursor, .cursor-dot, .mouse-trail {
        display: none;
    }
}

/* Modern CSS Animation Classes */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.float {
    animation: float 3s ease-in-out infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
}

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

.rotate {
    animation: rotate 10s linear infinite;
}

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

.gradient-shift {
    background-size: 200% 200%;
    animation: gradient-shift 5s ease infinite;
}

/* Neon glow effect */
.neon-glow {
    box-shadow: 0 0 5px var(--primary-color),
                0 0 10px var(--primary-color),
                0 0 20px var(--primary-light);
    animation: neon-pulse 2s ease-in-out infinite alternate;
}

@keyframes neon-pulse {
    from { box-shadow: 0 0 5px var(--primary-color),
                       0 0 10px var(--primary-color),
                       0 0 20px var(--primary-light); }
    to { box-shadow: 0 0 10px var(--primary-color),
                     0 0 20px var(--primary-color),
                     0 0 30px var(--primary-light),
                     0 0 40px var(--primary-light); }
}

/* Glass morphism effect */
.glassmorphism {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Text reveal clip path animation */
.text-reveal {
    opacity: 1;
    clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
    animation: text-clip 1s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

@keyframes text-clip {
    0% { clip-path: polygon(0 0, 0 0, 0 100%, 0 100%); }
    100% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
}

/* Kinetic typography */
.kinetic-text {
    display: inline-block;
    animation: wave 2s ease-in-out infinite;
    animation-delay: calc(0.1s * var(--i, 0));
}

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

/* Modern underline effect */
.underline-effect {
    position: relative;
    display: inline-block;
}

.underline-effect::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.underline-effect:hover::after {
    width: 100%;
}

/* Spotlight hover effect */
.spotlight-effect {
    position: relative;
    overflow: hidden;
}

.spotlight-effect::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
    opacity: 0;
    transform: translate(-100%, -100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.spotlight-effect:hover::before {
    opacity: 1;
    transform: translate(var(--x, 0), var(--y, 0));
}

/* Hover lift effect with shadow */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* Blob animation for background elements */
.blob {
    animation: blob-morph 8s ease-in-out infinite;
}

@keyframes blob-morph {
    0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    25% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
    50% { border-radius: 50% 60% 30% 60% / 40% 30% 70% 50%; }
    75% { border-radius: 40% 60% 50% 40% / 60% 40% 60% 30%; }
}

/* Blinking text effect */
@keyframes blink-effect {
    0%, 100% { opacity: 1; text-shadow: 0 0 10px var(--primary-color), 0 0 20px var(--primary-light), 0 0 30px var(--primary-light); }
    50% { opacity: 0.7; text-shadow: 0 0 5px var(--primary-color), 0 0 10px var(--primary-light); }
}

.blink-text {
    animation: blink-effect 1.5s ease-in-out infinite;
    display: inline-block;
}