/* ==========================================================================
   Smooth Custom Cursor (Dot + Lagging Follower Circle)
   ========================================================================== */

.custom-cursor-dot,
.custom-cursor-circle {
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    pointer-events: none !important;
    user-select: none !important;
    z-index: 99999999;
    opacity: 0;
    transform: translate3d(-100px, -100px, 0);
    will-change: transform, opacity;
}

/* Inner Dot: Sticks directly to mouse point */
.custom-cursor-dot {
    width: 6px;
    height: 6px;
    background-color: var(--primary, #4F46E5);
    margin-top: -3px;
    margin-left: -3px;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.45);
    transition: opacity 0.25s ease, background-color 0.2s ease, width 0.2s ease, height 0.2s ease, margin 0.2s ease;
}

/* Outer Circle: Follows smoothly behind mouse with physics easing */
.custom-cursor-circle {
    width: 38px;
    height: 38px;
    border: 1.5px solid rgba(99, 102, 241, 0.45);
    margin-top: -19px;
    margin-left: -19px;
    background-color: transparent;
    transition: opacity 0.3s ease, 
                width 0.25s cubic-bezier(0.25, 1, 0.5, 1), 
                height 0.25s cubic-bezier(0.25, 1, 0.5, 1), 
                margin 0.25s cubic-bezier(0.25, 1, 0.5, 1), 
                border-color 0.2s ease, 
                background-color 0.2s ease;
}

/* Active Visible State */
body.custom-cursor-active .custom-cursor-dot,
body.custom-cursor-active .custom-cursor-circle {
    opacity: 1;
}

/* Hovering Interactive Elements (Buttons, Links, Cards, Inputs) */
body.custom-cursor-hover .custom-cursor-circle {
    width: 54px;
    height: 54px;
    margin-top: -27px;
    margin-left: -27px;
    border-color: rgba(99, 102, 241, 0.85);
    background-color: rgba(99, 102, 241, 0.08);
}

body.custom-cursor-hover .custom-cursor-dot {
    width: 4px;
    height: 4px;
    margin-top: -2px;
    margin-left: -2px;
    background-color: #6366F1;
}

/* Click / MouseDown State */
body.custom-cursor-down .custom-cursor-circle {
    width: 32px;
    height: 32px;
    margin-top: -16px;
    margin-left: -16px;
    border-color: rgba(99, 102, 241, 0.95);
    background-color: rgba(99, 102, 241, 0.16);
}

body.custom-cursor-down .custom-cursor-dot {
    transform: scale(0.8);
}

/* Dark Mode Adaptations */
html[data-theme="dark"] .custom-cursor-dot,
[data-theme="dark"] .custom-cursor-dot {
    background-color: #a5b4fc;
    box-shadow: 0 0 12px rgba(165, 180, 252, 0.65);
}

html[data-theme="dark"] .custom-cursor-circle,
[data-theme="dark"] .custom-cursor-circle {
    border-color: rgba(165, 180, 252, 0.5);
}

html[data-theme="dark"] body.custom-cursor-hover .custom-cursor-circle,
[data-theme="dark"] body.custom-cursor-hover .custom-cursor-circle {
    border-color: rgba(165, 180, 252, 0.9);
    background-color: rgba(165, 180, 252, 0.12);
}

html[data-theme="dark"] body.custom-cursor-hover .custom-cursor-dot,
[data-theme="dark"] body.custom-cursor-hover .custom-cursor-dot {
    background-color: #ffffff;
}

/* Completely disabled on mobile & touch devices */
@media (hover: none) and (pointer: coarse), (max-width: 768px) {
    .custom-cursor-dot,
    .custom-cursor-circle {
        display: none !important;
    }
}
