/* Legacy theme variables, now bridged onto the neon design tokens in css/neon.css so older
   components that still read them pick up the new palette automatically. */
:root,
[data-theme="dark"],
[data-theme="light"] {
    --primary-color: var(--nx-cyan);
    --secondary-color: var(--nx-green);
    --tertiary-color: var(--nx-lime);
    --success-color: var(--nx-lime);
    --warning-color: var(--nx-amber);
    --error-color: var(--nx-red);
    --info-color: var(--nx-cyan);

    --bg-primary: var(--nx-bg);
    --bg-secondary: var(--nx-surface-solid);
    --bg-tertiary: var(--nx-bg-elevated);

    --text-primary: var(--nx-text);
    --text-secondary: var(--nx-text-dim);
    --text-muted: var(--nx-text-faint);

    --border-color: var(--nx-border-strong);
    --shadow-color: rgba(0, 0, 0, 0.3);
}

/* Base body and html styling */
html, body {
    margin: 0;
    padding: 0;
}

/* Focus styles for accessibility */
.btn:focus, 
.btn:active:focus, 
.btn-link.nav-link:focus, 
.form-control:focus, 
.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

h1:focus {
    outline: none;
}

/* Form validation styles for Blazor EditForm inputs */
.form-control::placeholder {
    color: var(--text-muted);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--success-color);
}

.invalid {
    outline: 1px solid var(--error-color);
}

.validation-message {
    color: var(--error-color);
}

/* Error boundary */
.blazor-error-boundary {
    background: var(--error-color);
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: 4px;
    margin: 1rem;
    box-shadow: 0 2px 4px var(--shadow-color);
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* Monaco Editor theme integration */
#my-editor-id,
.my-editor-class,
.monaco-editor-container {
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px var(--shadow-color);
}

/* Used by StateSyncDemo */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media print {
    .theme-toggle-button {
        display: none;
    }
}

.e-richtexteditor img {
    max-width: 100%;
    height: auto;
    display: block;
}
