/**
 * CursorCraft Pro Styles
 */

/* Backdrop Filter Invert */
.cursorcraft-cursor-builder-for-elementor-container.acb-pro-backdrop-invert {
    backdrop-filter: invert(1);
    -webkit-backdrop-filter: invert(1);
    /* Note: Elementor's background color might interfere if it's completely opaque. 
       We rely on users setting transparent/semi-transparent backgrounds. */
}

/* Hover Text Styling */
.cursorcraft-cursor-builder-for-elementor-container .acb-pro-hover-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    white-space: nowrap;
    text-align: center;
    
    /* Default styling, can be overridden by Elementor controls */
    font-size: 14px;
    font-weight: 600;
    color: #000;
    
    /* Anti-aliasing to prevent blur during parent scale */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    backface-visibility: hidden;
}

.cursorcraft-cursor-builder-for-elementor-container .acb-pro-hover-text.is-visible {
    opacity: 1;
}

/* Ensure the container doesn't block pointer events */
.cursorcraft-cursor-builder-for-elementor-container {
    pointer-events: none;
}

/* -------------------------------------
   Advanced Pro Effects
-------------------------------------- */

.cursorcraft-cursor-builder-for-elementor-container.acb-pro-trail {
    /* Trail clones inherit from the base container, but we ensure they remain non-interactive */
    pointer-events: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    width: var(--width, var(--container-widget-width, max-content)) !important;
    min-width: var(--width, var(--container-widget-width, 0)) !important;
}

/* Idle Animation */
.cursorcraft-cursor-builder-for-elementor-container.acb-pro-idle {
    /* Opacity pulsing is handled in CSS, scale pulsing in JS */
    animation: acb-pro-idle-opacity 2.5s infinite ease-in-out;
}

@keyframes acb-pro-idle-opacity {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* Circular Text */
.cursorcraft-cursor-builder-for-elementor-container .acb-pro-circular-text {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    animation: acb-pro-spin 10s infinite linear;
    pointer-events: none;
    /* Typography is overridden by Elementor controls */
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
}

.cursorcraft-cursor-builder-for-elementor-container .acb-pro-circular-text span {
    position: absolute;
    left: 50%;
    top: 50%;
    transform-origin: 0 0;
    white-space: nowrap;
}

@keyframes acb-pro-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Click Ripple Animation */
.acb-pro-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: none;
    animation: acb-pro-ripple-anim 0.4s ease-out forwards;
    border: 1px solid currentColor;
}
@keyframes acb-pro-ripple-anim {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; border-width: 2px; }
    100% { transform: translate(-50%, -50%) scale(5); opacity: 0; border-width: 0px; }
}



/* Water Ripple Effect */
.cursorcraft-ripple {
    position: fixed;
    width: 30px;
    height: 30px;
    border: 2px solid;
    border-radius: 50%;
    pointer-events: none;
    z-index: 999998; /* just below cursor */
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    animation: cursorcraft-ripple-anim 0.6s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

@keyframes cursorcraft-ripple-anim {
    to {
        transform: translate(-50%, -50%) scale(4);
        opacity: 0;
    }
}

/* Spotlight Overlay */
.cursorcraft-spotlight-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 999998;
    backdrop-filter: brightness(var(--spotlight-brightness)) blur(var(--spotlight-blur));
    -webkit-backdrop-filter: brightness(var(--spotlight-brightness)) blur(var(--spotlight-blur));
    -webkit-mask-image: radial-gradient(circle at var(--mouse-x) var(--mouse-y), transparent 0px, transparent var(--spotlight-size), black calc(var(--spotlight-size) + var(--spotlight-softness)));
    mask-image: radial-gradient(circle at var(--mouse-x) var(--mouse-y), transparent 0px, transparent var(--spotlight-size), black calc(var(--spotlight-size) + var(--spotlight-softness)));
}

/* Premium Cursor Trails */
.cursorcraft-trail-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 999997; /* Just below the cursor */
}

.cursorcraft-trail-image {
    position: fixed;
    pointer-events: none;
    z-index: 999996;
    transform: translate(-50%, -50%);
    object-fit: cover;
    width: 200px;
    height: 250px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    animation: cursorcraft-trail-image-anim var(--trail-lifetime, 1000ms) cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes cursorcraft-trail-image-anim {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8) rotate(var(--trail-rot-start, -5deg));
    }
    10% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.05) rotate(var(--trail-rot-mid, 0deg));
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotate(var(--trail-rot-mid, 0deg));
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotate(var(--trail-rot-mid, 0deg));
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.6) rotate(var(--trail-rot-end, 10deg));
    }
}
