/**
 * Ultra Modern Design System
 * Next-level animations and visual effects
 */

/* ==========================================================================
   CSS Variables for Modern Effects
   ========================================================================== */
:root {
    /* Glass morphism */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    /* Gradient colors */
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-dark: linear-gradient(135deg, #0f0f0f 0%, #2a2a2a 100%);
    
    /* Neon effects */
    --neon-glow: 0 0 20px rgba(255, 255, 255, 0.5);
    --neon-text: 0 0 10px currentColor, 0 0 20px currentColor, 0 0 40px currentColor;
}

/* ==========================================================================
   Ultra Modern Hero
   ========================================================================== */
.hero {
    position: relative;
    height: 100vh;
    overflow: hidden;
    background: #000;
}

/* Animated gradient background */
.hero::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: linear-gradient(45deg, #000, #1a1a1a, #000, #2a2a2a);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    opacity: 0.8;
}

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

/* Particle effect overlay */
.particles-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    animation: floatParticle 10s infinite;
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

/* Glitch effect for hero title */
.hero-title {
    position: relative;
    animation: glitchText 3s infinite;
}

.hero-title::before,
.hero-title::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hero-title::before {
    animation: glitch-1 0.5s infinite;
    color: #00ffff;
    z-index: -1;
}

.hero-title::after {
    animation: glitch-2 0.5s infinite;
    color: #ff00ff;
    z-index: -2;
}

@keyframes glitch-1 {
    0%, 100% { clip-path: inset(0 0 0 0); transform: translate(0); }
    20% { clip-path: inset(20% 0 30% 0); transform: translate(-2px, 2px); }
    40% { clip-path: inset(50% 0 20% 0); transform: translate(2px, -2px); }
    60% { clip-path: inset(10% 0 60% 0); transform: translate(-1px, 1px); }
    80% { clip-path: inset(80% 0 5% 0); transform: translate(1px, -1px); }
}

@keyframes glitch-2 {
    0%, 100% { clip-path: inset(0 0 0 0); transform: translate(0); }
    20% { clip-path: inset(60% 0 10% 0); transform: translate(2px, 1px); }
    40% { clip-path: inset(20% 0 40% 0); transform: translate(-1px, 2px); }
    60% { clip-path: inset(80% 0 10% 0); transform: translate(1px, -2px); }
    80% { clip-path: inset(10% 0 80% 0); transform: translate(-2px, -1px); }
}

/* ==========================================================================
   Glass Morphism Cards
   ========================================================================== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.320, 1);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.glass-card:hover::before {
    opacity: 1;
    transform: rotate(45deg) translate(20%, 20%);
}

/* 3D Card Flip Effect */
.flip-card {
    perspective: 1000px;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.flip-card:hover {
    transform: rotateY(10deg) rotateX(-10deg);
}

/* ==========================================================================
   Advanced Card Hover Effects
   ========================================================================== */
.overview-card {
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.320, 1);
}

/* Liquid hover effect */
.overview-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.2), transparent);
    transform: translate(-50%, -50%);
    transition: all 0.8s ease-out;
}

.overview-card:hover::after {
    width: 400%;
    height: 400%;
}

/* Tilt effect on hover */
.overview-card:hover {
    transform: perspective(1000px) rotateX(-5deg) translateY(-10px);
    box-shadow: 
        0 20px 40px rgba(0,0,0,0.2),
        0 0 60px rgba(0,0,0,0.1);
}

/* Animated border */
.border-animation {
    position: relative;
}

.border-animation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid transparent;
    border-image: linear-gradient(45deg, #000, #666, #000);
    border-image-slice: 1;
    animation: borderRotate 3s linear infinite;
}

@keyframes borderRotate {
    0% { border-image-source: linear-gradient(45deg, #000, #666, #000); }
    50% { border-image-source: linear-gradient(225deg, #000, #999, #000); }
    100% { border-image-source: linear-gradient(45deg, #000, #666, #000); }
}

/* ==========================================================================
   Morphing Shapes Background
   ========================================================================== */
.morphing-shapes {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    animation: morph 20s ease-in-out infinite;
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(100, 100, 100, 0.1), transparent);
    top: -250px;
    left: -250px;
    animation-duration: 25s;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(150, 150, 150, 0.1), transparent);
    bottom: -200px;
    right: -200px;
    animation-duration: 20s;
    animation-delay: -5s;
}

.shape-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(200, 200, 200, 0.1), transparent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-duration: 30s;
    animation-delay: -10s;
}

@keyframes morph {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        transform: rotate(0deg) scale(1);
    }
    25% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
        transform: rotate(90deg) scale(1.1);
    }
    50% {
        border-radius: 40% 60% 60% 40% / 70% 30% 40% 60%;
        transform: rotate(180deg) scale(0.9);
    }
    75% {
        border-radius: 70% 30% 30% 70% / 30% 70% 70% 30%;
        transform: rotate(270deg) scale(1.05);
    }
}

/* ==========================================================================
   Text Effects
   ========================================================================== */
/* Neon glow text */
.neon-text {
    text-shadow: var(--neon-text);
    animation: neonFlicker 2s infinite alternate;
}

@keyframes neonFlicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(45deg, #000, #666, #000, #999);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientMove 5s ease infinite;
}

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

/* Typewriter effect */
.typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid;
    animation: 
        typing 3.5s steps(40, end),
        blinkCursor 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blinkCursor {
    from, to { border-color: transparent; }
    50% { border-color: black; }
}

/* ==========================================================================
   Scroll-based Animations
   ========================================================================== */
.parallax-section {
    position: relative;
    transform-style: preserve-3d;
}

.parallax-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.parallax-layer[data-speed="slow"] {
    transform: translateZ(-1px) scale(1.5);
}

.parallax-layer[data-speed="medium"] {
    transform: translateZ(-2px) scale(2);
}

.parallax-layer[data-speed="fast"] {
    transform: translateZ(-3px) scale(2.5);
}

/* Scroll reveal with rotation */
.rotate-in {
    opacity: 0;
    transform: rotate(-180deg) scale(0.5);
    transition: all 1s cubic-bezier(0.23, 1, 0.320, 1);
}

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

/* Stagger animation */
.stagger-item {
    opacity: 0;
    transform: translateY(100px) rotate(5deg);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.320, 1);
}

.stagger-item.is-visible {
    opacity: 1;
    transform: translateY(0) rotate(0);
}

.stagger-item:nth-child(1) { transition-delay: 0s; }
.stagger-item:nth-child(2) { transition-delay: 0.1s; }
.stagger-item:nth-child(3) { transition-delay: 0.2s; }
.stagger-item:nth-child(4) { transition-delay: 0.3s; }
.stagger-item:nth-child(5) { transition-delay: 0.4s; }
.stagger-item:nth-child(6) { transition-delay: 0.5s; }
.stagger-item:nth-child(7) { transition-delay: 0.6s; }
.stagger-item:nth-child(8) { transition-delay: 0.7s; }

/* ==========================================================================
   Interactive Elements
   ========================================================================== */
/* Magnetic effect */
.magnetic {
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.320, 1);
    will-change: transform;
}

/* Ripple effect container */
.ripple-container {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.5), transparent);
    transform: scale(0);
    animation: rippleEffect 0.6s ease-out;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ==========================================================================
   Loading States
   ========================================================================== */
.skeleton-loader {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Pulse loader */
.pulse-loader {
    display: inline-block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: black;
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* ==========================================================================
   Mobile Optimizations
   ========================================================================== */
@media (max-width: 768px) {
    /* Disable complex animations on mobile */
    .hero-title::before,
    .hero-title::after {
        display: none;
    }
    
    .flip-card:hover {
        transform: none;
    }
    
    .parallax-layer {
        transform: none !important;
    }
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --glass-bg: rgba(0, 0, 0, 0.5);
        --glass-border: rgba(255, 255, 255, 0.1);
    }
}