/* MeGiWeb additive UX effects.
 * Kept separate from the historical minified bundle so new interactions cannot
 * silently disappear when that bundle is stale.
 */

/* Egységes PrimeFaces globális AJAX állapotjelző. A p:ajaxStatus start facetje
 * csak a global=true AJAX kérések idejére rendereli a maszkot. */
.megi-global-loader-mask {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 50% 42%, rgba(33, 150, 243, .16), transparent 30%),
        rgba(8, 24, 42, .64);
    backdrop-filter: blur(5px);
}

.megi-global-loader-card {
    position: relative;
    display: flex;
    width: min(400px, calc(100vw - 42px));
    flex-direction: column;
    align-items: center;
    gap: 9px;
    padding: 28px 30px 26px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .68);
    border-radius: 22px;
    background:
        radial-gradient(circle at 90% 0%, rgba(33, 150, 243, .12), transparent 36%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 28px 88px rgba(4, 22, 38, .34);
    color: var(--text-dark, #222);
    text-align: center;
    animation: megiGlobalLoaderEnter .18s ease-out both;
}

.megi-global-loader-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #2196f3, #14b8a6, transparent);
    background-size: 180% 100%;
    animation: megiGlobalLoaderShimmer 2.2s linear infinite;
}

.megi-global-loader-card strong {
    color: #133f65;
    font-size: 1rem;
    line-height: 1.35;
}

.megi-global-loader-card > span {
    color: var(--text-muted, #66717d);
    font-size: .85rem;
}

.megi-global-loader-visual {
    position: relative;
    display: grid;
    place-items: center;
    width: 78px;
    height: 78px;
    margin-bottom: 4px;
}

.megi-global-loader-visual > i {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 13px;
    background: linear-gradient(145deg, #2196f3, #0877ca);
    color: #fff;
    box-shadow: 0 8px 22px rgba(33, 150, 243, .28);
    font-size: 17px;
    animation: megiGlobalLoaderPulse 1.6s ease-in-out infinite;
}

.megi-global-loader-ring {
    position: absolute;
    inset: 1px;
    border: 1.5px dashed rgba(33, 150, 243, .38);
    border-radius: 50%;
    animation: megiGlobalLoaderSpin 4.5s linear infinite;
}

.megi-global-loader-ring-inner {
    inset: 12px;
    border-color: rgba(20, 184, 166, .42);
    animation-duration: 2.9s;
    animation-direction: reverse;
}


@keyframes megiGlobalLoaderSpin {
    to { transform: rotate(360deg); }
}

@keyframes megiGlobalLoaderPulse {
    0%, 100% { transform: scale(.96); }
    50% { transform: scale(1.04); }
}

@keyframes megiGlobalLoaderShimmer {
    to { background-position: -180% 0; }
}

@keyframes megiGlobalLoaderEnter {
    from { opacity: 0; transform: translateY(8px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}



@media (max-width: 576px) {
    .megi-global-loader-card {
        padding: 25px 20px 23px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .megi-global-loader-card,
    .megi-global-loader-card::before,
    .megi-global-loader-ring,
    .megi-global-loader-visual > i {
        animation: none !important;
    }
}
