/* ============================================================
   App-level styles — MudBlazor handles all component styling.
   Keep this file minimal.
   ============================================================ */

/* Ensure full-height layout */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Always show the vertical scrollbar track so the content width never
   changes when content grows or shrinks (e.g. during auth transitions).
   overflow-y: scroll is more reliable than scrollbar-gutter: stable because
   it works regardless of MudBlazor injected scrollbar CSS or browser quirks. */
html {
    overflow-y: scroll;
}

/* ── Loading screen ────────────────────────────────────────── */
.app-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: #f7f7ff;
}

/* Pulsing logo — used everywhere a spinner was used */
@keyframes logo-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.15; }
}

.logo-pulse {
    animation: logo-pulse 1.6s ease-in-out infinite;
}

/* Pre-Blazor full-screen loader (App.razor initial state) */
.app-loading-icon {
    width: 96px;
    height: 96px;
    animation: logo-pulse 1.6s ease-in-out infinite;
}

/* ── Blazor error UI ───────────────────────────────────────── */
#blazor-error-ui {
    background: #ea526f;
    color: #ffffff;
    bottom: 0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.75rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 9999;
    font-family: 'Noto Sans', sans-serif;
    font-size: 0.875rem;
}

#blazor-error-ui a {
    color: #ffffff;
    font-weight: 600;
    margin-left: 0.5rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.8;
}

.blazor-error-boundary {
    padding: 1rem 1rem 1rem 3.5rem;
    background: #ea526f;
    color: white;
    border-radius: 8px;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* Optical sizing: tells Noto Sans to adjust letterform details per rendered size.
   Works in tandem with the opsz axis loaded via Google Fonts variable font. */
html {
    font-optical-sizing: auto;
}

/* Tabular numbers on data columns: prevents digit-width jitter when values
   update and ensures numeric columns align correctly in MudDataGrid. */
.tnum,
.mud-table-cell.tnum,
.mud-data-grid .mud-table-cell:has(.tnum) {
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

/* ── Deep-link row highlight (search → project tab navigation) ── */
/* Applied via RowClassFunc on MudDataGrid when a Highlight query param
   is present. Uses a CSS class (not RowStyleFunc inline style) so the
   animation can override background-color without inline-style specificity
   blocking it. Reduced-motion users get the static tint only. */

@keyframes highlight-fade-in {
    from { background-color: rgba(245, 158, 11, 0.38); }
    to   { background-color: rgba(245, 158, 11, 0.14); }
}

.row-deep-link-highlight {
    background-color: rgba(245, 158, 11, 0.14);
}

@media (prefers-reduced-motion: no-preference) {
    .row-deep-link-highlight {
        animation: highlight-fade-in 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
}

/* ── Navigation drawer active item ────────────────────────── */
/* MudBlazor's default active tint (Primary at 12% opacity) is too
   subtle against the Harbour Shade (#1f4860) drawer background.
   Override with a white lift + full-white text for clear selection. */
.mud-drawer .mud-nav-link.active {
    background-color: rgba(255, 255, 255, 0.13) !important;
    color: #ffffff !important;
    font-weight: 500;
}

.mud-drawer .mud-nav-link.active:hover {
    background-color: rgba(255, 255, 255, 0.17) !important;
}

.mud-drawer .mud-nav-link.active .mud-icon-root {
    color: #4dc4d4 !important;
}

/* ── Utility ───────────────────────────────────────────────── */
/* Smooth page transitions */
.mud-main-content {
    transition: margin 0.2s ease;
}
