/* ===== Custom Cursor Effects ===== */

/* Hide default cursor */
body {
    cursor: none;
}

/* Custom Cursor */
.custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid #DC143C;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    transition: all 0.15s ease;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
}

.custom-cursor::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: linear-gradient(135deg, #DC143C, #FF6B35);
    border-radius: 50%;
    transition: all 0.15s ease;
}

/* Cursor Follower */
.cursor-follower {
    position: fixed;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(220, 20, 60, 0.3);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99998;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(220, 20, 60, 0.1) 0%, transparent 70%);
}

/* Cursor states */
.custom-cursor.cursor-hover {
    width: 50px;
    height: 50px;
    border-color: #FF6B35;
    background: rgba(220, 20, 60, 0.1);
}

.custom-cursor.cursor-hover::after {
    width: 10px;
    height: 10px;
}

.cursor-follower.cursor-hover {
    width: 70px;
    height: 70px;
    border-color: rgba(255, 107, 53, 0.5);
    background: radial-gradient(circle, rgba(255, 107, 53, 0.2) 0%, transparent 70%);
}

/* Click effect */
.custom-cursor.cursor-click {
    animation: cursorClick 0.3s ease;
}

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

/* Cursor Trail Effect */
.cursor-trail {
    position: fixed;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #DC143C, #FF6B35);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99997;
    opacity: 0;
    animation: trailFade 0.5s ease-out forwards;
}

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

/* Magnetic Effect on Buttons */
.btn, .nav-link, .float-btn, .service-link {
    position: relative;
    transition: transform 0.3s ease;
}

/* Ripple Effect on Click */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(220, 20, 60, 0.4) 0%, transparent 70%);
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

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

/* Cursor Text Effect */
.cursor-text {
    position: fixed;
    pointer-events: none;
    z-index: 99999;
    font-family: 'Poppins', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: #DC143C;
    background: rgba(10, 10, 10, 0.9);
    padding: 5px 10px;
    border-radius: 5px;
    transform: translate(-50%, -150%);
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.cursor-text.show {
    opacity: 1;
}

/* Glow effect on hover */
.custom-cursor.cursor-glow {
    box-shadow: 0 0 20px rgba(220, 20, 60, 0.6),
                0 0 40px rgba(220, 20, 60, 0.4);
    border-color: #FF6B35;
}

.custom-cursor.cursor-glow::after {
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.8);
}

/* Link hover effect */
a:hover ~ .custom-cursor,
button:hover ~ .custom-cursor {
    border-color: #FF6B35;
}

/* Special cursor for inputs */
input:hover ~ .custom-cursor,
textarea:hover ~ .custom-cursor,
select:hover ~ .custom-cursor {
    width: 30px;
    height: 30px;
    border-style: dashed;
}

/* Disable custom cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
    body {
        cursor: auto;
    }
    
    .custom-cursor,
    .cursor-follower,
    .cursor-trail {
        display: none;
    }
}

/* Smooth transition for all interactive elements */
a, button, input, textarea, select, .btn, .nav-link {
    transition: transform 0.3s ease;
}

/* Particle explosion on click */
.cursor-particle {
    position: fixed;
    width: 4px;
    height: 4px;
    background: linear-gradient(135deg, #DC143C, #FF6B35);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99996;
    animation: particleExplode 0.8s ease-out forwards;
}

@keyframes particleExplode {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

/* Loading cursor state */
.custom-cursor.cursor-loading {
    border-color: #FF6B35;
    animation: cursorLoading 1s linear infinite;
}

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

/* Text selection styling */
::selection {
    background: rgba(220, 20, 60, 0.3);
    color: #FFF;
}

::-moz-selection {
    background: rgba(220, 20, 60, 0.3);
    color: #FFF;
}

/* Cursor for draggable elements */
[draggable="true"] {
    cursor: none;
}

.custom-cursor.cursor-grab {
    border-color: #FF6B35;
    transform: translate(-50%, -50%) rotate(-15deg);
}

.custom-cursor.cursor-grabbing {
    transform: translate(-50%, -50%) scale(0.8) rotate(-15deg);
}

/* Blend mode variations */
.custom-cursor.blend-screen {
    mix-blend-mode: screen;
}

.custom-cursor.blend-multiply {
    mix-blend-mode: multiply;
}

.custom-cursor.blend-difference {
    mix-blend-mode: difference;
}

/* Responsive cursor sizes */
@media (max-width: 1024px) {
    .custom-cursor {
        width: 18px;
        height: 18px;
    }
    
    .cursor-follower {
        width: 35px;
        height: 35px;
    }
}

/* Accessibility: Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .custom-cursor,
    .cursor-follower,
    .cursor-trail,
    .cursor-particle {
        animation: none;
        transition: none;
    }
}