/* 
   CUSTOM CURSOR STYLES 
   Premium, Minimal, and Smooth
*/

:root {
    --cursor-color: #38bdf8;
    --cursor-glow: rgba(56, 189, 248, 0.6);
    --cursor-outer-opacity: 0.4;
}

/* Hide default cursor only when custom one is active */
body.has-custom-cursor,
body.has-custom-cursor a,
body.has-custom-cursor button,
body.has-custom-cursor [role="button"],
body.has-custom-cursor input,
body.has-custom-cursor textarea,
body.has-custom-cursor select {
    cursor: none !important;
}

.custom-cursor,
.custom-cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 100000;
    border-radius: 50%;
    opacity: 0; /* Hidden initially, shown via JS */
    transform: translate(-50%, -50%);
    will-change: transform, width, height, opacity;
    transition: width 0.3s cubic-bezier(0.23, 1, 0.32, 1),
                height 0.3s cubic-bezier(0.23, 1, 0.32, 1),
                opacity 0.4s ease,
                background-color 0.3s ease;
}

.custom-cursor-visible {
    opacity: 1;
}

/* Inner Dot - Precise placement */
.custom-cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--cursor-color);
    box-shadow: 0 0 20px var(--cursor-glow);
}

/* Outer Ring - Smooth trailing */
.custom-cursor {
    width: 36px;
    height: 36px;
    border: 2px solid var(--cursor-color);
    opacity: var(--cursor-outer-opacity);
    background-color: transparent;
}

/* --- INTERACTIONS --- */

/* Hover State */
.cursor-hover .custom-cursor {
    width: 60px;
    height: 60px;
    background-color: var(--cursor-color);
    opacity: 0.18;
    border-color: transparent;
}

.cursor-hover .custom-cursor-dot {
    width: 10px;
    height: 10px;
    background-color: var(--cursor-color);
    box-shadow: 0 0 35px var(--cursor-color);
}

/* Click / Active State */
.cursor-active .custom-cursor {
    width: 48px;
    height: 48px;
    background-color: var(--cursor-color);
    opacity: 0.35;
    transform: translate(-50%, -50%) scale(0.9);
}

.cursor-active .custom-cursor-dot {
    transform: translate(-50%, -50%) scale(1.6);
}

/* Theme adaptation - subtle glow shift for light mode visibility */
body.light .custom-cursor-dot {
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.8);
}

body.light .custom-cursor {
    opacity: 0.5;
    border-width: 2.5px;
}

/* --- MOBILE TOUCH EFFECT --- */
.mobile-touch-dot {
    position: fixed;
    pointer-events: none;
    z-index: 100001;
    width: 15px;
    height: 15px;
    background-color: var(--cursor-color);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
    will-change: transform, opacity;
    /* Springy scale-up, smooth fade-out */
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
                opacity 0.4s ease;
}

.mobile-touch-dot.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.7;
}

/* Ensure desktop cursor items stay hidden on touch devices */
@media (pointer: coarse) {
    .custom-cursor, .custom-cursor-dot {
        display: none !important;
    }
}
