h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1zbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA9My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* CRITICAL: Enhanced emoji and icon support */
/* Ensure proper emoji font rendering across all browsers */
body, html {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Sans", sans-serif;
    -webkit-font-feature-settings: "liga" on, "calt" on, "kern" on;
    font-feature-settings: "liga" on, "calt" on, "kern" on;
    text-rendering: optimizeLegibility;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* Force emoji font support for all icon elements */
.stat-icon, 
.nav-icon, 
.search-btn, 
.header-btn, 
.payment-icon, 
.balance-icon, 
.balance-chart,
.action-icon, 
.detail-icon,
.title-icon,
.btn-icon,
.search-icon,
.clear-search,
.call-btn,
.menu-btn,
.payment-menu,
.doctor-menu,
.nav-btn,
.mobile-menu-toggle,
.close-icon {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Android Emoji", "EmojiSymbols", "Segoe UI Symbol", sans-serif !important;
    font-variant-emoji: emoji !important;
    font-style: normal !important;
    font-weight: normal !important;
    text-rendering: optimizeLegibility !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    line-height: 1 !important;
    speak: none !important;
}

/* Specific icon fixes for common issues */
.stat-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 48px !important;
    width: 60px !important;
    height: 60px !important;
    border-radius: 12px !important;
    background: rgba(74, 144, 226, 0.1) !important;
    color: #4a90e2 !important;
    transition: all 0.2s ease !important;
}

/* Ensure emojis are visible even with custom fonts */
.stat-icon::before {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif !important;
}

/* Individual icon content enforcement */
.stat-icon.patients::before { content: "??" !important; }
.stat-icon.consultation::before { content: "??" !important; }
.stat-icon.staff::before { content: "?????" !important; }
.stat-icon.rooms::before { content: "??" !important; }

.search-btn::before { content: "??" !important; }
.header-btn.notification-btn::before { content: "??" !important; }

/* Alternative approach - if emojis fail, use text */
@supports not (font-variant-emoji: emoji) {
    .stat-icon.patients::after { content: "PAT" !important; font-size: 16px !important; font-weight: bold !important; color: #4a90e2 !important; }
    .stat-icon.consultation::after { content: "MED" !important; font-size: 16px !important; font-weight: bold !important; color: #FF5722 !important; }
    .stat-icon.staff::after { content: "DOC" !important; font-size: 16px !important; font-weight: bold !important; color: #FFC107 !important; }
    .stat-icon.rooms::after { content: "ROOM" !important; font-size: 14px !important; font-weight: bold !important; color: #4CAF50 !important; }
}

/* Global layout fixes for sidebar navigation - CRITICAL FIXES */
html, body {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important; /* Prevent horizontal scrolling globally */
    height: 100%;
    width: 100%;
}

/* Ensure proper layout spacing - this is critical */
.page {
    width: 100vw !important;
    overflow-x: hidden !important;
    position: relative !important;
}

/* Fix for any content that might overflow */
*, *::before, *::after {
    box-sizing: border-box !important;
}

/* CRITICAL: Ensure all page containers respect the sidebar with high specificity */
body .page .main-content.with-sidebar {
    margin-left: 260px !important;
    width: calc(100% - 260px) !important;
    max-width: calc(100% - 260px) !important;
}

/* Alternative high-specificity selector */
html body div.page main.main-content.with-sidebar {
    margin-left: 260px !important;
    width: calc(100% - 260px) !important;
    max-width: calc(100% - 260px) !important;
}

/* Override any absolute/fixed positioning that might cause overlap */
.dashboard-container,
.dashboard-content,
.dashboard-header,
.appointments-management-container,
.patients-management-container,
.doctors-container {
    position: relative !important;
    width: 100% !important;
    max-width: none !important;
    left: 0 !important;
    right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    top: 0 !important;
}

/* Ensure the content wrapper doesn't have conflicting styles */
.content.px-4,
article.content.px-4 {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    position: relative !important;
}

/* Make sure the main content area properly accommodates sidebar */
.main-content.with-sidebar {
    padding-left: 0 !important;
    padding-right: 0 !important;
    position: relative !important;
}

/* Critical override for dashboard specifically */
body .page .main-content.with-sidebar .dashboard-content {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    left: 0 !important;
    right: 0 !important;
}

/* NAVIGATION STYLING - Bright blue theme with no horizontal scroll */
.medical-sidebar {
    background: linear-gradient(180deg, #1e3a5f 0%, #1a2d4a 100%) !important;
    color: #ffffff !important;
    overflow-x: hidden !important; /* Critical: Prevent horizontal scrolling */
    overflow-y: auto !important;
    width: 260px !important;
    max-width: 260px !important;
    box-sizing: border-box !important;
}

.medical-sidebar a,
.medical-sidebar a:link,
.medical-sidebar a:visited,
.medical-sidebar a:hover,
.medical-sidebar a:active,
.medical-sidebar a:focus {
    text-decoration: none !important;
    color: #ffffff !important;
}

/* Blazor NavLink specific overrides for bright blue theme */
.medical-sidebar .nav-item.single,
.medical-sidebar .nav-sublink {
    text-decoration: none !important;
    color: #ffffff !important;
    overflow: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.medical-sidebar .nav-item.single:hover {
    background: rgba(40, 167, 69, 0.15) !important;
    color: #ffffff !important;
}

.medical-sidebar .nav-item.single.active {
    background: rgba(40, 167, 69, 0.2) !important;
    color: #ffffff !important;
}

/* Ensure no underlines on any navigation elements */
.sidebar a,
.sidebar a:link,
.sidebar a:visited,
.sidebar a:hover,
.sidebar a:active,
.sidebar a:focus {
    text-decoration: none !important;
    color: #ffffff !important;
}

/* Force white text throughout navigation and prevent overflow */
.medical-sidebar *,
.medical-sidebar .nav-text,
.medical-sidebar .nav-icon,
.medical-sidebar .nav-arrow {
    color: #ffffff !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* Critical: Ensure all navigation elements fit within sidebar width */
.medical-sidebar .sidebar-nav,
.medical-sidebar .nav-item,
.medical-sidebar .nav-toggle,
.medical-sidebar .nav-item.single,
.medical-sidebar .nav-item-content,
.medical-sidebar .sidebar-logo,
.medical-sidebar .sidebar-footer {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* CRITICAL MOBILE BUTTON FIX - Global override for mobile menu toggle */
@media screen and (max-width: 768px) {
    /* Force mobile button visibility globally - ULTRA HIGH SPECIFICITY */
    .mobile-menu-toggle,
    button.mobile-menu-toggle,
    .page .mobile-menu-toggle,
    body .mobile-menu-toggle,
    html body .mobile-menu-toggle,
    html body div.page .mobile-menu-toggle {
        display: flex !important;
        position: fixed !important;
        top: 15px !important;
        left: 15px !important;
        z-index: 9999 !important;
        background: #007BFF !important;
        border: none !important;
        border-radius: 6px !important;
        padding: 12px !important;
        cursor: pointer !important;
        flex-direction: column !important;
        justify-content: space-around !important;
        align-items: center !important;
        width: 50px !important;
        height: 50px !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        -webkit-appearance: none !important;
        appearance: none !important;
        touch-action: manipulation !important;
    }
    
    .mobile-menu-toggle .hamburger-line,
    button.mobile-menu-toggle .hamburger-line {
        width: 24px !important;
        height: 3px !important;
        background: #ffffff !important;
        border-radius: 2px !important;
        margin: 0 auto !important;
        display: block !important;
        transition: all 0.3s ease !important;
    }
    
    /* Ensure mobile view works properly */
    .medical-sidebar {
        transform: translateX(-100%) !important;
        transition: transform 0.3s ease;
        overflow-x: hidden !important;
        z-index: 2000 !important;
    }
    
    .medical-sidebar.mobile-open {
        transform: translateX(0) !important;
    }
    
    /* Add overlay for mobile menu */
    .mobile-nav-overlay,
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1500;
        display: none;
    }
    
    .mobile-nav-overlay.show,
    .mobile-overlay {
        display: block !important;
    }
    
    /* Reset margins on mobile */
    body .page .main-content.with-sidebar,
    html body div.page main.main-content.with-sidebar {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .dashboard-content,
    .appointments-management-container,
    .patients-management-container,
    .doctors-container {
        padding: 70px 15px 15px 15px !important; /* Add top padding to account for hamburger button */
        margin: 0 !important;
    }
}

/* Extra specific mobile breakpoints for different devices */
@media screen and (max-width: 430px) {
    .mobile-menu-toggle,
    button.mobile-menu-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 9999 !important;
        -webkit-appearance: none !important;
        appearance: none !important;
    }
}

/* iPhone 12 Pro specific (390px width) */
@media screen and (max-width: 390px) {
    .mobile-menu-toggle,
    button.mobile-menu-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Touch device detection */
@media (pointer: coarse) {
    .mobile-menu-toggle,
    button.mobile-menu-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* No hover capability detection */
@media (hover: none) {
    .mobile-menu-toggle,
    button.mobile-menu-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}
