/* HMAC Shield Cursor Trail - CSP Compliant */
/* Unique mouse trail for HMAC-Protected Circuit Breaker - Security themed */

.circuit-cursor-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 999999;
    overflow: hidden;
}

.circuit-cursor-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* Custom circuit breaker cursor */
.circuit-cursor {
    position: fixed;
    display: block !important;
    width: 52px;
    height: 52px;
    pointer-events: none;
    z-index: 9999999;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    opacity: 0;
}

.circuit-cursor.active {
    opacity: 1;
}

/* Cursor core - shield with HMAC lock */
.circuit-cursor-core {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, #f59e0b 0%, #d97706 50%, #92400e 100%);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    box-shadow:
        0 0 12px rgba(245, 158, 11, 1),
        0 0 28px rgba(217, 119, 6, 0.8),
        0 0 45px rgba(245, 158, 11, 0.4);
    animation: circuitCorePulse 1.8s ease-in-out infinite;
}

@keyframes circuitCorePulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow:
            0 0 12px rgba(245, 158, 11, 1),
            0 0 28px rgba(217, 119, 6, 0.8);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.25);
        box-shadow:
            0 0 18px rgba(245, 158, 11, 1),
            0 0 40px rgba(217, 119, 6, 1),
            0 0 60px rgba(245, 158, 11, 0.5);
    }
}

/* Outer rotating ring - circuit trace style */
.circuit-cursor-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(245, 158, 11, 0.7);
    border-top-color: transparent;
    border-bottom-color: transparent;
    border-radius: 4px;
    animation: circuitRingRotate 3s linear infinite;
    box-shadow:
        0 0 8px rgba(245, 158, 11, 0.5),
        inset 0 0 8px rgba(251, 191, 36, 0.1);
}

.circuit-cursor-ring::before,
.circuit-cursor-ring::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: #f59e0b;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(245, 158, 11, 1);
}

.circuit-cursor-ring::before {
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
}

.circuit-cursor-ring::after {
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
}

@keyframes circuitRingRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Electric arc outer ring */
.circuit-cursor-arc {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    transform: translate(-50%, -50%);
    border: 1px dashed rgba(251, 191, 36, 0.35);
    border-radius: 50%;
    animation: circuitArcPulse 2.2s ease-out infinite;
}

@keyframes circuitArcPulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.2);
        opacity: 0;
    }
}

/* Hide default cursor when custom cursor is active */
body.circuit-cursor-active {
    cursor: none !important;
}

body.circuit-cursor-active * {
    cursor: none !important;
}

body.circuit-cursor-active a,
body.circuit-cursor-active button,
body.circuit-cursor-active input,
body.circuit-cursor-active textarea,
body.circuit-cursor-active select,
body.circuit-cursor-active [role="button"],
body.circuit-cursor-active .tab-btn,
body.circuit-cursor-active .footer-link,
body.circuit-cursor-active .logo-link {
    cursor: none !important;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .circuit-cursor-core,
    .circuit-cursor-ring,
    .circuit-cursor-arc {
        animation: none;
    }

    body.circuit-cursor-active {
        cursor: auto;
    }

    body.circuit-cursor-active * {
        cursor: auto;
    }

    .circuit-cursor {
        display: none;
    }
}

/* Mobile - disable custom cursor */
@media (max-width: 768px), (pointer: coarse) {
    .circuit-cursor-container {
        display: none;
    }

    .circuit-cursor {
        display: none;
    }

    body.circuit-cursor-active,
    body.circuit-cursor-active * {
        cursor: auto;
    }
}
