/* ----------------------------------------------------------------------------------------
 * layouts.css — extracted from Shared/MainLayout.razor on 2026-05-10.
 *
 * Previously a 550-line <style> block lived inline at the top of MainLayout.razor.
 * Moving it here means the styles are cached by the browser (rather than re-served
 * on every Blazor render) and the layout component itself is dramatically easier
 * to scan. No selectors changed during the move — copy-paste only.
 * ---------------------------------------------------------------------------------------- */
    /* Ensure containers use full width */
    .mud-container {
        max-width: none !important;
        width: 100% !important;
    }
    
    /* Ensure proper spacing for app bar */
    .mud-main-content {
        padding-top: 80px !important; /* Account for app bar height + extra spacing */
    }
    
    /* Enhanced registration number input styling */
    .registration-input .mud-input-root {
        border: none !important;
        box-shadow: none !important;
    }
    
    .registration-input .mud-input-root:hover {
        background-color: var(--mud-palette-background-grey) !important;
    }
    
    .registration-input .mud-input-root:focus-within {
        background-color: var(--mud-palette-background-grey) !important;
    }
    
    /* Search button hover effect */
    .registration-search-btn:hover {
        background-color: var(--mud-palette-primary-hover) !important;
        transform: scale(1.05);
        transition: all 0.2s ease;
    }
    
    /* Paper container hover effect */
    .registration-container:hover {
        border-color: var(--mud-palette-primary) !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
        transition: all 0.3s ease;
    }

    /* Global Search Icon Styling */
    .global-search-input .mud-input-adornment-start .mud-icon-root {
        color: white !important;
    }
    
    .global-search-input .mud-input-adornment-start {
        color: white !important;
    }
    
    .global-search-input .mud-input-adornment-start svg {
        color: white !important;
        fill: white !important;
    }
    
    /* Ensure icon stays white in all states */
    .global-search-input:hover .mud-input-adornment-start svg,
    .global-search-input:focus-within .mud-input-adornment-start svg,
    .global-search-input .mud-input-adornment-start:hover svg {
        color: white !important;
        fill: white !important;
    }
    
    /* Additional specificity for MudBlazor components */
    .mud-autocomplete.global-search-input .mud-input-adornment-start .mud-icon-root {
        color: white !important;
    }
    
    .mud-autocomplete.global-search-input .mud-input-adornment-start svg {
        color: white !important;
        fill: white !important;
    }

    /* Notification Panel */
    .notif-menu .mud-menu-content {
        border-radius: 8px;
        box-shadow: 0 4px 24px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.06);
        overflow: hidden;
        min-width: 360px;
        max-width: 420px;
    }

    .notif-panel { display: flex; flex-direction: column; }

    .notif-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px 12px;
        border-bottom: 1px solid var(--mud-palette-divider);
    }

    .notif-header-left { display: flex; align-items: center; gap: 8px; }

    .notif-header-title {
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--mud-palette-text-primary);
    }

    .notif-count-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: var(--mud-palette-error);
        color: white;
        font-size: 10px;
        font-weight: 700;
        border-radius: 10px;
        min-width: 18px;
        height: 16px;
        padding: 0 4px;
    }

    .notif-scroll {
        max-height: 420px;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: var(--mud-palette-divider) transparent;
    }

    .notif-scroll::-webkit-scrollbar { width: 4px; }
    .notif-scroll::-webkit-scrollbar-thumb { background: var(--mud-palette-divider); border-radius: 4px; }

    .notif-item-wrapper.mud-menu-item {
        padding: 0;
        border-bottom: 1px solid var(--mud-palette-divider);
    }

    .notif-item-wrapper.mud-menu-item:hover { background: var(--mud-palette-action-hover) !important; }

    .notif-row {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        padding: 11px 16px;
    }

    .notif-row-unread { background: rgba(var(--mud-palette-primary-rgb), 0.04); }

    .notif-dot-col {
        width: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding-top: 4px;
        flex-shrink: 0;
    }

    .notif-unread-dot {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: var(--mud-palette-primary);
        display: block;
    }

    .notif-body { flex: 1; min-width: 0; }

    .notif-title {
        font-size: 0.85rem;
        line-height: 1.4;
        color: var(--mud-palette-text-primary);
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .notif-title-bold { font-weight: 600; }

    .notif-meta {
        display: flex;
        align-items: center;
        gap: 5px;
        margin-top: 3px;
        flex-wrap: wrap;
    }

    .notif-priority-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        flex-shrink: 0;
        display: inline-block;
    }

    .notif-meta-text { font-size: 0.72rem; color: var(--mud-palette-text-secondary); }
    .notif-meta-sep { font-size: 0.72rem; color: var(--mud-palette-text-disabled); }
    .notif-overdue { color: var(--mud-palette-error) !important; font-weight: 600; }
    .notif-due-soon { color: var(--mud-palette-warning) !important; font-weight: 500; }

    .notif-footer-item-wrapper.mud-menu-item {
        padding: 0;
        border-top: 1px solid var(--mud-palette-divider);
        background: rgba(0,0,0,0.02);
    }

    .notif-footer-item-wrapper.mud-menu-item:hover { background: var(--mud-palette-action-hover) !important; }

    .notif-footer-row {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 10px 16px;
        font-size: 0.82rem;
        font-weight: 500;
        color: var(--mud-palette-primary);
    }

    .notif-empty {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 36px 24px;
        gap: 8px;
    }

    .notif-empty-text { font-size: 0.85rem; color: var(--mud-palette-text-secondary); }

    /* Global Search Styles */
    .global-search-container {
        width: 400px;
        max-width: 100%;
    }

    .global-search-input .mud-input-root {
        background-color: white !important;
        border-radius: 24px;
        transition: all 0.3s ease;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        border: none !important;
        outline: none !important;
    }

    .global-search-input .mud-input-root:hover {
        background-color: white !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        border: none !important;
        outline: none !important;
    }

    .global-search-input .mud-input-root:focus-within {
        background-color: white !important;
        box-shadow: 0 0 0 2px var(--mud-palette-primary), 0 4px 12px rgba(0, 0, 0, 0.15);
        border: none !important;
        outline: none !important;
    }

    .global-search-input .mud-input-root:not(:hover):not(:focus-within) {
        background-color: white !important;
        border: none !important;
        outline: none !important;
    }

    .global-search-input .mud-input-control {
        color: var(--mud-palette-text-primary);
        padding-left: 20px !important;
    }

    .global-search-input .mud-input-slot {
        padding-left: 12px !important;
        padding-right: 14px !important;
    }

    .global-search-input .mud-input-control::placeholder {
        color: var(--mud-palette-text-secondary);
    }

    .global-search-input .mud-input-adornment {
        color: var(--mud-palette-primary) !important;
    }
    
    .global-search-input .mud-input-adornment .mud-icon {
        color: var(--mud-palette-primary) !important;
    }

    /* Remove any potential borders or outlines from all variants */
    .global-search-input .mud-input-root .mud-input-root-outlined {
        border: 1px solid transparent !important;
        outline: none !important;
    }

    .global-search-input .mud-input-root .mud-input-root-filled {
        border: 1px solid transparent !important;
        outline: none !important;
    }

    .global-search-input .mud-input-root .mud-input-root-standard {
        border: 1px solid transparent !important;
        outline: none !important;
    }

    /* Specifically target the outlined variant fieldset and legend */
    .global-search-input .mud-input-root-outlined fieldset {
        border: none !important;
        border-color: transparent !important;
        border-width: 0 !important;
    }

    .global-search-input .mud-input-root-outlined legend {
        display: none !important;
    }

    /* Target the specific MudBlazor outlined input structure */
    .global-search-input .mud-input-root-outlined .mud-input-root {
        border: none !important;
        border-width: 0 !important;
        border-color: transparent !important;
    }

    /* Remove any fieldset borders that might be visible */
    .global-search-input fieldset {
        border: none !important;
        border-width: 0 !important;
        border-color: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Ensure no outline appears on focus */
    .global-search-input:focus,
    .global-search-input:focus-within,
    .global-search-input .mud-input-root:focus,
    .global-search-input .mud-input-root:focus-within {
        outline: none !important;
        border: none !important;
    }

    .search-result-type-chip {
        font-size: 0.7rem;
        height: 18px;
        min-width: 50px;
    }

        /* Search dropdown styling */
        .mud-autocomplete .mud-popover {
            background-color: white !important;
            border-radius: 12px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
            border: 1px solid rgba(0, 0, 0, 0.08);
            max-height: 500px !important;
            overflow-y: auto !important;
            overflow-x: hidden !important;
        }
    
    .mud-autocomplete .mud-popover .mud-list {
        background-color: white !important;
        border-radius: 12px;
        max-height: none !important;
        overflow: visible !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
    }
    
    .mud-autocomplete .mud-popover .mud-list-item {
        background-color: white !important;
        color: var(--mud-palette-text-primary) !important;
        overflow: visible !important;
    }
    
        .mud-autocomplete .mud-popover .mud-list-container {
            max-height: 480px !important;
            overflow-y: auto !important;
            overflow-x: hidden !important;
        }
    
        /* Prevent double scrollbars in global search */
        .global-search-input .mud-autocomplete .mud-popover {
            max-height: 500px !important;
            overflow-y: auto !important;
            overflow-x: hidden !important;
        }
    
    .global-search-input .mud-autocomplete .mud-popover .mud-list {
        max-height: none !important;
        overflow: visible !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
    }
    
    .global-search-input         .mud-autocomplete .mud-popover .mud-list-container {
            max-height: 480px !important;
            overflow-y: auto !important;
            overflow-x: hidden !important;
        }

    .mud-autocomplete .mud-list-item {
        border-radius: 8px;
        margin: 2px 4px;
        transition: all 0.2s ease;
    }

    .mud-autocomplete .mud-list-item:hover {
        background-color: var(--mud-palette-action-hover) !important;
        transform: translateX(2px);
    }
    
    /* General dropdown styling to ensure white backgrounds */
    .mud-popover {
        background-color: white !important;
    }
    
    .mud-popover .mud-list {
        background-color: white !important;
    }
    
    .mud-popover .mud-list-item {
        background-color: white !important;
        color: var(--mud-palette-text-primary) !important;
    }
    
    .mud-popover .mud-list-item:hover {
        background-color: var(--mud-palette-action-hover) !important;
    }
    
    /* Fix for select dropdowns */
    .mud-select .mud-popover {
        background-color: white !important;
    }
    
    .mud-select .mud-popover .mud-list {
        background-color: white !important;
    }
    
    .mud-select .mud-popover .mud-list-item {
        background-color: white !important;
        color: var(--mud-palette-text-primary) !important;
    }

    /* Responsive search */
    @@media (max-width: 768px) {
        .global-search-container {
            width: 250px;
            flex: 1 1 auto;
            min-width: 150px;
        }
    }

    @@media (max-width: 600px) {
        .global-search-container {
            width: auto;
            flex: 1 1 auto;
            min-width: 120px;
            max-width: 200px;
        }
        
        .global-search-input .mud-input-control {
            font-size: 0.875rem;
            padding-left: 12px !important;
        }

        .global-search-input .mud-input-slot {
            padding-left: 10px !important;
            padding-right: 12px !important;
        }
        
        .global-search-input .mud-input-root {
            border-radius: 20px;
        }
        
        /* Hide app title on small screens to give more space to search */
        .app-title-text {
            display: none;
        }
    }
    
    @@media (max-width: 480px) {
        .global-search-container {
            width: auto;
            flex: 1 1 auto;
            min-width: 100px;
            max-width: 160px;
        }
        
        .global-search-input .mud-input-control {
            font-size: 0.8rem;
            padding-left: 8px !important;
        }

        .global-search-input .mud-input-slot {
            padding-left: 8px !important;
            padding-right: 10px !important;
        }
        
        .global-search-input .mud-input-root {
            border-radius: 18px;
            padding: 4px 8px;
        }
        
        /* Reduce spacing on very small screens */
        .global-search-input .mud-input-adornment {
            margin-right: 4px;
        }
    }
    
    /* Very small mobile - show search icon only */
    @@media (max-width: 400px) {
        .global-search-container {
            display: none;
        }
        
        .mobile-search-icon {
            display: flex !important;
        }
    }
    
    /* Hide mobile search icon on larger screens */
    .mobile-search-icon {
        display: none;
    }
    
    /* Mobile search overlay */
    .mobile-search-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1300;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        padding-top: 8px;
    }
    
    .mobile-search-container {
        width: 95%;
        max-width: 400px;
        background: white;
        border-radius: 24px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
        padding: 8px;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .mobile-search-container .global-search-input {
        flex: 1;
    }
    
    .mobile-search-container .global-search-input .mud-input-root {
        background-color: #f5f5f5 !important;
    }
    
    .mobile-search-close-btn {
        flex-shrink: 0;
    }

/* Feedback FAB — anchored to viewport, sits above the MudBlazor snackbar stack
   (which uses z-index ~1000 for bottom-right toasts) but below open dialogs
   (z-index 1300+). Opacity dip on scroll-bottom would be nice but unnecessary. */
.autoglazer-feedback-fab {
    position: fixed !important;
    right: 24px;
    bottom: 24px;
    z-index: 1100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

@media (max-width: 600px) {
    .autoglazer-feedback-fab {
        right: 16px;
        bottom: 16px;
    }
}