/**
 * Layers Loading Screen
 * Centered branding
 */

/* Loading overlay */
#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg);
    opacity: 1;
    transition: opacity var(--transition-slow);
}

#loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

#loading-screen.hidden {
    display: none;
}

/* Loading modal dialog */
.loading-modal {
    position: relative;
    width: 420px;
    height: 280px;
    background: var(--color-glass);
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Brand text */
.loading-brand {
    position: relative;
    z-index: 1;
    text-align: center;
}

.loading-logo {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    color: var(--color-text-primary);
    filter: drop-shadow(0 0 20px color-mix(in srgb, var(--color-accent) 40%, transparent));
    animation: title-glow 3s ease-in-out infinite alternate;
}

.loading-title {
    font-family: var(--font-accent);
    font-size: 42px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
    text-shadow:
        0 0 40px color-mix(in srgb, var(--color-accent) 40%, transparent),
        0 0 80px color-mix(in srgb, var(--color-accent) 20%, transparent);
    animation: title-glow 3s ease-in-out infinite alternate;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
}

.loading-title span {
    display: block;
}

@keyframes title-glow {
    0% {
        text-shadow:
            0 0 40px color-mix(in srgb, var(--color-accent) 30%, transparent),
            0 0 80px color-mix(in srgb, var(--color-accent) 15%, transparent);
    }
    100% {
        text-shadow:
            0 0 50px color-mix(in srgb, var(--color-accent) 50%, transparent),
            0 0 100px color-mix(in srgb, var(--color-accent) 25%, transparent);
    }
}

/* Tagline */
.loading-tagline {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 400;
    color: var(--color-text-muted);
    margin: 8px 0 0;
    opacity: 0.8;
}

/* Loading status */
.loading-status {
    margin-top: 24px;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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