/* ================================
   🚀 ULTRA-MODERN PREMIUM CURSOR SYSTEM
   ================================ */

/* ================================
   🎯 CUSTOM CURSOR - ENHANCEMENT ONLY
   ================================ */

/* IMPORTANT: Custom cursor is purely decorative and works ALONGSIDE the normal cursor
   - Normal system cursor remains fully visible and functional
   - Custom cursor provides visual enhancement only
   - Only activate on devices with hover and fine pointer (desktop) */
@media (hover: hover) and (pointer: fine) {
    /* Main Cursor Container - PERFORMANCE OPTIMIZED */
    .custom-cursor {
        position: fixed;
        top: 0;
        left: 0;
        width: 32px;
        height: 32px;
        background: linear-gradient(135deg, 
            rgba(79, 172, 254, 0.95) 0%, 
            rgba(0, 242, 254, 0.9) 50%, 
            rgba(61, 90, 254, 0.95) 100%);
        backdrop-filter: blur(32px) saturate(200%) brightness(1.1);
        -webkit-backdrop-filter: blur(32px) saturate(200%) brightness(1.1);
        border: 2px solid rgba(255, 255, 255, 0.6);
        border-radius: 50%;
        pointer-events: none;
        z-index: 99999;
        /* Einfache, schnelle Transitions */
        transition: all 0.2s ease-out;
        transform: translate(-50%, -50%);
        box-shadow: 
            0 0 0 1px rgba(79, 172, 254, 0.3),
            0 4px 20px rgba(79, 172, 254, 0.4),
            0 8px 40px rgba(0, 242, 254, 0.2),
            0 16px 64px rgba(61, 90, 254, 0.15),
            inset 0 2px 0 rgba(255, 255, 255, 0.8);
        /* Force GPU acceleration and optimize rendering */
        will-change: transform, width, height;
        contain: layout style paint;
        animation: cursorPulse 3s ease-in-out infinite;
        /* Improve rendering performance */
        backface-visibility: hidden;
        perspective: 1000px;
        /* ✨ Versteckt bis erste Mausbewegung (Fallback für CSS) */
        opacity: 0;
    }

    /* Animated Gradient Background */
    .custom-cursor::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 8px;
        height: 8px;
        background: linear-gradient(45deg, #ffffff, rgba(255, 255, 255, 0.8));
        border-radius: 50%;
        transform: translate(-50%, -50%);
        transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        opacity: 0.9;
        box-shadow: 
            0 0 12px rgba(255, 255, 255, 0.8),
            0 0 24px rgba(79, 172, 254, 0.6);
        animation: centerDotPulse 2s ease-in-out infinite alternate;
    }

    /* Outer Ring Effect */
    .custom-cursor::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 64px;
        height: 64px;
        border: 2px solid transparent;
        background: linear-gradient(45deg, 
            rgba(79, 172, 254, 0.3), 
            rgba(0, 242, 254, 0.2), 
            rgba(61, 90, 254, 0.3)) border-box;
        border-radius: 50%;
        transform: translate(-50%, -50%);
        opacity: 0;
        transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        animation: outerRingRotate 8s linear infinite;
        mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
        mask-composite: xor;
        -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
    }

    /* 🎯 HOVER STATE - Magnetic & Morphing - PERFORMANCE OPTIMIZED */
    .custom-cursor.hover {
        width: 64px;  /* Reduced from 72px for better performance */
        height: 64px;
        background: linear-gradient(135deg, 
            rgba(255, 58, 212, 0.9) 0%, 
            rgba(79, 172, 254, 0.85) 30%, 
            rgba(0, 242, 254, 0.9) 60%,
            rgba(61, 90, 254, 0.85) 100%);
        border: 2px solid rgba(255, 255, 255, 0.7);  /* Reduced border thickness */
        box-shadow: 
            0 0 0 1px rgba(255, 58, 212, 0.3),  /* Reduced shadow complexity */
            0 0 0 2px rgba(79, 172, 254, 0.2),
            0 6px 24px rgba(255, 58, 212, 0.3),  /* Reduced shadow blur */
            0 12px 48px rgba(79, 172, 254, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
        backdrop-filter: blur(28px) saturate(180%) brightness(1.1);  /* Reduced blur for performance */
        -webkit-backdrop-filter: blur(28px) saturate(180%) brightness(1.1);
        /* Disable complex animations on hover for smoother transitions */
        /* animation: hoverPulse 1.5s ease-in-out infinite alternate; */
        /* Additional performance optimizations */
        will-change: width, height, transform;
        transform-origin: center center;
    }

    .custom-cursor.hover::before {
        width: 12px;
        height: 12px;
        background: linear-gradient(45deg, #ffffff, rgba(255, 58, 212, 0.8));
        box-shadow: 
            0 0 16px rgba(255, 255, 255, 1),
            0 0 32px rgba(255, 58, 212, 0.8),
            0 0 48px rgba(79, 172, 254, 0.6);
    }

    .custom-cursor.hover::after {
        opacity: 1;
        width: 120px;
        height: 120px;
        animation: hoverRingPulse 2s ease-in-out infinite;
    }

    /* 💥 CLICK STATE - Ripple Effect */
    .custom-cursor.click {
        width: 24px;
        height: 24px;
        background: linear-gradient(135deg, 
            rgba(255, 0, 128, 1) 0%, 
            rgba(255, 58, 212, 0.95) 50%, 
            rgba(79, 172, 254, 1) 100%);
        border: 2px solid rgba(255, 255, 255, 1);
        box-shadow: 
            0 0 0 4px rgba(255, 0, 128, 0.6),
            0 0 0 8px rgba(255, 58, 212, 0.4),
            0 0 0 12px rgba(79, 172, 254, 0.2),
            0 4px 20px rgba(255, 0, 128, 0.6),
            inset 0 2px 0 rgba(255, 255, 255, 1);
        transform: translate(-50%, -50%) scale(0.7);
        animation: clickRipple 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .custom-cursor.click::before {
        width: 6px;
        height: 6px;
        background: linear-gradient(45deg, #ffffff, rgba(255, 0, 128, 1));
        box-shadow: 
            0 0 8px rgba(255, 255, 255, 1),
            0 0 16px rgba(255, 0, 128, 1);
    }

    /* ✏️ TEXT STATE - For Input Fields */
    .custom-cursor.text {
        width: 2px;
        height: 24px;
        border-radius: 1px;
        background: linear-gradient(0deg, 
            rgba(79, 172, 254, 1) 0%, 
            rgba(0, 242, 254, 1) 50%, 
            rgba(79, 172, 254, 1) 100%);
        border: none;
        box-shadow: 
            0 0 8px rgba(79, 172, 254, 0.8),
            0 0 16px rgba(0, 242, 254, 0.6);
        animation: textBlink 1.2s ease-in-out infinite;
    }

    .custom-cursor.text::before,
    .custom-cursor.text::after {
        display: none;
    }

    /* 🎮 BUTTON STATE - Gaming Style - PERFORMANCE OPTIMIZED */
    .custom-cursor.button {
        width: 44px;  /* Slightly reduced for better performance */
        height: 44px;
        background: linear-gradient(135deg, 
            rgba(0, 255, 127, 0.9) 0%, 
            rgba(79, 172, 254, 0.85) 50%, 
            rgba(138, 43, 226, 0.9) 100%);
        border: 2px solid rgba(255, 255, 255, 0.8);
        box-shadow: 
            0 0 0 1px rgba(0, 255, 127, 0.4),  /* Reduced shadow layers */
            0 6px 20px rgba(0, 255, 127, 0.3),
            0 12px 40px rgba(79, 172, 254, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
        /* Reduced animation complexity */
        /* animation: buttonGlow 2s ease-in-out infinite alternate; */
        will-change: width, height, transform;
    }

    .custom-cursor.button::before {
        width: 10px;
        height: 10px;
        background: linear-gradient(45deg, #ffffff, rgba(0, 255, 127, 0.9));
        box-shadow: 
            0 0 12px rgba(255, 255, 255, 1),
            0 0 24px rgba(0, 255, 127, 0.8);
    }

    /* 🔗 LINK STATE - Magnetic Link Effect */
    .custom-cursor.link {
        width: 48px;
        height: 48px;
        background: linear-gradient(135deg, 
            rgba(255, 149, 0, 0.9) 0%, 
            rgba(255, 59, 48, 0.85) 50%, 
            rgba(255, 45, 85, 0.9) 100%);
        border: 2px solid rgba(255, 255, 255, 0.8);
        box-shadow: 
            0 0 0 1px rgba(255, 149, 0, 0.4),
            0 8px 32px rgba(255, 149, 0, 0.4),
            0 16px 64px rgba(255, 59, 48, 0.3),
            inset 0 2px 0 rgba(255, 255, 255, 0.9);
        animation: linkMagnetic 1.8s ease-in-out infinite;
    }

    .custom-cursor.link::before {
        width: 8px;
        height: 8px;
        background: linear-gradient(45deg, #ffffff, rgba(255, 149, 0, 1));
        box-shadow: 
            0 0 16px rgba(255, 255, 255, 1),
            0 0 32px rgba(255, 149, 0, 1);
    }

    /* 🌙 DARK MODE ADJUSTMENTS */
    .dark-mode .custom-cursor {
        background: linear-gradient(135deg, 
            rgba(64, 156, 255, 0.9) 0%, 
            rgba(0, 199, 255, 0.85) 50%, 
            rgba(100, 88, 255, 0.9) 100%);
        border-color: rgba(255, 255, 255, 0.4);
        box-shadow: 
            0 0 0 1px rgba(64, 156, 255, 0.4),
            0 6px 24px rgba(64, 156, 255, 0.3),
            0 12px 48px rgba(0, 199, 255, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.6);
    }

    .dark-mode .custom-cursor.hover {
        background: linear-gradient(135deg, 
            rgba(255, 58, 212, 0.85) 0%, 
            rgba(64, 156, 255, 0.8) 30%, 
            rgba(0, 199, 255, 0.85) 60%,
            rgba(100, 88, 255, 0.8) 100%);
        box-shadow: 
            0 0 0 1px rgba(255, 58, 212, 0.4),
            0 8px 32px rgba(255, 58, 212, 0.3),
            0 16px 64px rgba(64, 156, 255, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.7);
    }

    /* ⚡ ANIMATIONS */
    @keyframes cursorPulse {
        0%, 100% { 
            transform: translate(-50%, -50%) scale(1); 
            opacity: 0.9; 
        }
        50% { 
            transform: translate(-50%, -50%) scale(1.05); 
            opacity: 1; 
        }
    }

    @keyframes centerDotPulse {
        0% { 
            transform: translate(-50%, -50%) scale(1); 
            opacity: 0.9; 
        }
        100% { 
            transform: translate(-50%, -50%) scale(1.2); 
            opacity: 0.6; 
        }
    }

    @keyframes outerRingRotate {
        0% { transform: translate(-50%, -50%) rotate(0deg); }
        100% { transform: translate(-50%, -50%) rotate(360deg); }
    }

    @keyframes hoverPulse {
        0%, 100% { 
            transform: translate(-50%, -50%) scale(1); 
        }
        50% { 
            transform: translate(-50%, -50%) scale(1.1); 
        }
    }

    @keyframes hoverRingPulse {
        0%, 100% { 
            transform: translate(-50%, -50%) scale(1); 
            opacity: 0.3; 
        }
        50% { 
            transform: translate(-50%, -50%) scale(1.2); 
            opacity: 0.6; 
        }
    }

    @keyframes clickRipple {
        0% {
            transform: translate(-50%, -50%) scale(0.7);
            box-shadow: 
                0 0 0 0px rgba(255, 0, 128, 0.8),
                0 0 0 0px rgba(255, 58, 212, 0.6),
                0 0 0 0px rgba(79, 172, 254, 0.4);
        }
        50% {
            transform: translate(-50%, -50%) scale(0.5);
            box-shadow: 
                0 0 0 8px rgba(255, 0, 128, 0.4),
                0 0 0 16px rgba(255, 58, 212, 0.3),
                0 0 0 24px rgba(79, 172, 254, 0.2);
        }
        100% {
            transform: translate(-50%, -50%) scale(0.7);
            box-shadow: 
                0 0 0 12px rgba(255, 0, 128, 0),
                0 0 0 24px rgba(255, 58, 212, 0),
                0 0 0 36px rgba(79, 172, 254, 0);
        }
    }

    @keyframes textBlink {
        0%, 50% { opacity: 1; }
        51%, 100% { opacity: 0.3; }
    }

    @keyframes buttonGlow {
        0%, 100% { 
            box-shadow: 
                0 0 0 1px rgba(0, 255, 127, 0.4),
                0 8px 32px rgba(0, 255, 127, 0.3),
                0 16px 64px rgba(79, 172, 254, 0.2),
                inset 0 2px 0 rgba(255, 255, 255, 0.8);
        }
        50% { 
            box-shadow: 
                0 0 0 2px rgba(0, 255, 127, 0.6),
                0 12px 48px rgba(0, 255, 127, 0.5),
                0 24px 96px rgba(79, 172, 254, 0.3),
                inset 0 2px 0 rgba(255, 255, 255, 1);
        }
    }

    @keyframes linkMagnetic {
        0%, 100% { 
            transform: translate(-50%, -50%) scale(1) rotate(0deg); 
        }
        25% { 
            transform: translate(-50%, -50%) scale(1.05) rotate(1deg); 
        }
        75% { 
            transform: translate(-50%, -50%) scale(1.05) rotate(-1deg); 
        }
    }

    /* 🎨 ADVANCED CURSOR STATES */

    /* Particle Trail Effect for Special Elements */
    .custom-cursor.hover .particle,
    .custom-cursor.button .particle {
        position: absolute;
        width: 3px;
        height: 3px;
        background: rgba(255, 255, 255, 0.8);
        border-radius: 50%;
        pointer-events: none;
        animation: particleTrail 1s linear forwards;
    }

    /* 🧲 MAGNETIC CURSOR - For Special Interactive Elements */
    .custom-cursor.magnetic {
        width: 80px;
        height: 80px;
        background: radial-gradient(circle, 
            rgba(255, 20, 147, 0.8) 0%, 
            rgba(138, 43, 226, 0.7) 30%,
            rgba(75, 0, 130, 0.6) 70%,
            transparent 100%);
        border: 3px solid rgba(255, 255, 255, 0.9);
        box-shadow: 
            0 0 0 1px rgba(255, 20, 147, 0.5),
            0 0 40px rgba(255, 20, 147, 0.4),
            0 0 80px rgba(138, 43, 226, 0.3),
            inset 0 2px 0 rgba(255, 255, 255, 1);
        animation: magneticPulse 2s ease-in-out infinite;
    }

    .custom-cursor.magnetic::before {
        width: 16px;
        height: 16px;
        background: radial-gradient(circle, #ffffff 0%, rgba(255, 20, 147, 0.9) 100%);
        box-shadow: 
            0 0 20px rgba(255, 255, 255, 1),
            0 0 40px rgba(255, 20, 147, 1);
    }

    /* 🚀 LOGO/BRAND CURSOR - For Navigation Logo */
    .custom-cursor.nav-logo {
        width: 56px;
        height: 56px;
        background: linear-gradient(135deg, 
            rgba(255, 215, 0, 0.9) 0%, 
            rgba(255, 140, 0, 0.85) 30%,
            rgba(255, 69, 0, 0.9) 70%,
            rgba(220, 20, 60, 0.85) 100%);
        border: 3px solid rgba(255, 255, 255, 0.9);
        box-shadow: 
            0 0 0 2px rgba(255, 215, 0, 0.5),
            0 12px 48px rgba(255, 215, 0, 0.4),
            0 24px 96px rgba(255, 140, 0, 0.3),
            inset 0 3px 0 rgba(255, 255, 255, 1);
        animation: logoGlow 2.5s ease-in-out infinite alternate;
    }

    /* 🌈 GLASS ULTRA CURSOR - Premium Glass Effect */
    .custom-cursor.glass-ultra {
        width: 72px;
        height: 72px;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(40px) saturate(200%) brightness(1.2);
        -webkit-backdrop-filter: blur(40px) saturate(200%) brightness(1.2);
        border: 2px solid rgba(255, 255, 255, 0.3);
        box-shadow: 
            0 8px 32px rgba(0, 0, 0, 0.1),
            0 16px 64px rgba(0, 0, 0, 0.05),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
    }

    /* 🌈 RAINBOW CURSOR - For Special Celebrations */
    .custom-cursor.rainbow {
        width: 60px;
        height: 60px;
        background: conic-gradient(from 0deg, 
            #ff0000, #ff8000, #ffff00, #80ff00, 
            #00ff00, #00ff80, #00ffff, #0080ff, 
            #0000ff, #8000ff, #ff00ff, #ff0080, #ff0000);
        border: 3px solid rgba(255, 255, 255, 1);
        animation: rainbowShift 3s linear infinite;
        box-shadow: 
            0 0 40px rgba(255, 255, 255, 0.6),
            0 0 80px rgba(255, 255, 255, 0.3);
    }

    /* 🔥 FIRE CURSOR - For Hot Content */
    .custom-cursor.fire {
        width: 50px;
        height: 50px;
        background: radial-gradient(ellipse at center, 
            rgba(255, 69, 0, 1) 0%, 
            rgba(255, 140, 0, 0.9) 30%,
            rgba(255, 215, 0, 0.7) 60%,
            transparent 100%);
        border: 2px solid rgba(255, 255, 255, 0.8);
        animation: fireFlicker 0.5s ease-in-out infinite alternate;
        box-shadow: 
            0 0 20px rgba(255, 69, 0, 0.8),
            0 0 40px rgba(255, 140, 0, 0.6),
            0 0 60px rgba(255, 215, 0, 0.4);
    }

    /* 🎯 ANIMATION KEYFRAMES FOR ADVANCED STATES */
    @keyframes magneticPulse {
        0%, 100% { 
            transform: translate(-50%, -50%) scale(1) rotate(0deg); 
            opacity: 0.9; 
        }
        50% { 
            transform: translate(-50%, -50%) scale(1.1) rotate(180deg); 
            opacity: 1; 
        }
    }

    @keyframes logoGlow {
        0% { 
            box-shadow: 
                0 0 0 2px rgba(255, 215, 0, 0.5),
                0 12px 48px rgba(255, 215, 0, 0.4),
                0 24px 96px rgba(255, 140, 0, 0.3);
        }
        100% { 
            box-shadow: 
                0 0 0 3px rgba(255, 215, 0, 0.8),
                0 16px 64px rgba(255, 215, 0, 0.6),
                0 32px 128px rgba(255, 140, 0, 0.4);
        }
    }

    @keyframes rainbowShift {
        0% { transform: translate(-50%, -50%) rotate(0deg); }
        100% { transform: translate(-50%, -50%) rotate(360deg); }
    }

    @keyframes fireFlicker {
        0%, 100% { 
            transform: translate(-50%, -50%) scale(1) rotate(-2deg); 
            opacity: 0.9; 
        }
        25% { 
            transform: translate(-50%, -50%) scale(1.05) rotate(1deg); 
            opacity: 1; 
        }
        50% { 
            transform: translate(-50%, -50%) scale(0.95) rotate(-1deg); 
            opacity: 0.95; 
        }
        75% { 
            transform: translate(-50%, -50%) scale(1.02) rotate(2deg); 
            opacity: 1; 
        }
    }

    /* 🎯 PRECISION CURSOR - For Detailed Work */
    .custom-cursor.precision {
        width: 20px;
        height: 20px;
        background: rgba(0, 255, 0, 0.8);
        border: 1px solid rgba(255, 255, 255, 1);
        box-shadow: 
            0 0 8px rgba(0, 255, 0, 0.6),
            0 0 16px rgba(0, 255, 0, 0.4);
    }

    .custom-cursor.precision::before {
        width: 4px;
        height: 4px;
        background: #ffffff;
    }

    /* ⭐ STARFIELD CURSOR - Cosmic Effect */
    .custom-cursor.starfield::after {
        content: '✦';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 24px;
        color: rgba(255, 255, 255, 0.9);
        text-shadow: 
            0 0 10px rgba(255, 255, 255, 0.8),
            0 0 20px rgba(135, 206, 235, 0.6);
        animation: starRotate 4s linear infinite;
    }

    @keyframes starRotate {
        0% { transform: translate(-50%, -50%) rotate(0deg); }
        100% { transform: translate(-50%, -50%) rotate(360deg); }
    }

    /* 🌌 COSMIC CURSOR - Universe Effect */
    .custom-cursor.cosmic {
        width: 80px;
        height: 80px;
        background: radial-gradient(circle, 
            rgba(72, 61, 139, 0.8) 0%,
            rgba(106, 90, 205, 0.6) 25%,
            rgba(123, 104, 238, 0.4) 50%,
            rgba(147, 112, 219, 0.2) 75%,
            transparent 100%);
        border: 2px solid rgba(255, 255, 255, 0.6);
        animation: cosmicRotate 6s linear infinite;
        box-shadow: 
            0 0 40px rgba(72, 61, 139, 0.4),
            0 0 80px rgba(106, 90, 205, 0.3),
            inset 0 2px 0 rgba(255, 255, 255, 0.7);
    }

    .custom-cursor.cosmic::before {
        width: 20px;
        height: 20px;
        background: radial-gradient(circle, 
            rgba(255, 255, 255, 1) 0%,
            rgba(255, 255, 255, 0.8) 30%,
            rgba(135, 206, 235, 0.6) 70%,
            transparent 100%);
        animation: cosmicCenter 3s ease-in-out infinite alternate;
    }

    @keyframes cosmicRotate {
        0% { 
            transform: translate(-50%, -50%) rotate(0deg); 
            filter: hue-rotate(0deg); 
        }
        100% { 
            transform: translate(-50%, -50%) rotate(360deg); 
            filter: hue-rotate(360deg); 
        }
    }

    @keyframes cosmicCenter {
        0% { 
            transform: translate(-50%, -50%) scale(1); 
            opacity: 0.8; 
        }
        100% { 
            transform: translate(-50%, -50%) scale(1.3); 
            opacity: 1; 
        }
    }

    /* ⚡ PERFORMANCE MODE - Minimal Effects for Low-End Devices */
    .custom-cursor.performance-mode {
        animation: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        transition: all 0.1s ease-out;
    }

    .custom-cursor.performance-mode.hover {
        width: 48px;
        height: 48px;
    }

    .custom-cursor.performance-mode.button {
        background: rgba(0, 255, 127, 0.8);
    }

    .custom-cursor.performance-mode.link {
        background: rgba(255, 149, 0, 0.8);
    }

    .custom-cursor.performance-mode::after {
        display: none;
    }
} 