html, body {
    font-family: 'Roboto', 'Helvetica Neue', sans-serif;
    /* Material Design 3 improved readability */
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Material Design 3 Color System - Tone-based surfaces */
:root {
    /* Light theme surface colors with purple tint */
    --mud-palette-surface: #FFFFFF;
    --mud-palette-surface-container-lowest: #FFFFFF;
    --mud-palette-surface-container-low: #F8F7FC;
    --mud-palette-surface-container: #F3F1F8;
    --mud-palette-surface-container-high: #EBE8F5;
    --mud-palette-surface-container-highest: #E4E0F0;
    
    /* Primary color with variations */
    --mud-palette-primary: #7C4DFF;
    --mud-palette-primary-container: #EDE7FF;
    --mud-palette-on-primary-container: #21005D;
    
    /* Improved contrast for better readability (WCAG AAA compliant) */
    --mud-palette-text-primary: rgba(0, 0, 0, 0.87);
    --mud-palette-text-secondary: rgba(0, 0, 0, 0.60);
    --mud-palette-text-disabled: rgba(0, 0, 0, 0.38);
    
    /* Material Design 3 spacing system */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    
    /* Elevation shadows for depth (M3 style) */
    --elevation-1: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --elevation-2: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --elevation-3: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --elevation-4: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

#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;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

/* Material Design 3 inspired styles */
.mud-card {
    transition: all 280ms cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px;
    background-color: #FFFFFF !important;
    border: 1px solid rgba(124, 77, 255, 0.08);
    box-shadow: 0 2px 8px rgba(124, 77, 255, 0.04);
}

.mud-card:hover {
    border-color: rgba(124, 77, 255, 0.16);
    box-shadow: 0 4px 16px rgba(124, 77, 255, 0.12);
    transform: translateY(-2px);
}

/* Material Design 3 surface containers for better hierarchy */
.surface-container {
    background-color: var(--mud-palette-surface-container);
}

.surface-container-low {
    background-color: var(--mud-palette-surface-container-low);
}

.surface-container-high {
    background-color: var(--mud-palette-surface-container-high);
}

.surface-container-highest {
    background-color: var(--mud-palette-surface-container-highest);
}

/* Improved typography for better readability */
.mud-typography {
    letter-spacing: 0.01em;
}

.mud-typography-h4 {
    font-size: 2.125rem;
    font-weight: 400;
    line-height: 1.235;
    letter-spacing: 0.00735em;
}

.mud-typography-h5 {
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1.334;
    letter-spacing: 0em;
}

.mud-typography-h6 {
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.6;
    letter-spacing: 0.0075em;
}

.mud-typography-body1 {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.75;
    letter-spacing: 0.00938em;
}

.mud-typography-body2 {
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.57;
    letter-spacing: 0.01071em;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Code blocks */
code {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
}

/* Card height utility */
.h-100 {
    height: 100%;
}

/* Material Design 3 spacing utilities */
.pa-6 {
    padding: var(--spacing-lg);
}

.pa-8 {
    padding: var(--spacing-xl);
}

.my-6 {
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.my-8 {
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

/* Improved button styles following M3 guidelines */
.mud-button-root {
    border-radius: 20px;
    text-transform: none;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Enhanced accessibility for focus states */
.mud-button-root:focus-visible,
.mud-icon-button:focus-visible,
.mud-input:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

/* Improved chip design */
.mud-chip {
    border-radius: 8px;
    font-weight: 500;
}

/* Better paper elevation */
.mud-paper {
    box-shadow: var(--elevation-2);
    border-radius: 12px;
}

.mud-paper.mud-elevation-0 {
    box-shadow: none;
}

.mud-paper.mud-elevation-1 {
    box-shadow: var(--elevation-1);
}

.mud-paper.mud-elevation-2 {
    box-shadow: var(--elevation-2);
}

.mud-paper.mud-elevation-3 {
    box-shadow: var(--elevation-3);
}

/* Smooth transitions */
* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
