/* Global styles. Component styles live in .razor.css files next to the components. */

:root {
    /* Top bar of the old IVA. */
    --iva-appbar-gradient: linear-gradient(0deg, rgba(0, 255, 255, 0.8) 0%, rgba(0, 136, 255, 1) 100%);
}

/* Applied by js/app.js before Blazor starts, so a dark-mode user does not see a white page first.
   Once MudBlazor is running, its palette variable takes over (same color). */
html[data-theme="dark"] {
    --iva-appbar-gradient: linear-gradient(0deg, rgba(10, 120, 150, 1) 0%, rgba(14, 70, 140, 1) 100%);
    color-scheme: dark;
}

html[data-theme="dark"] body {
    background-color: var(--mud-palette-background, #32333d);
}

.iva-appbar.mud-appbar {
    background: var(--iva-appbar-gradient);
    color: #fff;
}

.iva-appbar-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

h1:focus {
    outline: none;
}

/* Loading screen before the WebAssembly app starts; hidden as soon as the layout is rendered. */
.app-loading {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.app-loading img {
    height: 6rem;
}

.app-loading-bar {
    width: 12rem;
    height: 4px;
    border-radius: 2px;
    background: rgba(0, 136, 255, 0.2);
    overflow: hidden;
}

.app-loading-bar::after {
    content: "";
    display: block;
    height: 100%;
    width: var(--blazor-load-percentage, 0%);
    background: rgb(0, 136, 255);
    transition: width 0.2s;
}

body:has(.mud-layout) .app-loading {
    display: none;
}

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

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

/* Copyable code snippet (e.g. the booking iframe). */
.iva-code {
    white-space: pre-wrap;
    word-break: break-all;
    font-size: 0.8125rem;
    padding: 12px;
    border-radius: 6px;
    background: var(--mud-palette-background-gray);
    user-select: all;
}

/* Count next to a menu link: compact so it does not stretch the row. */
.iva-menu-counter.mud-chip {
    height: 20px;
    margin-top: 0;
    margin-bottom: 0;
    font-size: 0.75rem;
}

/* Phone cards of a data grid (below MudBlazor's "sm"): an empty optional field is left out. */
@media (max-width: 599.98px) {
    .iva-empty-on-phone {
        display: none !important;
    }
}

/* Radzen (calendar only) in MudBlazor's colors. html:root beats the theme's :root, which loads later; the theme's
   derived variables (buttons, selection…) resolve against these on the same element. */
html:root {
    --rz-primary: var(--mud-palette-primary);
    --rz-primary-light: var(--mud-palette-primary-lighten);
    --rz-primary-lighter: rgba(var(--mud-palette-primary-rgb), 0.12);
    --rz-primary-dark: var(--mud-palette-primary-darken);
    --rz-primary-darker: var(--mud-palette-primary-darken);
    --rz-on-primary: var(--mud-palette-primary-text);
    --rz-on-primary-lighter: var(--mud-palette-primary);
    --rz-base-background-color: var(--mud-palette-surface);
    --rz-text-color: var(--mud-palette-text-primary);
    --rz-scheduler-event-list-button-color: var(--mud-palette-primary);
}

/* Notes: a note with something new for the user gets a colored edge; replies are indented under the note. */
.iva-note-new {
    border-left: 4px solid var(--mud-palette-error) !important;
}

.iva-note-replies {
    border-left: 2px solid var(--mud-palette-lines-default);
    padding-left: 12px;
}

/* Home page tiles: the whole tile is a link. */
.iva-home-tile {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
    transition: box-shadow 0.15s ease-in-out;
}

.iva-home-tile:hover,
.iva-home-tile:focus-visible {
    box-shadow: var(--mud-elevation-4);
}
