/* App shell styles - Static HTML shown while Blazor loads */
/* Shared across all CDPHE Health Informatics applications */

.app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    background-color: #f5f5f5;
}

/* Header that mimics MudAppBar */
.app-shell-header {
    background-color: #594ae2;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1100;
    min-height: 64px;
    display: flex;
    align-items: center;
    padding: 0 16px;
}

.app-shell-header-content {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 16px;
}

.app-shell-menu-btn {
    background: transparent;
    border: none;
    color: inherit;
    cursor: not-allowed;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    opacity: 0.7;
}

.app-shell-menu-btn svg {
    width: 24px;
    height: 24px;
}

.app-shell-title {
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.6;
    letter-spacing: 0.0075em;
}

/* Content area with centered loading indicator */
.app-shell-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.app-shell-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.app-shell-loading .loading-logo {
    animation: fadeIn 0.4s ease-out;
    margin-bottom: 1rem;
}

.app-shell-loading .loading-logo img {
    max-width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

.app-shell-loading .loading-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
    color: #555;
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 500;
    max-width: 90%;
    padding: 0 1rem;
    animation: fadeIn 0.6s ease-out 0.2s both;
}

.app-shell-loading .loading-text span:first-child {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    margin-bottom: 1rem;
}

.app-shell-loading .loading-bar {
    width: 320px;
    max-width: 90%;
    height: 4px;
    background-color: #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.6s ease-out 0.3s both;
}

.app-shell-loading .loading-bar-progress {
    height: 100%;
    background: linear-gradient(90deg, #594ae2 0%, #7c6ff0 50%, #594ae2 100%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: loadingBarSlide 1.8s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(89, 74, 226, 0.5);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes loadingBarSlide {
    0% {
        width: 0%;
        margin-left: 0%;
        background-position: 0% 0%;
    }
    50% {
        width: 75%;
        margin-left: 0%;
        background-position: 100% 0%;
    }
    100% {
        width: 0%;
        margin-left: 100%;
        background-position: 0% 0%;
    }
}

/* Hide app shell once Blazor has loaded with fade animation */
#app {
    animation: blazorAppFadeIn 0.5s ease-out;
}

/* App shell fade out animation when Blazor loads */
.app-shell-fade-out {
    animation: fadeOut 0.4s ease-out forwards;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes blazorAppFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .app-shell-header {
        background-color: #1e1e1e;
    }

    .app-shell-loading .loading-logo img {
        filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
    }

    .app-shell-loading .loading-text {
        color: #aaa;
    }

    .app-shell-loading .loading-text span:first-child {
        color: #ddd;
    }

    .app-shell-loading .loading-bar {
        background-color: #2a2a2a;
        box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
    }

    .app-shell-loading .loading-bar-progress {
        box-shadow: 0 0 10px rgba(89, 74, 226, 0.7);
    }
}
