/**
 * CursorCraft Pro Styles
 */

/* Backdrop Filter Invert & Frosted Glass */
.cursorcraft-cursor-builder-for-elementor-container.acb-pro-backdrop-invert {
    backdrop-filter: invert(1);
    -webkit-backdrop-filter: invert(1);
    overflow: hidden !important;
    isolation: isolate;
}

/* 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;
}

/* Dynamic data-cursor-text Auto-Hover Text Badge (Pro) */
body.cursorcraft-has-dynamic-text .cursorcraft-cursor-builder-for-elementor-container {
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s ease 0.2s !important;
}

.cursorcraft-auto-hover-badge {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate3d(-9999px, -9999px, 0) translate(-50%, -50%) scale(0.5);
    opacity: 0;
    visibility: hidden;
    background: rgba(8, 11, 19, 0.95);
    color: #ffffff;
    padding: 8px 18px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(124, 58, 237, 0.35);
    z-index: 99999998;
    will-change: transform, opacity;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.cursorcraft-auto-hover-badge.is-visible {
    visibility: visible;
}

/* =====================================
   Floating Media Preview Card (Pro)
===================================== */
.cursorcraft-media-preview-card {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate3d(-9999px, -9999px, 0) translate(-50%, -50%) scale(0.65);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 99999995;
    overflow: hidden;
    background: #0f172a;
    will-change: transform, opacity;
    display: block;
    border-radius: 12px;
    box-sizing: border-box;
}

.cursorcraft-media-preview-card img {
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover;
    object-position: center center;
    display: block !important;
    pointer-events: none;
    border-radius: inherit;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.cursorcraft-media-preview-card.is-visible {
    visibility: visible;
}

/* Shadow variants */
.cursorcraft-media-preview-card.shadow-elevation {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.cursorcraft-media-preview-card.shadow-subtle {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.cursorcraft-media-preview-card.shadow-glow {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 25px rgba(99, 102, 241, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.cursorcraft-media-preview-card.shadow-none {
    box-shadow: none;
}

.cursorcraft-cursor-builder-for-elementor-container .cursorcraft-dynamic-text {
    transition: opacity 0.2s ease;
}

/* 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;
}

.acb-pro-text-follow-trail,
.acb-pro-custom-follow-trail,
.cursorcraft-cursor-builder-for-elementor-container.acb-pro-trail {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    position: fixed !important;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.acb-pro-text-follow-trail.is-active,
.acb-pro-custom-follow-trail.is-active,
.cursorcraft-cursor-builder-for-elementor-container.acb-pro-trail.is-active {
    opacity: var(--trail-opacity, 1) !important;
    visibility: visible !important;
}

.acb-pro-text-follow-trail {
    top: 0 !important;
    left: 0 !important;
    display: inline-block !important;
    will-change: transform;
    user-select: none;
    -webkit-user-select: none;
    z-index: 99999996;
}

/* 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: 99999998; /* 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;
    }
}

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

.cursorcraft-trail-image {
    position: fixed;
    pointer-events: none;
    z-index: 99999996;
    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));
    }
}

/* 3D Card Tilt & Parallax Physics */
.cursorcraft-tilt-card {
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.15s cubic-bezier(0.2, 0, 0.2, 1);
    position: relative;
}

.cursorcraft-tilt-glare {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    border-radius: inherit;
    overflow: hidden;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s ease;
    mix-blend-mode: overlay;
}

.cursorcraft-tilt-card .cursorcraft-tilt-layer,
.cursorcraft-tilt-card .cursorcraft-parallax-layer,
.cursorcraft-tilt-card [data-parallax-depth] {
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.15s cubic-bezier(0.2, 0, 0.2, 1);
}
