/* src/main/resources/static/css/makuta-loader.css */
:root {
    --makuta-primary: #0038c7;
    --makuta-primary-dark: #002a99;
    --makuta-accent: #02c669;
}

.makuta-page-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
            radial-gradient(circle at top, rgba(2, 198, 105, 0.12), transparent 32%),
            linear-gradient(135deg, rgba(0, 42, 153, 0.96), rgba(0, 56, 199, 0.94));
    color: #ffffff;
    transition: opacity 320ms ease, visibility 320ms ease;
}

.makuta-page-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.makuta-loader-card {
    width: min(420px, 100%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 28px;
    padding: 32px 28px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(18px);
    text-align: center;
}

.makuta-loader-logo-wrap {
    width: 108px;
    height: 108px;
    margin: 0 auto 22px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
}

.makuta-loader-logo-wrap::before,
.makuta-loader-logo-wrap::after {
    content: "";
    position: absolute;
    inset: -9px;
    border-radius: inherit;
    border: 2px solid rgba(255, 255, 255, 0.26);
    animation: makuta-loader-pulse 1.8s ease-out infinite;
}

.makuta-loader-logo-wrap::after {
    animation-delay: 0.6s;
}

.makuta-loader-logo {
    width: 76px;
    height: auto;
    position: relative;
    z-index: 1;
}

.makuta-loader-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.makuta-loader-message {
    min-height: 42px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.94rem;
    line-height: 1.45;
}

.makuta-loader-progress {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 8px;
    margin-top: 24px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
}

.makuta-loader-progress::before {
    content: "";
    position: absolute;
    inset: 0;
    width: 42%;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, #ffffff, var(--makuta-accent));
    animation: makuta-loader-progress 1.35s ease-in-out infinite;
}

.makuta-loader-hint {
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.78rem;
}

.makuta-htmx-loader {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 99990;
    display: none;
    align-items: center;
    gap: 10px;
    max-width: min(360px, calc(100vw - 40px));
    padding: 12px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(229, 231, 235, 0.9);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
    color: #1f2937;
    font-size: 0.86rem;
    font-weight: 700;
}

.makuta-htmx-loader.is-visible {
    display: flex;
}

.makuta-htmx-spinner,
.makuta-button-spinner {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 3px solid rgba(0, 56, 199, 0.18);
    border-top-color: var(--makuta-primary);
    animation: makuta-loader-spin 0.8s linear infinite;
}

.makuta-button-spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
    border-color: rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
}

.makuta-skeleton {
    position: relative;
    overflow: hidden;
    background: #eef2f7;
    border-radius: 14px;
}

.makuta-skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
    animation: makuta-skeleton-shimmer 1.35s infinite;
}

@keyframes makuta-loader-pulse {
    0% {
        transform: scale(0.82);
        opacity: 0.9;
    }

    100% {
        transform: scale(1.22);
        opacity: 0;
    }
}

@keyframes makuta-loader-progress {
    0% {
        transform: translateX(-120%);
    }

    100% {
        transform: translateX(260%);
    }
}

@keyframes makuta-loader-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes makuta-skeleton-shimmer {
    100% {
        transform: translateX(100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .makuta-loader-logo-wrap::before,
    .makuta-loader-logo-wrap::after,
    .makuta-loader-progress::before,
    .makuta-htmx-spinner,
    .makuta-button-spinner,
    .makuta-skeleton::after {
        animation: none;
    }
}