﻿html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    overflow: hidden;
    height: 100%;
}

#app {
    height: 100%;
}

/* Fill background during loader->layout transition based on theme preference */
    html[data-dark-mode="true"] body {
        background-color: #1f1f1f;
    }

html[data-dark-mode="false"] body {
    background-color: #f9f9f9;
}

/* Default to light mode before preference loads */
html:not([data-dark-mode]) body {
    background-color: #f9f9f9;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

/* Loader styling */
.loader {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Light mode loader (default) */
.loader {
    background-color: #f9f9f9;
}

/* Dark mode loader - applied when dark mode preference is detected */
html[data-dark-mode="true"] .loader {
    background-color: #1f1f1f;
}

html[data-dark-mode="false"] .loader {
    background-color: #f9f9f9;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmb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IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDg2IDY2LjA1NDcgMjYzLjU4NiA2Ni4wMTgzIFoiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

/*  Loader ellipsis  */
.loader {
    display: flex;
    justify-content: space-evenly;
    height: 100vh;
    align-items: center;
}

.lds-ellipsis {
    display: inline-block;
    position: relative;
    width: 5rem;
    height: 5rem;
}

    .lds-ellipsis div {
        position: absolute;
        top: 2.0625rem;
        width: 0.8125rem;
        height: 0.8125rem;
        border-radius: 50%;
        background: #94bbf7;
        animation-timing-function: cubic-bezier(0, 1, 1, 0);
    }

        .lds-ellipsis div:nth-child(1) {
            left: 0.5rem;
            animation: lds-ellipsis1 0.6s infinite;
        }

        .lds-ellipsis div:nth-child(2) {
            left: 0.5rem;
            animation: lds-ellipsis2 0.6s infinite;
        }

        .lds-ellipsis div:nth-child(3) {
            left: 2rem;
            animation: lds-ellipsis2 0.6s infinite;
        }

        .lds-ellipsis div:nth-child(4) {
            left: 3.5rem;
            animation: lds-ellipsis3 0.6s infinite;
        }

@keyframes lds-ellipsis1 {
    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes lds-ellipsis3 {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(0);
    }
}

@keyframes lds-ellipsis2 {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(1.5rem, 0);
    }
}
/* END Loader ellipsis */

.center-content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

/* Empty card styles for CustomerView */
.empty-card {
    max-height: 4.5rem !important;
    overflow: hidden !important;
}

.empty-card .mud-card-header {
    padding: 12px 20px !important;
    margin: 0 !important;
}

.empty-card .mud-card-content {
    display: none !important;
    padding: 0 !important;
}

.anv-navlink-tooltip {
    display: contents !important;
}

/* App-bar project picker (Layout/ActiveProjectIndicator). The popover is teleported to
   MudPopoverProvider at the layout root, so scoped CSS cannot reach it — these rules are global
   and matched via the component's PopoverClass/ListClass. */
.project-picker__popover {
    min-width: 17rem;
    /* MudMenu writes an inline "max-width: none" on the popover, so this has to outrank it —
       without it a long project name stretches the menu off the side of the screen. */
    max-width: 24rem !important;
}

/* Let the item shrink so the name can ellipsize instead of widening the menu. */
.project-picker__popover .mud-menu-item {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.project-picker__head {
    padding: 0.5rem 1rem 0.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

/* The active project stated in full, where the user is actually looking. This replaces the
   activator's old hover tooltip, which made the control read as status rather than a selector.
   Wraps instead of ellipsizing — carrying the whole label is the entire point of it. */
.project-picker__active {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem 0.375rem 1rem;
}

/* The label/name column yields to the action button instead of pushing it out of the popover. */
.project-picker__active-text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

/* Nudged up to sit against the name rather than centred on the two-line block. */
.project-picker__active-edit {
    flex: 0 0 auto;
    align-self: flex-start;
    margin-top: 0.125rem;
}

.project-picker__active-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.project-picker__active-name {
    font-size: 0.875rem;
    font-weight: 600;
    overflow-wrap: anywhere;
    color: color-mix(in srgb, var(--mud-palette-primary) 60%, var(--mud-palette-text-primary));
}

.project-picker__search {
    padding: 0.25rem 0.75rem 0.5rem;
}

.project-picker__status {
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary);
}

.project-picker__status--error {
    /* Darkened toward the text color so it stays legible on the popover surface in both themes. */
    color: color-mix(in srgb, var(--mud-palette-error) 60%, var(--mud-palette-text-primary));
}

/* Long project lists scroll inside the popover instead of pushing the actions off screen. */
.project-picker__results {
    max-height: 15rem;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Section heading inside the results list (Active project / Recent projects / Projects), matching the
   ordering every other project picker uses. The top border doubles as the divider between sections;
   the first one in the list drops it since the search box already separates it. */
.project-picker__section {
    padding: 0.5rem 1rem 0.25rem;
    border-top: 1px solid var(--mud-palette-lines-default);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.project-picker__section:first-child {
    border-top: none;
    padding-top: 0.25rem;
}

.project-picker__item {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
}

.project-picker__item-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The project already in use, so reopening the picker shows where you are. */
.project-picker__item--active .project-picker__item-name {
    font-weight: 600;
    color: color-mix(in srgb, var(--mud-palette-primary) 60%, var(--mud-palette-text-primary));
}

.project-picker__item-number {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}
