/*
   Theme overrides live here, on MudBlazor's own CSS variables, rather than as per-component
   fights. Anything that has to change across the whole app — density, borders, radii — is a
   variable; anything local belongs in a scoped .razor.css, which the .NET SDK compiles with no
   Node step involved.
*/

@font-face {
    font-family: 'Inter';
    src: url('fonts/inter-variable.woff2') format('woff2-variations');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

html, body {
    margin: 0;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    -webkit-font-smoothing: antialiased;
}

/* Ripple off, globally. This single change does more for "clean" than any amount of palette
   work: Material's ink spread is the most recognisable thing about a default MudBlazor app.

   Hide the EFFECT, not `.mud-ripple`. The latter is a marker class MudBlazor puts on the
   component element itself (it only sets position/overflow), so `display: none` on it hides
   every button in the application — which looks exactly like a broken render and sends you
   hunting through the trimmer for an afternoon. */
.mud-ripple-effect {
    display: none !important;
}

/* Flat surfaces with one-pixel borders instead of Material's layered shadows. */
.mud-paper-outlined {
    border-color: var(--mud-palette-lines-default);
}

.mud-appbar.tracker-appbar {
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.mud-drawer {
    border-right: 1px solid var(--mud-palette-lines-default);
}

.mud-table-container .mud-table-head .mud-table-cell {
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.mud-button-root {
    letter-spacing: 0;
}

.tracker-main {
    background-color: var(--mud-palette-background);
    min-height: 100vh;
}

/* ---- the running timer, pinned in the app bar ---------------------------------------- */

.tracker-timer-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.125rem 0.5rem 0.125rem 0.125rem;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 999px;
    background-color: var(--mud-palette-background);
}

.tracker-timer-elapsed {
    /* Tabular figures: without them every tick visibly reflows the bar next to it. */
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum';
    font-weight: 600;
    font-size: 0.9375rem;
    min-width: 4.5ch;
}

.tracker-timer-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    max-width: 18rem;
    overflow: hidden;
}

.tracker-timer-project {
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tracker-timer-customer {
    font-size: 0.6875rem;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- stat tiles ------------------------------------------------------------------------ */

.tracker-stat-value {
    font-variant-numeric: tabular-nums;
    margin-top: 0.125rem;
    line-height: 1.2;
}

.tracker-kv td:first-child {
    width: 40%;
}

/* ---- login ----------------------------------------------------------------------------- */

.tracker-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    background-color: var(--mud-palette-background);
}

/* ---- boot screen, shown until the runtime takes over ----------------------------------- */

.boot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 1rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #212529;
    background: #fafafa;
}

.boot-brand {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.boot-bar {
    width: 180px;
    height: 3px;
    border-radius: 999px;
    background: #e9ecef;
    overflow: hidden;
}

.boot-bar-fill {
    height: 100%;
    background: #3b5bdb;

    /* Blazor sets --blazor-load-percentage while the runtime downloads. Falling back to an
       indeterminate look would be a lie about progress we actually have. */
    width: var(--blazor-load-percentage, 0%);
    transition: width 120ms linear;
}

.boot-caption {
    font-size: 0.8125rem;
    color: #868e96;
}

.boot-caption::after {
    content: var(--blazor-load-percentage-text, '');
}

@media (prefers-color-scheme: dark) {
    .boot {
        color: #e9ecef;
        background: #141517;
    }

    .boot-bar {
        background: #2c2e33;
    }
}

/* ---- the framework's own fatal-error banner -------------------------------------------- */

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    padding: 0.75rem 1.25rem;
    background: #fff3bf;
    color: #212529;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.08);
}

#blazor-error-ui .dismiss {
    position: absolute;
    right: 1rem;
    top: 0.6rem;
    cursor: pointer;
    font-size: 1.25rem;
}
