:root {
    --primary-color: #a4c83f;
    --primary-dark: #8fb030;
    --primary-light: #c7da79;
    --surface-color: #ffffff;
    --surface-variant: #f6f8f1;
    --text-primary: #1f2420;
    --text-secondary: #5a5f59;
    --text-disabled: #b5b9b2;
    --border-color: #e3e8d8;
    --success-color: #388e3c;
    --error-color: #d32f2f;
    --warning-color: #f57c00;
    --info-color: #1976d2;

    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    --border-radius: 0.375rem;
    --border-radius-lg: 0.5rem;

    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 6px 16px -6px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 14px 28px -14px rgba(0, 0, 0, 0.18);

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.mud-theme-dark {
    --surface-color: #1e1e1e;
    --surface-variant: #242424;
    --text-primary: rgba(255, 255, 255, 0.92);
    --text-secondary: rgba(255, 255, 255, 0.64);
    --text-disabled: rgba(255, 255, 255, 0.4);
    --border-color: #2f3328;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
    --shadow-md: 0 6px 16px -6px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 14px 28px -14px rgba(0, 0, 0, 0.45);
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--surface-color);
}

* {
    box-sizing: border-box;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    font-weight: 600;
    line-height: 1.3;
}

h1 {
    font-size: var(--font-size-2xl);
}

h2 {
    font-size: var(--font-size-xl);
}

h3 {
    font-size: var(--font-size-lg);
}

p {
    margin: 0;
    color: var(--text-secondary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button,
input,
select,
textarea {
    font-family: var(--font-family);
    font-size: inherit;
}

/* Error UI */
#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;

    & .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }
}

.loading-progress {
    position: fixed;
    display: block;
    inset: 40vh auto auto 50%;
    transform: translate(-50%, -50%);
    width: clamp(12rem, 40vw, 20rem);
    height: 0.55rem;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(164, 200, 63, 0.2) 0%, rgba(188, 210, 105, 0.2) 100%);
    box-shadow: var(--shadow-md);
    overflow: hidden;

    & circle {
        display: none;
    }

    &::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(90deg, #a4c83f 0%, #bcd269 100%);
        width: var(--blazor-load-percentage, 0%);
        transition: width var(--transition-base);
    }
}

.loading-progress-text {
    position: fixed;
    inset: calc(40vh + 1rem) auto auto 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);

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

.content {
    padding-top: 1.1rem;
}

/* Ensure body scroll is available */
body {
    overflow-y: auto;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
