:root {
    color-scheme: light !important;
    --app-primary: #0e6aba;
    --app-bg: #f8fafc;
    --app-surface: #ffffff;
    --app-text: #0f172a;
    --app-text-muted: #64748b;
    --app-border: #e2e8f0;
    --header-gradient: linear-gradient(135deg, #023e68 0%, #3b82f6 100%);
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* NUCLEAR LIGHT MODE ENFORCEMENT */
/* This blocks Tailwind/MudBlazor media query leaks */
@media (prefers-color-scheme: dark) {
    :root, html, body {
        color-scheme: light !important;
        background-color: #f8fafc !important;
        color: #0f172a !important;
    }
    
    /* Reset common dark mode variables used by Tailwind/MudBlazor */
    :root {
        --tw-bg-opacity: 1 !important;
        --tw-text-opacity: 1 !important;
        --mud-palette-background: #f8fafc !important;
        --mud-palette-surface: #ffffff !important;
        --mud-palette-text-primary: #0f172a !important;
        --mud-palette-text-secondary: #64748b !important;
        --mud-palette-appbar-background: #023e68 !important;
        --mud-palette-drawer-background: #ffffff !important;
    }

    /* Force all elements to respect light background if they have dark mode classes */
    .dark, [class*="dark:"] {
        background-color: inherit !important;
        color: inherit !important;
        border-color: inherit !important;
    }
}

/* Prevent black backgrounds from MudBlazor/Tailwind leaks */
html, body, .mud-layout, .mud-main-content {
    background-color: #f8fafc !important;
    color: #0f172a !important;
}

/* Accessibility for Older Devices & Rural Areas */
@media (max-width: 640px) {
    html {
        font-size: 16px; /* Ensure base font is readable */
    }
    
    .mud-container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    /* Larger touch targets for buttons and inputs */
    button, .mud-button, .mud-input-control {
        min-height: 44px !important;
    }
}

body {
    background-color: var(--app-bg);
    color: var(--app-text);
}

.mud-nav-link-text {
    color: #fff;
}

.bg-gradient-header {
    background-image: var(--header-gradient);
}

.text-shadow-md {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.mud-nav-link-text a, .no-underline-nav-link a {
    text-decoration: none;
}

/* Custom Menu Styling */
.custom-menu-container {
    position: relative;
    display: inline-block;
}

.menu-header, .menu-headernotification {
    display: flex;
    align-items: center;
    padding: 8px 12px; /* Increased for touch */
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.menu-header:hover {
    background-color: rgba(224, 224, 224, 0.1);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--app-primary);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    margin-right: 8px;
}

.user-name {
    font-weight: 500;
    color: inherit;
}

.menu-arrow {
    margin-left: 8px;
    color: #fff;
    transition: transform 0.2s ease;
}

.menu-arrow.open {
    transform: rotate(180deg);
}

.menu-dropdown, .menu-dropdownnotification {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    z-index: 1000;
    min-width: 200px;
    margin-top: 8px;
    animation: fadeIn 0.3s ease-out;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    color: var(--app-text);
    transition: background-color 0.2s ease;
}

.menu-item:hover {
    background-color: rgba(128, 128, 128, 0.1);
}

.menu-item svg {
    margin-right: 12px;
    width: 20px;
    height: 20px;
}

/* Card Container Fixes */
.card-container {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    padding: 1rem;
}

.card-container h3, .card-container p {
    color: #444444 !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
