/* ===========================
   ENHANCED COLORFUL BRUSH CURSOR
   =========================== */

/* Main cursor container */
.custom-cursor {
    position: fixed;
    width: 50px;
    height: 50px;
    pointer-events: none;
    z-index: 10000;
    transition: transform 0.1s ease;
}

/* Inner brush core */
.cursor-brush {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle,
            rgba(220, 20, 60, 1) 0%,
            rgba(255, 0, 100, 0.9) 20%,
            rgba(138, 43, 226, 0.7) 50%,
            rgba(0, 191, 255, 0.5) 80%,
            transparent 100%);
    border-radius: 50%;
    filter: blur(10px);
    animation: brushPulse 1.5s ease-in-out infinite;
}

/* Outer glow ring */
.cursor-brush::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(circle,
            transparent 40%,
            rgba(220, 20, 60, 0.4) 60%,
            rgba(138, 43, 226, 0.3) 80%,
            transparent 100%);
    border-radius: 50%;
    animation: ringPulse 2s ease-in-out infinite;
}

/* Inner dot for precision */
.cursor-brush::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px rgba(220, 20, 60, 0.8);
}

/* Cursor trail particles - Enhanced */
.cursor-trail {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    border-radius: 50%;
    animation: trailFade 1s ease-out forwards;
    filter: blur(4px);
}

/* Varied trail sizes and colors */
.cursor-trail.small {
    width: 15px;
    height: 15px;
}

.cursor-trail.medium {
    width: 25px;
    height: 25px;
}

.cursor-trail.large {
    width: 35px;
    height: 35px;
}

/* Sparkle particles */
.cursor-sparkle {
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    animation: sparkleFade 0.6s ease-out forwards;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

/* Hover state - larger and more vibrant */
.custom-cursor.hover .cursor-brush {
    transform: scale(1.8);
    filter: blur(14px);
    animation: brushPulseHover 1s ease-in-out infinite;
}

.custom-cursor.hover .cursor-brush::after {
    width: 12px;
    height: 12px;
    box-shadow: 0 0 20px rgba(220, 20, 60, 1);
}

/* Click state - explosive effect */
.custom-cursor.click .cursor-brush {
    animation: brushExplosion 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Text selection state */
.custom-cursor.text .cursor-brush {
    transform: scaleX(0.3) scaleY(1.5);
    filter: blur(6px);
}

/* Enhanced Animations */
@keyframes brushPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.9;
    }

    50% {
        transform: scale(1.15);
        opacity: 1;
    }
}

@keyframes brushPulseHover {

    0%,
    100% {
        transform: scale(1.8);
        opacity: 1;
    }

    50% {
        transform: scale(2);
        opacity: 1;
    }
}

@keyframes ringPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

@keyframes trailFade {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 0.9;
    }

    100% {
        transform: scale(0.2) rotate(180deg);
        opacity: 0;
    }
}

@keyframes sparkleFade {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(0);
        opacity: 0;
    }
}

@keyframes brushExplosion {
    0% {
        transform: scale(1);
    }

    30% {
        transform: scale(2.5);
        opacity: 0.5;
    }

    100% {
        transform: scale(1);
        opacity: 0.9;
    }
}

/* Hide custom cursor on touch devices */
@media (hover: none) and (pointer: coarse) {

    .custom-cursor,
    .cursor-trail,
    .cursor-sparkle {
        display: none;
    }

    body {
        cursor: auto !important;
    }
}