
/* Modern CSS Variables for Design System */
:root {
    /* Primary Colors */
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-200: #bae6fd;
    --primary-300: #7dd3fc;
    --primary-400: #38bdf8;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    --primary-800: #075985;
    --primary-900: #0c4a6e;

    /* Neutral Colors */
    --neutral-50: #fafafa;
    --neutral-100: #f5f5f5;
    --neutral-200: #e5e5e5;
    --neutral-300: #d4d4d4;
    --neutral-400: #a3a3a3;
    --neutral-500: #737373;
    --neutral-600: #525252;
    --neutral-700: #404040;
    --neutral-800: #262626;
    --neutral-900: #171717;

    /* Semantic Colors */
    --success-500: #10b981;
    --success-50: #ecfdf5;
    --success-600: #059669;
    --warning-500: #f59e0b;
    --warning-50: #fffbeb;
    --warning-600: #d97706;
    --error-500: #ef4444;
    --error-50: #fef2f2;
    --error-600: #dc2626;
    --error-700: #b91c1c;

    /* High Contrast Colors for Better Accessibility */
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --text-inverse: #ffffff;
    --text-inverse-muted: rgba(255, 255, 255, 0.8);

    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-muted: #f3f4f6;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
}

html {
    min-height: 100vh;
    scroll-behavior: smooth;
}

/* Modern gradient background */
html, .main-background-gradient {
    background: linear-gradient(135deg,
        var(--primary-50) 0%,
        var(--neutral-50) 25%,
        var(--primary-100) 50%,
        var(--neutral-100) 100%);
    background-attachment: fixed;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--neutral-800);
}

/* Modern top accent bar */
html::after {
    content: '';
    background: linear-gradient(90deg,
        var(--primary-600) 0%,
        var(--primary-500) 25%,
        var(--primary-400) 50%,
        var(--primary-500) 75%,
        var(--primary-600) 100%);
    width: 100%;
    height: 3px;
    position: fixed;
    top: 0;
    z-index: 9999;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.4;
    color: var(--neutral-900);
}

h1 {
    font-size: 2.25rem;
    line-height: 2.5rem;
}

h2 {
    font-size: 1.875rem;
    line-height: 2.25rem;
}

h3 {
    font-size: 1.5rem;
    line-height: 2rem;
}

h1:focus, h2:focus, h3:focus, h4:focus, h5:focus, h6:focus {
    outline: none;
}

/* Form Validation - Modern styling */
.valid.modified:not([type=checkbox]) {
    outline: 2px solid var(--success-500);
    outline-offset: 2px;
    border-radius: var(--radius-md);
}

.invalid {
    outline: 2px solid var(--error-500);
    outline-offset: 2px;
    border-radius: var(--radius-md);
}

.validation-message {
    color: var(--error-500);
    font-size: 0.875rem;
    margin-top: var(--spacing-xs);
}

/* Error Boundary - Modern styling */
.blazor-error-boundary {
    background: linear-gradient(135deg, var(--error-500), #dc2626);
    padding: var(--spacing-lg);
    color: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid #fca5a5;
    margin: var(--spacing-md);
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
    font-weight: 500;
}





/* Utility Classes */
.glass-effect {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-modern {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--neutral-200);
    transition: all var(--transition-normal);
}

.card-modern:hover {
    box-shadow: var(--shadow-lg);
}

/* Animation Classes */
.fade-in {
    animation: fadeIn var(--transition-normal) ease-in-out;
}

.slide-up {
    animation: slideUp var(--transition-normal) ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modern Dialog Styles */
.modern-dialog .mud-dialog-container {
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: white;
    box-shadow: var(--shadow-xl);
}

.modern-dialog .mud-dialog-content {
    padding: 0;
    background: white;
}

.modern-tabs .mud-tabs-toolbar {
    background: white;
    border-bottom: 1px solid var(--neutral-200);
    padding: 0 var(--spacing-lg);
}

.modern-tabs .mud-tab {
    font-weight: 500;
    text-transform: none;
    padding: var(--spacing-md) var(--spacing-lg);
}

.modern-tabs .mud-tab.mud-tab-active {
    color: var(--primary-600);
    border-bottom: 2px solid var(--primary-600);
}

.modern-tabs .mud-tabpanel {
    background: white;
}

.modern-tabs .mud-tabs-panels {
    background: white;
}

.modern-data-grid .mud-table-head {
    background: var(--bg-secondary);
}

.modern-data-grid .mud-table-head .mud-table-cell {
    font-weight: 600;
    color: var(--neutral-700);
    border-bottom: 2px solid var(--neutral-200);
}

.modern-data-grid .mud-table-row:hover {
    background: var(--primary-50) !important;
}

.modern-badge {
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

/* Additional utility classes for the dialog */
.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
    color: var(--neutral-800);
}

.text-muted {
    color: var(--text-muted);
}

.text-error {
    color: var(--error-600);
}

.text-success {
    color: var(--success-600);
}

.text-warning {
    color: var(--warning-600);
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

/* Enhanced text color classes for better visibility */
.text-primary {
    color: var(--text-primary) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-dark {
    color: var(--neutral-800) !important;
}

.text-darker {
    color: var(--neutral-900) !important;
}

/* Improved MudChip styling for tags */
.modern-badge {
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    min-width: 120px !important;
    max-width: 300px !important;
    height: auto !important;
    min-height: 32px !important;
    padding: 8px 16px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    line-height: 1.3 !important;
    text-align: center !important;
}

.modern-badge .mud-chip-content {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow: visible !important;
    text-overflow: unset !important;
    line-height: 1.3 !important;
    color: white !important;
    font-weight: 500 !important;
}

/* Ensure MudChip text is visible */
.mud-chip.mud-chip-color-primary {
    color: white !important;
}

.mud-chip.mud-chip-color-primary .mud-chip-content {
    color: white !important;
}

/* Fix any potential text visibility issues in dialog sections */
.modern-card .mud-text {
    color: var(--neutral-800) !important;
}

.modern-card .font-medium {
    color: var(--neutral-800) !important;
}

/* Tag container improvements */
.tag-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: flex-start;
    margin-top: 8px;
}

/* Ensure light theme components remain light */
.modern-dialog,
.modern-dialog .mud-dialog-container,
.modern-dialog .mud-dialog-content {
    background: white !important;
    color: var(--neutral-800) !important;
}

.modern-card {
    background: white !important;
    color: var(--neutral-800) !important;
    border: 1px solid var(--neutral-200) !important;
}

.modern-tabs .mud-tabs-toolbar,
.modern-tabs .mud-tabpanel,
.modern-tabs .mud-tabs-panels {
    background: white !important;
    color: var(--neutral-800) !important;
}

/* Ensure text visibility in all light components */
.modern-card .mud-text,
.modern-dialog .mud-text,
.modern-tabs .mud-text {
    color: var(--neutral-800) !important;
}

.modern-card .font-medium,
.modern-dialog .font-medium,
.modern-tabs .font-medium {
    color: var(--neutral-800) !important;
}

/* Fix any potential header styling issues */
.glass-effect {
    background: rgba(255, 255, 255, 0.9) !important;
    color: var(--neutral-800) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* Ensure MudAppBar text is visible */
.mud-appbar .mud-text {
    color: var(--neutral-800) !important;
}

/* RecordInfoDialog specific fixes */
.record-info-dialog .mud-dialog-container,
.record-info-dialog .mud-dialog-content {
    background: white !important;
}

.record-info-dialog .modern-card {
    background: white !important;
    color: var(--neutral-800) !important;
}

.record-info-dialog .mud-text {
    color: var(--neutral-800) !important;
}

.record-info-dialog .font-medium {
    color: var(--neutral-800) !important;
}

/* Override any potential dark styling */
.mud-paper {
    background: white !important;
    color: var(--neutral-800) !important;
}

.mud-paper .mud-text {
    color: var(--neutral-800) !important;
}

/* Ensure all dialog content is light */
.mud-dialog .mud-paper {
    background: white !important;
    color: var(--neutral-800) !important;
}

/* LoginDisplay text visibility fixes */
.modern-user-menu .mud-text {
    color: var(--neutral-800) !important;
}

.modern-login-btn {
    color: var(--neutral-800) !important;
    border-color: var(--neutral-300) !important;
}

.modern-login-btn:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    border-color: var(--neutral-400) !important;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.radius-full {
    border-radius: 9999px;
}