/**
 * Petsure Effects — Cursor, Back to Top, Scroll Progress, Rotation
 *
 * Pure visual effects only. Reusable widget utilities (position-aware,
 * swiper arrows, lazy-load) are in elementor-widgets.css.
 *
 * @package Petsure_Core
 */

/* ============================================================ */
/*  CURSOR                                                      */
/* ============================================================ */

#magic-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99999;
}

#ball {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 99999;
    will-change: transform;
    transition: width 0.15s ease, height 0.15s ease,
        background 0.2s ease, border 0.2s ease,
        opacity 0.2s ease;
}

@media (hover: none) and (pointer: coarse) {
    #magic-cursor {
        display: none !important;
    }
}

/* --- Ball --- */
body[data-cursor="ball"] #ball {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--petsure-accent);
    opacity: 0.8;
    mix-blend-mode: difference;
    margin-left: -15px;
    margin-top: -15px;
}

body[data-cursor="ball"] #ball.hovered {
    width: 50px;
    height: 50px;
    margin-left: -25px;
    margin-top: -25px;
    opacity: 0.6;
}

/* --- Ring --- */
body[data-cursor="ring"] #ball {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid var(--petsure-accent);
    opacity: 0.9;
    margin-left: -18px;
    margin-top: -18px;
}

body[data-cursor="ring"] #ball.hovered {
    width: 56px;
    height: 56px;
    margin-left: -28px;
    margin-top: -28px;
    background: rgba(var(--petsure-accent-rgb), 0.15);
    border-width: 3px;
}

/* --- Dot --- */
body[data-cursor="dot"] #ball {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--petsure-accent);
    opacity: 1;
    margin-left: -5px;
    margin-top: -5px;
    box-shadow: 0 0 0 1px rgba(var(--petsure-primary-rgb), 0.08);
    transition: opacity 0.2s ease, width 0.15s ease, height 0.15s ease;
}

body[data-cursor="dot"] #ball.hovered {
    width: 7px;
    height: 7px;
    margin-left: -3.5px;
    margin-top: -3.5px;
    opacity: 0.5;
}

/* --- Crosshair --- */
body[data-cursor="crosshair"] #ball {
    width: 0;
    height: 0;
    background: transparent;
    border: none;
    margin-left: 0;
    margin-top: 0;
}

body[data-cursor="crosshair"] #ball::before,
body[data-cursor="crosshair"] #ball::after {
    content: '';
    position: absolute;
    background: var(--petsure-accent);
    border-radius: 1px;
    transition: width 0.15s ease, height 0.15s ease, opacity 0.2s ease;
}

body[data-cursor="crosshair"] #ball::before {
    width: 2px;
    height: 22px;
    top: -11px;
    left: -1px;
}

body[data-cursor="crosshair"] #ball::after {
    width: 22px;
    height: 2px;
    top: -1px;
    left: -11px;
}

body[data-cursor="crosshair"] #ball.hovered::before {
    height: 30px;
    top: -15px;
    opacity: 0.6;
}

body[data-cursor="crosshair"] #ball.hovered::after {
    width: 30px;
    left: -15px;
    opacity: 0.6;
}

/* --- Pointer Arrow --- */
body[data-cursor="pointer"] #ball {
    width: 0;
    height: 0;
    background: transparent;
    border: none;
    margin-left: 0;
    margin-top: 0;
}

body[data-cursor="pointer"] #ball::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    background: var(--petsure-accent);
    border-radius: 0 50% 50% 50%;
    opacity: 0.85;
    transform: rotate(-45deg);
    transform-origin: top left;
    filter: drop-shadow(1px 1px 2px rgba(var(--petsure-primary-rgb), 0.25));
    transition: width 0.15s ease, height 0.15s ease, opacity 0.2s ease;
}

body[data-cursor="pointer"] #ball.hovered::before {
    width: 26px;
    height: 26px;
    opacity: 0.65;
}

/* --- Custom Image --- */
body[data-cursor="custom_image"] #ball {
    width: 32px;
    height: 32px;
    border-radius: 0;
    background: transparent;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 1;
    margin-left: 0;
    margin-top: 0;
}

body[data-cursor="custom_image"] #ball.hovered {
    width: 44px;
    height: 44px;
}

/* ============================================================ */
/*  SCROLL PROGRESS BAR                                         */
/* ============================================================ */

#petsure-scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 99998;
    background: transparent;
    pointer-events: none;
}

#petsure-scroll-progress .petsure-scroll-progress-bar {
    display: block;
    width: 0%;
    height: 100%;
    background: var(--petsure-accent);
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
}

/* ============================================================ */
/*  BACK TO TOP                                                 */
/* ============================================================ */

#petsure-back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--petsure-primary);
    color: var(--petsure-white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease,
        background 0.3s ease, border-color 0.3s ease,
        box-shadow 0.3s ease;
    box-shadow: 0 0 10px 0 rgba(var(--petsure-accent-rgb), 0.1);
    outline: none;
}

#petsure-back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#petsure-back-to-top i {
    font-size: 16px;
    line-height: 1;
}

/* ---- Classic — Round, primary bg, white icon ---- */
#petsure-back-to-top:hover {
    background: var(--petsure-accent);
    box-shadow: 0 6px 20px rgba(var(--petsure-accent-rgb), 0.35);
}

/* ---- Accent — Round, accent bg, white icon ---- */
#petsure-back-to-top.style-filled {
    background: var(--petsure-accent);
    color: var(--petsure-white);
    box-shadow: 0 4px 20px rgba(var(--petsure-accent-rgb), 0.4);
}

#petsure-back-to-top.style-filled:hover {
    background: var(--petsure-primary);
    box-shadow: 0 6px 20px rgba(var(--petsure-primary-rgb), 0.35);
}

/* ---- Simple — Round, transparent, primary border, primary icon ---- */
#petsure-back-to-top.style-minimal {
    background: transparent;
    color: var(--petsure-primary);
    box-shadow: none;
    border: 2px solid rgba(var(--petsure-primary-rgb), 0.3);
}

#petsure-back-to-top.style-minimal:hover {
    background: var(--petsure-primary);
    color: var(--petsure-white);
    border-color: var(--petsure-primary);
    box-shadow: 0 4px 15px rgba(var(--petsure-primary-rgb), 0.25);
}

/* ---- Bold — Rounded square, primary bg, white icon ---- */
#petsure-back-to-top.style-solid {
    border-radius: 10px;
    width: 46px;
    height: 46px;
    background: var(--petsure-primary);
    color: var(--petsure-white);
}

#petsure-back-to-top.style-solid:hover {
    background: var(--petsure-accent);
    box-shadow: 0 6px 20px rgba(var(--petsure-accent-rgb), 0.35);
}

/* ---- Ring — Round, transparent, accent border, accent icon ---- */
#petsure-back-to-top.style-outline {
    background: transparent;
    color: var(--petsure-accent);
    box-shadow: none;
    border: 2px solid var(--petsure-accent);
}

#petsure-back-to-top.style-outline:hover {
    background: var(--petsure-accent);
    color: var(--petsure-white);
    box-shadow: 0 4px 15px rgba(var(--petsure-accent-rgb), 0.3);
}

/* ---- Frost — Glassmorphism, slightly rounded, white icon ---- */
#petsure-back-to-top.style-glass {
    background: rgba(255, 255, 255, 0.12);
    color: var(--petsure-white);
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
}

#petsure-back-to-top.style-glass:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

/* ============================================================ */
/*  SHINE / GLARE DIAGONAL EFFECT                                */
/*  Diagonal white stripe expands outward on hover.              */
/*  Apply .petsure-shine-diagonal to the image wrapper element.  */
/*  The wrapper MUST have position: relative; overflow: hidden;  */
/* ============================================================ */

.petsure-shine-diagonal::before,
.petsure-approach-image::before,
.petsure-blog-thumbnail::before,
.petsure-hero-image::before,
.petsure-author-cards-image::before,
.petsure-about-image-wrap::before,
.petsure-service-card-image::before,
.petsure-service-card-image-box-img::before,
.petsure-pb-expertise-img-inner::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 0%;
    left: 50%;
    top: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%) rotate(-45deg);
    z-index: 1;
    pointer-events: none;
}

.petsure-shine-diagonal:hover::before,
.petsure-approach-item:hover .petsure-approach-image::before,
.petsure-blog-item:hover .petsure-blog-thumbnail::before,
.petsure-hero-image:hover::before,
.petsure-author-cards-image:hover::before,
.petsure-about-image-wrap:hover::before,
.petsure-service-card:hover .petsure-service-card-image::before,
.petsure-service-card:hover .petsure-service-card-image-box-img::before,
.petsure-pb-expertise-img-wrap:hover .petsure-pb-expertise-img-inner::before {
    height: 250%;
    background-color: transparent;
    transition: all 600ms linear !important;
}

/* ============================================================ */
/*  DECORATIVE: INFINITE ROTATION                                */
/*  Used by: Text Path, Contact Circle                          */
/* ============================================================ */

.petsure-rotate-infinite {
    animation: petsure-rotate var(--petsure-rotate-speed, 20s) linear infinite;
}

.petsure-rotate-infinite:hover {
    animation-play-state: paused;
}

@keyframes petsure-rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}