/* Hide Blazor reconnecting */
/* Hide all reconnect states */
#components-reconnect-modal,
.components-reconnect-hide,
.components-reconnect-show,
.components-reconnect-failed,
.components-reconnect-rejected {
    display: none !important;
}

/* Initial loading spinner */
.app-initial-loader {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.75rem;
    background-color: var(--mud-palette-background, #f6f7fb);
    z-index: 2147483646;
}

.app-initial-loader.is-active {
    display: flex;
}

.app-initial-loader[data-hidden="true"] {
    display: none;
}

.app-initial-loader__spinner {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 6px solid rgba(0, 0, 0, 0.15);
    border-top-color: var(--mud-palette-primary, #1b6ffb);
    animation: app-initial-spin 0.8s linear infinite;
}

.app-initial-loader__title {
    font-size: 1.05rem;
    letter-spacing: 0.06em;
    color: rgba(0, 0, 0, 0.7);
}

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

/* Smooth page transitions to prevent flicker */
/* Ensure content maintains minimum opacity during navigation */
.mud-main-content,
.mud-layout,
body > app {
    min-height: 100vh;
    background-color: var(--mud-palette-background, #fff);
}

/* Reduce flicker by maintaining a skeleton during navigation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Apply smooth fade-in only to /app pages (non-prerendered server pages) */
/* This helps mask the SignalR connection establishment time */
.app-page-content .mud-container,
.app-page-content > div {
    animation: fadeIn 0.15s ease-in;
}

.app-bar-title {
    margin-left: 1.5rem;
    font-size: 1.25rem;
    line-height: 1.6rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 45vw;
    flex: 0 1 auto;
}

.app-bar-title.mud-typography-h6 {
    font-size: 1.25rem;
}

@media (max-width: 600px) {
    .app-bar-brand {
        font-size: 1.05rem;
    }

    .app-bar-title {
        margin-left: 0.5rem;
        max-width: 55vw;
        font-size: 1rem;
        line-height: 1.3rem;
    }

    .app-bar-title.mud-typography-h6 {
        font-size: 1rem;
    }
}
