/*
 * KSA premium effects layer (2026-11-10) - loaded after ksa-enhance.css.
 * - pure decoration: no layout changes, no hidden content
 * - pointer-only effects (spotlight / tilt) are gated by .ksa-fx-pointer set in ksa-effects.js
 * - everything animated is switched off under prefers-reduced-motion
 */
:root {
    --ksa-fx-1: var(--btn-primary-bg, #825D95);
    --ksa-fx-2: #b07cc6;
    --ksa-fx-3: #4fa3d9;
    --ksa-fx-glow: rgba(130, 93, 149, .28);
}
@property --ksa-fx-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* ---- page entrance --------------------------------------------------- */
@keyframes ksaFxPageIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}
.main__page__wraper > .main__page__content,
.main__page__content > .container,
.main__page__content > .container-fluid,
.invoice-container,
#content > .container {
    animation: ksaFxPageIn .55s cubic-bezier(.2, .7, .2, 1) both;
}

/* ---- scroll progress line ------------------------------------------- */
.ksa-fx-scrollbar {
    position: fixed;
    inset-inline: 0;
    top: 0;
    height: 3px;
    z-index: 10001;
    pointer-events: none;
    transform-origin: right center;
    transform: scaleX(var(--ksa-fx-scroll, 0));
    background: linear-gradient(90deg, var(--ksa-fx-3), var(--ksa-fx-2), var(--ksa-fx-1));
    box-shadow: 0 0 8px var(--ksa-fx-glow);
}
html[dir="ltr"] .ksa-fx-scrollbar, .ltr .ksa-fx-scrollbar { transform-origin: left center; }

/* ---- gradient text + animated underline for page titles -------------- */
.page__title h1, .page__title h2,
.main__page__content > .container > h1:first-child,
.header-lined h1, .ksa-fx-title {
    background: linear-gradient(100deg, currentColor 0%, currentColor 45%, var(--ksa-fx-1) 50%, currentColor 55%, currentColor 100%);
    background-size: 250% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    animation: ksaFxShine 3.2s ease .4s 1 both;
}
@keyframes ksaFxShine { to { background-position: 0 0; } }

.homepage__section__title h2, .section__title h2, .ksa-fx-underline {
    position: relative;
}
.homepage__section__title h2::after, .section__title h2::after {
    content: '';
    display: block;
    width: 64px;
    height: 3px;
    margin: 12px auto 0;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--ksa-fx-3), var(--ksa-fx-1));
    transform: scaleX(0);
    transition: transform .8s cubic-bezier(.2, .7, .2, 1) .15s;
}
.ksa-fx-seen.homepage__section__title h2::after,
.ksa-fx-seen .homepage__section__title h2::after,
.homepage__section__title.ksa-fx-seen h2::after,
.section__title.ksa-fx-seen h2::after { transform: scaleX(1); }
html:not(.ksa-fx) .homepage__section__title h2::after,
html:not(.ksa-fx) .section__title h2::after { transform: scaleX(1); }

/* ---- aurora behind the hero / page header ---------------------------- */
.main__homepage__hero, .homepage__hero, .page__header, .page__title {
    position: relative;
    isolation: isolate;
}
.main__homepage__hero::before, .homepage__hero::before, .page__header::before {
    content: '';
    position: absolute;
    inset: -20% -10% auto;
    height: 140%;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(40% 50% at 20% 30%, rgba(130, 93, 149, .18), transparent 70%),
        radial-gradient(35% 45% at 80% 20%, rgba(79, 163, 217, .14), transparent 70%),
        radial-gradient(30% 40% at 60% 80%, rgba(176, 124, 198, .12), transparent 70%);
    filter: blur(20px);
    animation: ksaFxAurora 18s ease-in-out infinite alternate;
}
@keyframes ksaFxAurora {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(3%, -2%, 0) scale(1.06); }
    100% { transform: translate3d(-3%, 2%, 0) scale(1.02); }
}

/* ---- cards: spotlight + lift + tilt ----------------------------------- */
.ksa-fx-card {
    position: relative;
    transform: perspective(900px) rotateX(var(--ksa-rx, 0deg)) rotateY(var(--ksa-ry, 0deg)) translateY(var(--ksa-lift, 0px));
    transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s ease;
    will-change: transform;
}
.ksa-fx-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity .3s ease;
    background: radial-gradient(420px circle at var(--ksa-mx, 50%) var(--ksa-my, 50%), rgba(130, 93, 149, .13), transparent 45%);
    z-index: 1;
}
.ksa-fx-pointer .ksa-fx-card:hover { --ksa-lift: -6px; box-shadow: 0 22px 45px -18px var(--ksa-fx-glow), 0 6px 14px -8px rgba(0, 0, 0, .12); }
.ksa-fx-pointer .ksa-fx-card:hover::after { opacity: 1; }
.ksa-fx-card.ksa-fx-tilting { transition: transform .08s linear, box-shadow .35s ease; }

/* icons inside service/feature cards float a bit on hover */
.ksa-fx-pointer .ksa-fx-card:hover img,
.ksa-fx-pointer .ksa-fx-card:hover svg:not(.ksa-no-fx) {
    transform: translateY(-3px) scale(1.04);
}
.ksa-fx-card img, .ksa-fx-card svg { transition: transform .4s cubic-bezier(.2, .7, .2, 1); }

/* ---- featured / popular plan: rotating gradient border --------------- */
.ksa-fx-featured {
    position: relative;
    isolation: isolate;
}
.ksa-fx-featured::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    padding: 2px;
    z-index: 2;
    pointer-events: none;
    background: conic-gradient(from var(--ksa-fx-angle), var(--ksa-fx-1), var(--ksa-fx-3), var(--ksa-fx-2), var(--ksa-fx-1));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    animation: ksaFxSpin 4s linear infinite;
}
@keyframes ksaFxSpin { to { --ksa-fx-angle: 360deg; } }

/* ---- domain search box: glow ring on focus ---------------------------- */
.home-domain-search, .domain-checker-container .input-group-box, .input-group-box {
    position: relative;
    transition: box-shadow .35s ease;
}
.home-domain-search:focus-within, .input-group-box:focus-within {
    box-shadow: 0 0 0 3px rgba(130, 93, 149, .18), 0 18px 40px -20px var(--ksa-fx-glow);
}

/* ---- primary buttons: sheen sweep -------------------------------------- */
.btn-primary, .btn-success, .btn__primary, .ksa-fx-btn {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.btn-primary::before, .btn-success::before, .btn__primary::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 45%;
    inset-inline-start: -60%;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
    transform: skewX(-20deg);
}
.ksa-fx-pointer .btn-primary:hover::before,
.ksa-fx-pointer .btn-success:hover::before,
.ksa-fx-pointer .btn__primary:hover::before {
    animation: ksaFxSheen .75s ease;
}
@keyframes ksaFxSheen { to { inset-inline-start: 120%; } }

/* magnetic pull set by JS on big call-to-action buttons */
.ksa-fx-magnet { transform: translate(var(--ksa-gx, 0), var(--ksa-gy, 0)); transition: transform .25s cubic-bezier(.2, .7, .2, 1); }

/* ---- form fields: animated gradient underline ------------------------- */
input.form-control:not([type="file"]):not(.is-invalid):not(.is-valid), textarea.form-control:not(.is-invalid):not(.is-valid) {
    background-image: linear-gradient(90deg, var(--ksa-fx-3), var(--ksa-fx-1));
    background-repeat: no-repeat;
    background-size: 0 2px;
    background-position: 50% 100%;
    transition: background-size .35s cubic-bezier(.2, .7, .2, 1), border-color .2s, box-shadow .2s;
}
input.form-control:not([type="file"]):not(.is-invalid):not(.is-valid):focus, textarea.form-control:not(.is-invalid):not(.is-valid):focus { background-size: 100% 2px; }

/* checkbox / radio: pop when checked */
input[type="checkbox"]:checked, input[type="radio"]:checked {
    animation: ksaFxPop .3s cubic-bezier(.3, 1.6, .5, 1);
}
@keyframes ksaFxPop { 50% { transform: scale(1.22); } }
input[type="checkbox"], input[type="radio"] { accent-color: var(--ksa-fx-1); }

/* ---- dropdowns + modals: glass, spring open --------------------------- */
.dropdown-menu.show {
    animation: ksaFxDrop .22s cubic-bezier(.2, .9, .3, 1.2) both;
    transform-origin: top center;
}
@keyframes ksaFxDrop {
    from { opacity: 0; transform: translateY(-6px) scale(.97); }
    to   { opacity: 1; transform: none; }
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .modal-backdrop.show { -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: .45; }
}
.modal.show .modal-dialog { animation: ksaFxModal .32s cubic-bezier(.2, .9, .3, 1.15) both; }
@keyframes ksaFxModal {
    from { opacity: 0; transform: translateY(16px) scale(.97); }
    to   { opacity: 1; transform: none; }
}

/* ---- tables: row highlight slide ------------------------------------- */
.table tbody tr { transition: background-color .2s ease, box-shadow .2s ease; }
.ksa-fx-pointer .table-hover tbody tr:hover,
.ksa-fx-pointer .dataTable tbody tr:hover {
    background-color: rgba(130, 93, 149, .05);
    box-shadow: inset -3px 0 0 var(--ksa-fx-1);
}
.ltr .ksa-fx-pointer .table-hover tbody tr:hover { box-shadow: inset 3px 0 0 var(--ksa-fx-1); }

/* ---- links in content: grow underline ---------------------------------- */
.main__page__content p a:not(.btn), .kb-article-content a:not(.btn), .ksa-fx-link {
    background-image: linear-gradient(currentColor, currentColor);
    background-repeat: no-repeat;
    background-size: 0 1px;
    background-position: 100% 100%;
    transition: background-size .3s ease;
    text-decoration: none;
}
.main__page__content p a:not(.btn):hover, .kb-article-content a:not(.btn):hover { background-size: 100% 1px; }

/* ---- alerts / labels: soft entrance ---------------------------------- */
.alert { animation: ksaFxPageIn .45s ease both; }
.label-success, .status-active, .badge-success { position: relative; }
.status-active::before, .label-success.ksa-fx-live::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-inline-end: 6px;
    border-radius: 50%;
    background: currentColor;
    vertical-align: middle;
    animation: ksaFxPulse 1.8s ease-out infinite;
}
@keyframes ksaFxPulse {
    0%   { box-shadow: 0 0 0 0 rgba(40, 167, 69, .5); }
    100% { box-shadow: 0 0 0 7px rgba(40, 167, 69, 0); }
}

/* ---- sidebar menu items: slide indicator ------------------------------ */
.ksa-fx-pointer .list-group-item-action,
.ksa-fx-pointer .sidebar__menu__item > a {
    transition: background-color .2s ease, padding .25s ease, color .2s ease;
}
.ksa-fx-pointer .list-group-item-action:hover { padding-inline-start: 1.6rem; }

/* ---- error page --------------------------------------------------------- */
.error-container {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 30px 60px -30px var(--ksa-fx-glow);
    animation: ksaFxPageIn .6s ease both;
}

/* ---- accessibility / motion ------------------------------------------- */
@media (hover: none), (pointer: coarse) {
    .ksa-fx-card { transform: none !important; }
}
@media (prefers-reduced-motion: reduce) {
    .ksa-fx-scrollbar { display: none; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .ksa-fx-card { transform: none !important; }
}
@media print {
    .ksa-fx-scrollbar, .ksa-fx-featured::before, .main__homepage__hero::before { display: none !important; }
}
