html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

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 {
    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;
    }

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

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

/* Modern MudBlazor-style loading animation */
.loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #f5f5f5 0%, #e3f2fd 50%, #bbdefb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
    /* Prevent layout shifts */
    will-change: opacity, visibility;
    contain: layout style paint;
}

/* Light mode styling */
.loading-container .loading-content {
    text-align: center;
    color: #1976d2;
    animation: pulse 2s ease-in-out infinite;
    /* Prevent content shifts during animations */
    will-change: transform, opacity;
}

.loading-container .spinner-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-radius: 50%;
    animation: rotate 2s linear infinite;
}

.loading-container .spinner-circle:nth-child(1) {
    border-top-color: #1976d2;
    border-right-color: rgba(25, 118, 210, 0.3);
    animation-delay: 0s;
}

.loading-container .spinner-circle:nth-child(2) {
    border-top-color: rgba(25, 118, 210, 0.8);
    border-right-color: rgba(25, 118, 210, 0.2);
    animation-delay: -0.4s;
    transform: scale(0.8);
}

.loading-container .spinner-circle:nth-child(3) {
    border-top-color: rgba(25, 118, 210, 0.6);
    border-right-color: rgba(25, 118, 210, 0.1);
    animation-delay: -0.8s;
    transform: scale(0.6);
}

.loading-container .loading-text h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 500;
    color: #1976d2;
    /* Add fallback fonts to match body and prevent shifts when Roboto loads */
    font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    letter-spacing: 0.5px;
    /* Reserve space and prevent layout shifts */
    min-height: 2rem;
}

/* Reserve height for loading quote to avoid layout jump when font loads or text changes */
.loading-container .loading-text p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.8;
    color: #424242;
    /* Add fallback fonts to match body and prevent shifts when Roboto loads */
    font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 300;
    transition: opacity .3s ease; /* for quote fade */
    /* Reserve space for text to prevent layout shifts */
    min-height: 3.2em; /* reserve two lines for most quotes */
    line-height: 1.6;
    /* Ensure text doesn't cause reflow */
    max-width: 600px;
    margin: 0 auto;
    /* Additional optimization to prevent shifts */
    contain: layout style;
}

/* helper for JS to fade quotes */
.loading-container .loading-text p.hide {
    opacity: 0;
}

/* Dark mode styling */
body.dark-theme .loading-container {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 50%, #21262d 100%);
}

body.dark-theme .loading-container .loading-content {
    color: #64b5f6;
}

body.dark-theme .loading-container .spinner-circle:nth-child(1) {
    border-top-color: #64b5f6;
    border-right-color: rgba(100, 181, 246, 0.3);
}

body.dark-theme .loading-container .spinner-circle:nth-child(2) {
    border-top-color: rgba(100, 181, 246, 0.8);
    border-right-color: rgba(100, 181, 246, 0.2);
}

body.dark-theme .loading-container .spinner-circle:nth-child(3) {
    border-top-color: rgba(100, 181, 246, 0.6);
    border-right-color: rgba(100, 181, 246, 0.1);
}

body.dark-theme .loading-container .loading-text h3 {
    color: #64b5f6;
}

body.dark-theme .loading-container .loading-text p {
    color: #8b949e;
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem auto;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.02);
    }
}

/* Improved fade out animation */
.loading-container.fade-out {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out, transform 0.5s ease-out;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .loading-container {
        background: linear-gradient(135deg, #121212 0%, #1e1e1e 50%, #2c2c2c 100%);
    }
    
    .spinner-circle:nth-child(1) {
        border-top-color: #64b5f6;
        border-right-color: rgba(100, 181, 246, 0.3);
    }

    .spinner-circle:nth-child(2) {
        border-top-color: rgba(100, 181, 246, 0.8);
        border-right-color: rgba(100, 181, 246, 0.2);
    }

    .spinner-circle:nth-child(3) {
        border-top-color: rgba(100, 181, 246, 0.6);
        border-right-color: rgba(100, 181, 246, 0.1);
    }
}

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}