@import url('lib/tailwindcss/dist/preflight.css');

/* 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;
}



.page-width {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* 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);
    }
}

/* 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 and navigation text is visible */
.mud-appbar .mud-text,
.mud-nav-link {
    color: var(--neutral-800) !important;
}

/* Chat-specific light theme fixes */
.modern-chat-item {
    background: white !important;
    color: var(--neutral-800) !important;
    border: 1px solid var(--neutral-200) !important;
}

.modern-sidebar {
    background: white !important;
    color: var(--neutral-800) !important;
    border-right: 1px solid var(--neutral-200) !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;
}

/* Main layout and header fixes */
.mud-main-content {
    background: white !important;
    color: var(--neutral-800) !important;
}

.mud-appbar {
    background: white !important;
    color: var(--neutral-800) !important;
    border-bottom: 1px solid var(--neutral-200) !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;
}
