/**
 * Custom Cursor - Halo Style
 * BMC Clinic - Minimalist Cyan Glow Cursor
 */

/* Hide default cursor on desktop */
@media (hover: hover) and (pointer: fine) {
    body {
        cursor: none !important;
    }
    
    a, button, input, textarea, select, label,
    [role="button"], .btn, .clickable, [onclick] {
        cursor: none !important;
    }
}

/* ==========================================
   CURSOR ELEMENTS
   ========================================== */

/* Main Cursor Container */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 99999;
    mix-blend-mode: normal;
}

/* Cursor Dot (center) */
.cursor-dot {
    position: fixed;
    width: 8px;
    height: 8px;
    background: rgba(12, 157, 219, 0.9);
    border-radius: 50%;
    pointer-events: none;
    z-index: 100001;
    transform: translate(-50%, -50%);
    transition: 
        width 0.3s cubic-bezier(0.25, 1, 0.5, 1),
        height 0.3s cubic-bezier(0.25, 1, 0.5, 1),
        background 0.3s ease,
        opacity 0.3s ease;
}

/* Cursor Halo (outer ring with blur) */
.cursor-halo {
    position: fixed;
    width: 40px;
    height: 40px;
    border: 2px solid rgba(12, 157, 219, 0.4);
    border-radius: 50%;
    pointer-events: none;
    z-index: 100000;
    transform: translate(-50%, -50%);
    transition: 
        width 0.4s cubic-bezier(0.25, 1, 0.5, 1),
        height 0.4s cubic-bezier(0.25, 1, 0.5, 1),
        border-color 0.3s ease,
        background 0.3s ease,
        opacity 0.3s ease,
        filter 0.3s ease;
    filter: blur(1px);
    background: rgba(12, 157, 219, 0.03);
}

/* ==========================================
   CURSOR STATES
   ========================================== */

/* Hover State - Buttons, Links */
.cursor-dot.is-hovering {
    width: 12px;
    height: 12px;
    background: rgba(0, 217, 165, 1);
    box-shadow: 0 0 20px rgba(0, 217, 165, 0.5);
}

.cursor-halo.is-hovering {
    width: 60px;
    height: 60px;
    border-color: rgba(0, 217, 165, 0.6);
    background: rgba(0, 217, 165, 0.08);
    filter: blur(2px);
}

/* Click State */
.cursor-dot.is-clicking {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 1);
}

.cursor-halo.is-clicking {
    width: 30px;
    height: 30px;
    border-color: rgba(12, 157, 219, 0.8);
    background: rgba(12, 157, 219, 0.15);
}

/* Text Input State */
.cursor-dot.is-text {
    width: 3px;
    height: 25px;
    border-radius: 2px;
    background: rgba(12, 157, 219, 0.8);
}

.cursor-halo.is-text {
    width: 30px;
    height: 35px;
    border-radius: 4px;
    border-color: rgba(12, 157, 219, 0.3);
}

/* Hidden State (outside viewport or on touch) */
.cursor-dot.is-hidden,
.cursor-halo.is-hidden {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
}

/* Active/Drag State */
.cursor-dot.is-active {
    width: 5px;
    height: 5px;
}

.cursor-halo.is-active {
    width: 50px;
    height: 50px;
    border-width: 3px;
    border-color: rgba(12, 157, 219, 0.7);
}

/* Slider/Drag Hint */
.cursor-dot.is-slider {
    width: 60px;
    height: 60px;
    background: transparent;
    border: 2px solid rgba(12, 157, 219, 0.5);
}

.cursor-halo.is-slider {
    width: 80px;
    height: 80px;
    opacity: 0;
}

.cursor-dot.is-slider::before {
    content: '↔';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(12, 157, 219, 0.8);
    font-size: 20px;
}

/* ==========================================
   SPECIAL ELEMENTS HOVER STATES
   ========================================== */

/* Image Gallery Hover */
.cursor-dot.is-gallery {
    width: 70px;
    height: 70px;
    background: rgba(12, 157, 219, 0.1);
    border: 2px solid rgba(12, 157, 219, 0.4);
}

.cursor-dot.is-gallery::before {
    content: '+';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 30px;
    font-weight: 300;
}

.cursor-halo.is-gallery {
    opacity: 0;
}

/* Video Play Hover */
.cursor-dot.is-video {
    width: 80px;
    height: 80px;
    background: rgba(12, 157, 219, 0.15);
    border: 2px solid rgba(12, 157, 219, 0.5);
}

.cursor-dot.is-video::before {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 20px;
    padding-left: 4px;
}

.cursor-halo.is-video {
    opacity: 0;
}

/* ==========================================
   MAGNETIC EFFECT (for buttons)
   ========================================== */
.cursor-magnetic {
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ==========================================
   TRAIL EFFECT (optional)
   ========================================== */
.cursor-trail {
    position: fixed;
    width: 6px;
    height: 6px;
    background: rgba(12, 157, 219, 0.3);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.1s ease;
}

.cursor-trail.visible {
    opacity: 1;
}

/* ==========================================
   RESPONSIVE - Hide on Touch Devices
   ========================================== */
@media (hover: none), (pointer: coarse) {
    .custom-cursor,
    .cursor-dot,
    .cursor-halo,
    .cursor-trail {
        display: none !important;
    }
    
    body,
    a, button, input, textarea, select, label,
    [role="button"], .btn, .clickable, [onclick] {
        cursor: auto !important;
    }
}

/* ==========================================
   REDUCED MOTION
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    .cursor-dot,
    .cursor-halo {
        transition: none !important;
    }
}

/* ==========================================
   DARK SECTIONS ADJUSTMENT
   ========================================== */
.section-dark .cursor-dot,
.hero-carousel-section .cursor-dot {
    background: rgba(255, 255, 255, 0.9);
}

.section-dark .cursor-halo,
.hero-carousel-section .cursor-halo {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.05);
}

.section-dark .cursor-dot.is-hovering,
.hero-carousel-section .cursor-dot.is-hovering {
    background: rgba(0, 217, 165, 1);
}

.section-dark .cursor-halo.is-hovering,
.hero-carousel-section .cursor-halo.is-hovering {
    border-color: rgba(0, 217, 165, 0.6);
    background: rgba(0, 217, 165, 0.1);
}
