/* assets/css/preloader.css */

#app-preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background-color: var(--bg-body, #020203);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
}

#app-preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    animation: preloader-in 1s ease-out;
}

@keyframes preloader-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.preloader-image-container {
    position: relative;
    width: 120px;
    height: 120px;
    padding: 8px;
    border-radius: 50%;
    background: var(--bg-card, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.preloader-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.preloader-placeholder-icon {
    font-size: 48px;
    color: var(--primary, #C5A02B);
}

.preloader-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    padding: 4px;
    background: conic-gradient(from 0deg, var(--primary, #C5A02B), transparent 60%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.preloader-text {
    font-family: 'Sora', sans-serif;
    color: #FFFFFF;
    /* High contrast white */
    letter-spacing: 0.4em;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.85rem;
    opacity: 1;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.preloader-shimmer {
    background: linear-gradient(90deg,
            #ffffff 0%,
            var(--primary) 50%,
            #ffffff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 2.5s linear infinite;
}

@keyframes progress-fast {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.animate-progress-fast {
    animation: progress-fast 1.5s infinite linear;
}

@keyframes shimmer {
    to {
        background-position: -200% 0;
    }
}

.preloader-footer {
    position: absolute;
    bottom: 3rem;
    font-size: 0.65rem;
    color: var(--text-muted, #8E9196);
    letter-spacing: 1px;
}

/* Inline Version for Sections/Modals */
.preloader-inline {
    width: 100%;
    grid-column: 1 / -1;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.preloader-inline .preloader-content {
    gap: 1.5rem;
}

.preloader-inline .preloader-image-container {
    width: 100px;
    height: 100px;
    border-radius: 50%;
}

.preloader-inline .preloader-img {
    border-radius: 50%;
}

.preloader-inline .preloader-ring {
    border-radius: 50%;
}

.preloader-inline .preloader-placeholder-icon {
    font-size: 32px;
}

.preloader-inline .preloader-text {
    font-size: 0.75rem;
}