/* Enhanced Mobile-First CSS for TimeTracker */

/* Mobile-specific variables */
/* Force mobile dropdown styles with high specificity */
:root {
    --mobile-touch-target: 52px;
    --mobile-nav-height: 70px;
    --mobile-tabbar-height: 64px;
    --mobile-card-padding: 1.25rem;
    --mobile-button-height: 52px;
    --mobile-input-height: 56px;
    --mobile-section-spacing: 1.5rem;
    --mobile-card-spacing: 1rem;
    --mobile-border-radius: 12px;
    --mobile-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --mobile-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Enhanced Mobile-specific improvements */
@media (max-width: 768px) {
    /* Prevent content from being hidden behind the tab bar */
    main {
        padding-bottom: calc(var(--mobile-section-spacing) + var(--mobile-tabbar-height) + env(safe-area-inset-bottom));
    }

    /* Container improvements */
    .container, .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
        max-width: 100%;
    }
    
    /* Enhanced Row and Column Layout */
    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    .col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        margin-bottom: var(--mobile-card-spacing);
    }
    
    .col:last-child {
        margin-bottom: 0;
    }
    
    /* Enhanced Card Layout */
    .card {
        margin-bottom: var(--mobile-card-spacing);
        border-radius: var(--mobile-border-radius);
        box-shadow: var(--mobile-shadow);
        border: 1px solid #e2e8f0;
        transition: all 0.3s ease;
    }
    
    .card:hover {
        box-shadow: var(--mobile-shadow-hover);
        transform: translateY(-2px);
    }
    
    .card-body {
        padding: var(--mobile-card-padding);
    }
    
    .card-header {
        padding: 1.25rem var(--mobile-card-padding);
        border-bottom: 1px solid #e2e8f0;
        background: #f8fafc;
    }
    
    /* Enhanced Button Layout */
    .btn {
        min-height: var(--mobile-button-height);
        padding: 1rem 1.5rem;
        font-size: 1rem;
        border-radius: var(--mobile-border-radius);
        font-weight: 500;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        transition: all 0.3s ease;
        -webkit-tap-highlight-color: transparent;
        width: 100%;
        margin-bottom: 0.75rem;
        gap: 0.5rem;
    }
    
    .btn:last-child {
        margin-bottom: 0;
    }
    
    .btn:active {
        transform: scale(0.98);
    }
    
    .btn-sm {
        min-height: 44px;
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .btn-lg {
        min-height: 60px;
        padding: 1.25rem 2rem;
        font-size: 1.125rem;
    }
    
    /* Enhanced Button Group Layout */
    .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }
    
    .btn-group .btn {
        border-radius: var(--mobile-border-radius) !important;
        margin-bottom: 0;
        width: 100%;
    }
    
    /* Enhanced Form Layout */
    .form-control, .form-select {
        min-height: var(--mobile-input-height);
        padding: 1rem 1.25rem;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: var(--mobile-border-radius);
        border: 2px solid #e2e8f0;
        transition: all 0.3s ease;
        background: white;
        width: 100%;
    }
    
    .form-control:focus, .form-select:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
        outline: none;
        transform: translateY(-1px);
    }
    
    .form-label {
        font-weight: 600;
        color: #1e293b;
        margin-bottom: 0.75rem;
        font-size: 0.95rem;
        display: block;
    }
    
    .form-text {
        font-size: 0.875rem;
        color: #64748b;
        margin-top: 0.5rem;
    }
    
    /* Enhanced Table Layout for Mobile */
    .table-responsive {
        border: none;
        border-radius: var(--mobile-border-radius);
        overflow: hidden;
        margin-bottom: var(--mobile-card-spacing);
    }
    
    .table {
        display: block;
        width: 100%;
        margin-bottom: 0;
    }
    
    .table thead {
        display: none;
    }
    
    .table tbody {
        display: block;
        width: 100%;
    }
    
    .table tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #e2e8f0;
        border-radius: var(--mobile-border-radius);
        background: white;
        box-shadow: var(--mobile-shadow);
        overflow: hidden;
        transition: all 0.3s ease;
    }
    
    .table tr:hover {
        box-shadow: var(--mobile-shadow-hover);
        transform: translateY(-1px);
    }
    
    .table td {
        display: block;
        text-align: left;
        padding: 1rem;
        border: none;
        border-bottom: 1px solid #f1f5f9;
        position: relative;
        background: white;
    }
    
    .table td:last-child {
        border-bottom: none;
    }
    
    .table td:before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: #1e293b;
        display: block;
        margin-bottom: 0.5rem;
        font-size: 0.875rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: #64748b;
    }
    
    .table td.actions-cell {
        text-align: left;
        padding: 1rem;
        background: #f8fafc;
    }
    
    .table td.actions-cell:before {
        display: block;
    }
    
    /* Enhanced Navigation Layout */
    .navbar {
        min-height: var(--mobile-nav-height);
        padding: 0.75rem 0;
        background: #ffffff !important;
        background-color: #ffffff !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .navbar-brand {
        font-size: 1.25rem;
        font-weight: 700;
    }
    
    .navbar-toggler {
        border: none;
        padding: 0.5rem;
        min-height: var(--mobile-touch-target);
        min-width: var(--mobile-touch-target);
        border-radius: var(--mobile-border-radius);
        background: #f8fafc;
    }
    
    .navbar-toggler:focus {
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    }
    
    .navbar-collapse {
        background: var(--bs-body-bg, #ffffff);
        border-top: 1px solid var(--border-color);
        margin-top: 0.75rem;
        padding: 1rem 0;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
        border-radius: 0 0 var(--mobile-border-radius) var(--mobile-border-radius);
        position: relative;
        z-index: 1100; /* above page content */
    }
    
    .navbar-nav .nav-link {
        padding: 1rem 1.5rem;
        margin: 0.25rem 0;
        border-radius: var(--mobile-border-radius);
        font-size: 1.1rem;
        min-height: var(--mobile-touch-target);
        display: flex;
        align-items: center;
        gap: 0.75rem;
        transition: all 0.3s ease;
    }
    
    .navbar-nav .nav-link:hover {
        background: #f8fafc;
        transform: translateX(4px);
    }
    
    .navbar-nav .nav-link.active {
        background: #3b82f6;
        color: white !important;
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    }
    
    .navbar-nav .nav-link i {
        width: 24px;
        text-align: center;
        font-size: 1.1rem;
    }
    
    /* Enhanced Dropdown Layout (navbar only) */
    .navbar .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        margin: 0;
        border: 1px solid var(--border-color) !important;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25) !important;
        background: var(--bs-dropdown-bg, #ffffff) !important;
        background-color: var(--bs-dropdown-bg, #ffffff) !important; /* ensure solid bg */
        border-radius: var(--mobile-border-radius);
        margin-top: 0.75rem;
        padding: 0.5rem;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        isolation: isolate; /* prevent blending with backdrop */
        z-index: 9999 !important;
    }
    
    .dropdown-item {
        padding: 0.875rem 1.5rem;
        border-radius: var(--mobile-border-radius);
        margin: 0.25rem 0;
        min-height: var(--mobile-touch-target);
        display: flex;
        align-items: center;
        gap: 0.75rem;
        transition: all 0.3s ease;
        color: var(--bs-dropdown-link-color, #1e293b) !important;
        background: var(--bs-dropdown-bg, #ffffff) !important; /* ensure solid bg for items */
        border: none;
        text-decoration: none;
        font-weight: 600;
        font-size: 1rem;
        text-shadow: none;
    }
    
    .dropdown-item:hover {
        background: var(--bs-dropdown-link-hover-bg, #f1f5f9) !important;
        color: var(--text-primary, #0f172a) !important;
        transform: translateX(4px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .dropdown-item:active {
        background: #e2e8f0 !important;
        transform: scale(0.98);
    }
    
    .dropdown-divider {
        border-top: 1px solid #e2e8f0 !important;
        margin: 0.5rem 0;
        opacity: 1;
    }
    
    /* Enhanced dropdown toggle button */
    .dropdown-toggle {
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        color: #1e293b !important;
        font-weight: 500 !important;
        padding: 0.75rem 1rem !important;
        border-radius: var(--mobile-border-radius) !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
        text-decoration: none !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        min-height: var(--mobile-touch-target) !important;
    }
    
    .dropdown-toggle:hover {
        background: #f8fafc !important;
        border-color: #cbd5e1 !important;
        color: #0f172a !important;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
    }
    
    .dropdown-toggle:focus {
        background: #ffffff !important;
        border-color: #3b82f6 !important;
        color: #1e293b !important;
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1) !important;
        outline: none !important;
    }
    
    .dropdown-toggle::after {
        border-top-color: #64748b !important;
        margin-left: 0.5rem !important;
        border-width: 0.3em 0.3em 0 !important;
    }
    
    /* Ensure navbar dropdown is visible when open */
    .navbar .dropdown.show .dropdown-menu {
        display: block !important;
        transform: none !important;
    }
    
    /* Improve dropdown accessibility (navbar only) */
    .navbar .dropdown-menu[data-bs-popper] {
        position: static !important;
        transform: none !important;
    }
    
    /* Override Bootstrap dropdown styles (navbar only) */
    .navbar .dropdown-menu.show {
        display: block !important;
        transform: none !important;
        background: var(--bs-dropdown-bg, #ffffff) !important;
        border: 1px solid var(--border-color) !important;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25) !important;
    }
    
    /* Force navbar dropdown visibility */
    .navbar .dropdown.show .dropdown-menu,
    .navbar .dropdown-menu.show,
    .navbar .dropdown-menu[data-bs-popper="static"] {
        display: block !important;
        background: var(--bs-dropdown-bg, #ffffff) !important;
        border: 1px solid var(--border-color) !important;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25) !important;
        z-index: 9999 !important;
    }
    
    /* Additional dropdown overrides for Bootstrap (navbar only) */
    .navbar .dropdown-menu[data-bs-popper="static"],
    .navbar .dropdown-menu[data-bs-popper="dynamic"] {
        position: static !important;
        transform: none !important;
        inset: auto !important;
        margin: 0.75rem 0 0 0 !important;
    }
    
    /* Ensure dropdown container is visible */
    .dropdown {
        position: relative !important;
    }
    
    /* Override any Bootstrap positioning */
    .dropdown-menu.dropdown-menu-end {
        right: auto !important;
        left: auto !important;
        position: static !important;
    }
    
    /* Enhanced Modal Layout */
    .modal-dialog {
        margin: 0.75rem;
        max-width: calc(100% - 1.5rem);
    }
    
    .modal-content {
        border-radius: var(--mobile-border-radius);
        border: none;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    }
    
    .modal-header, .modal-body, .modal-footer {
        padding: 1.25rem;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin-bottom: 0;
    }
    
    /* Enhanced Typography */
    h1 { font-size: 1.875rem; line-height: 1.2; }
    h2 { font-size: 1.625rem; line-height: 1.2; }
    h3 { font-size: 1.375rem; line-height: 1.3; }
    h4 { font-size: 1.125rem; line-height: 1.3; }
    h5 { font-size: 1rem; line-height: 1.4; }
    h6 { font-size: 0.95rem; line-height: 1.4; }
    
    /* Enhanced Spacing */
    .mb-4 { margin-bottom: var(--mobile-section-spacing) !important; }
    .mb-3 { margin-bottom: var(--mobile-card-spacing) !important; }
    .mb-2 { margin-bottom: 0.75rem !important; }
    
    .py-4 { padding-top: var(--mobile-section-spacing) !important; padding-bottom: var(--mobile-section-spacing) !important; }
    .py-3 { padding-top: var(--mobile-card-spacing) !important; padding-bottom: var(--mobile-card-spacing) !important; }
    
    .px-4 { padding-left: var(--mobile-card-padding) !important; padding-right: var(--mobile-card-padding) !important; }
    .px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }
    
    /* Enhanced Utility Classes */
    .mobile-stack {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .mobile-stack .btn {
        margin-bottom: 0;
        width: 100%;
    }
    
    .touch-target {
        min-height: var(--mobile-touch-target);
        min-width: var(--mobile-touch-target);
    }
    
    /* Enhanced Mobile Components */
    .mobile-card {
        margin-bottom: var(--mobile-card-spacing);
        border-radius: var(--mobile-border-radius);
        box-shadow: var(--mobile-shadow);
        transition: all 0.3s ease;
    }

    /* Mobile table action group horizontal layout */
    .table td .btn-group {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0.5rem;
        width: 100%;
    }
    .table td .btn-group .btn {
        flex: 1 1 auto;
        min-width: 0;
        padding: 0.875rem 0.75rem;
        font-size: 1rem;
    }
    
    .mobile-card:hover {
        box-shadow: var(--mobile-shadow-hover);
        transform: translateY(-2px);
    }
    
    .mobile-btn {
        width: 100%;
        margin-bottom: 0.75rem;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-height: var(--mobile-button-height);
        border-radius: var(--mobile-border-radius);
    }
    
    .mobile-btn:last-child {
        margin-bottom: 0;
    }
    
    /* Enhanced Mobile Table Layout */
    .mobile-table-row {
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: var(--mobile-border-radius);
        margin-bottom: var(--mobile-card-spacing);
        padding: 1rem;
        box-shadow: var(--mobile-shadow);
        transition: all 0.3s ease;
    }
    
    .mobile-table-row:hover {
        box-shadow: var(--mobile-shadow-hover);
        transform: translateY(-1px);
    }
    
    .mobile-table-row .row {
        margin: 0;
    }
    
    .mobile-table-row .col {
        padding: 0.75rem 0;
        border-bottom: 1px solid #f1f5f9;
        margin-bottom: 0.5rem;
    }
    
    .mobile-table-row .col:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }
    
    .mobile-table-row .col:before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: #1e293b;
        display: block;
        margin-bottom: 0.5rem;
        font-size: 0.875rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: #64748b;
    }
    
    /* Enhanced Mobile Form Layout */
    .mobile-form-group {
        margin-bottom: 1.5rem;
    }
    
    .mobile-form-group .form-label {
        display: block;
        margin-bottom: 0.75rem;
        font-weight: 600;
        color: #1e293b;
    }
    
    .mobile-form-group .form-control,
    .mobile-form-group .form-select {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .mobile-form-group .form-text {
        margin-top: 0.25rem;
        font-size: 0.8rem;
    }
    
    /* Enhanced Mobile Navigation */
    .mobile-nav-item {
        padding: 1rem 1.5rem;
        border-radius: var(--mobile-border-radius);
        margin: 0.25rem 0;
        transition: all 0.3s ease;
        min-height: var(--mobile-touch-target);
        display: flex;
        align-items: center;
        gap: 0.75rem;
        background: white;
        border: 1px solid #e2e8f0;
    }
    
    .mobile-nav-item:hover {
        background: #f8fafc;
        transform: translateX(4px);
        box-shadow: var(--mobile-shadow);
    }
    
    .mobile-nav-item.active {
        background: #3b82f6;
        color: white;
        border-color: #3b82f6;
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    }
    
    /* Enhanced Mobile Animations */
    .mobile-fade-in {
        animation: mobileFadeIn 0.4s ease-out;
    }
    
    .mobile-slide-up {
        animation: mobileSlideUp 0.4s ease-out;
    }
    
    @keyframes mobileFadeIn {
        from { 
            opacity: 0; 
            transform: translateY(20px); 
        }
        to { 
            opacity: 1; 
            transform: translateY(0); 
        }
    }
    
    @keyframes mobileSlideUp {
        from { 
            opacity: 0; 
            transform: translateY(30px); 
        }
        to { 
            opacity: 1; 
            transform: translateY(0); 
        }
    }
    
    /* Enhanced Mobile Shadows */
    .mobile-shadow {
        box-shadow: var(--mobile-shadow);
    }
    
    .mobile-shadow-hover {
        box-shadow: var(--mobile-shadow-hover);
    }
    
    /* Enhanced Mobile Borders */
    .mobile-border {
        border: 1px solid #e2e8f0;
        border-radius: var(--mobile-border-radius);
    }
    
    /* Enhanced Mobile Backgrounds */
    .mobile-bg-light {
        background-color: #f8fafc;
    }
    
    .mobile-bg-white {
        background-color: white;
    }
    
    /* Enhanced Mobile Text Colors */
    .mobile-text-primary {
        color: #1e293b !important;
    }
    
    .mobile-text-secondary {
        color: #475569 !important;
    }
    
    .mobile-text-muted {
        color: #64748b !important;
    }
    
    /* Enhanced Mobile Spacing Utilities */
    .mobile-p-0 { padding: 0 !important; }
    .mobile-p-1 { padding: 0.25rem !important; }
    .mobile-p-2 { padding: 0.5rem !important; }
    .mobile-p-3 { padding: 1rem !important; }
    .mobile-p-4 { padding: 1.25rem !important; }
    
    .mobile-m-0 { margin: 0 !important; }
    .mobile-m-1 { margin: 0.25rem !important; }
    .mobile-m-2 { margin: 0.5rem !important; }
    .mobile-m-3 { margin: 1rem !important; }
    .mobile-m-4 { margin: 1.25rem !important; }
    
    /* Enhanced Mobile Grid Layout */
    .mobile-grid-2 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .mobile-grid-3 {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 0.75rem;
    }
    
    @media (max-width: 480px) {
        .mobile-grid-2,
        .mobile-grid-3 {
            grid-template-columns: 1fr;
        }
    }
}

/* Mobile Bottom Tab Bar */
@media (max-width: 768px) {
    .mobile-tabbar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: calc(var(--mobile-tabbar-height) + env(safe-area-inset-bottom));
        background: #ffffff;
        border-top: 1px solid #e2e8f0;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
        display: flex;
        align-items: center;
        justify-content: space-around;
        padding-bottom: env(safe-area-inset-bottom);
        z-index: 1040;
    }
    .mobile-tabbar .tab-item {
        flex: 1 1 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.25rem;
        height: var(--mobile-tabbar-height);
        color: #475569;
        text-decoration: none;
        font-size: 0.8rem;
        font-weight: 600;
    }
    .mobile-tabbar .tab-item .tab-icon {
        font-size: 1.25rem;
        line-height: 1;
    }
    .mobile-tabbar .tab-item.active {
        color: #3b82f6;
    }
}

/* Respect forced light theme on mobile if explicitly set */
@media (prefers-color-scheme: dark) {
    html[data-theme="light"] .navbar,
    html[data-theme="light"] .mobile-tabbar {
        background: #ffffff !important;
        border-color: #e2e8f0 !important;
    }
}

/* Enhanced Small Mobile Devices */
@media (max-width: 480px) {
    .container, .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-header {
        padding: 1rem 1rem;
    }
    
    .btn {
        padding: 1rem 1.25rem;
        font-size: 0.95rem;
        min-height: 56px;
    }
    
    .form-control, .form-select {
        padding: 0.875rem 1rem;
        min-height: 56px;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .table td {
        padding: 0.875rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-header, .modal-body, .modal-footer {
        padding: 1rem;
    }
    
    /* Enhanced Small Mobile Typography */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.125rem; }
    h5 { font-size: 1rem; }
    h6 { font-size: 0.9rem; }
    
    /* Enhanced Small Mobile Spacing */
    .mb-4 { margin-bottom: 1.25rem !important; }
    .mb-3 { margin-bottom: 1rem !important; }
    .mb-2 { margin-bottom: 0.75rem !important; }
    
    .py-4 { padding-top: 1.25rem !important; padding-bottom: 1.25rem !important; }
    .py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
}

/* Enhanced Landscape Mobile Devices */
@media (max-width: 768px) and (orientation: landscape) {
    .navbar-collapse {
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        min-height: 48px;
        padding: 0.875rem 1.5rem;
    }
}

/* Enhanced High-DPI Mobile Devices */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .btn, .form-control, .form-select {
        border-width: 0.5px;
    }
    
    .table td {
        border-bottom-width: 0.5px;
    }
    
    .card {
        border-width: 0.5px;
    }
}

/* Enhanced Mobile Print Styles */
@media print and (max-width: 768px) {
    .navbar, .btn, .modal, .dropdown {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
        margin-bottom: 1rem !important;
    }
    
    .table td {
        border: 1px solid #000 !important;
    }
    
    .container {
        padding: 0 !important;
        max-width: 100% !important;
    }
}

/* Enhanced Analytics Dashboard Mobile Styles */
@media (max-width: 768px) {
    .chart-container {
        min-height: 250px !important;
        margin-bottom: var(--mobile-card-spacing);
    }
    
    .analytics-card {
        margin-bottom: var(--mobile-card-spacing);
    }
    
    .analytics-summary-card {
        padding: 1rem;
        text-align: center;
    }
    
    .analytics-summary-card h6 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
        color: #1e293b;
    }
    
    .analytics-summary-card small {
        font-size: 0.8rem;
        color: #64748b;
    }
    
    .analytics-summary-card i {
        font-size: 1.5rem !important;
        margin-bottom: 0.75rem;
        color: #3b82f6;
    }
    
    .analytics-chart-wrapper {
        background: white;
        border-radius: var(--mobile-border-radius);
        padding: 1rem;
        box-shadow: var(--mobile-shadow);
        margin-bottom: var(--mobile-card-spacing);
    }
}

/* Enhanced Chart.js Mobile Optimizations */
@media (max-width: 768px) {
    .chartjs-tooltip {
        font-size: 0.875rem !important;
        padding: 0.75rem !important;
        border-radius: var(--mobile-border-radius);
        box-shadow: var(--mobile-shadow-hover);
    }
    
    .chartjs-legend {
        font-size: 0.875rem !important;
        margin-top: 1rem;
    }
    
    .chartjs-legend-item {
        margin-bottom: 0.5rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
}

/* Enhanced Mobile Loading States */
@media (max-width: 768px) {
    .loading-skeleton {
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        animation: loading 1.5s infinite;
        border-radius: var(--mobile-border-radius);
        height: 20px;
        margin-bottom: 0.75rem;
    }
    
    @keyframes loading {
        0% { background-position: 200% 0; }
        100% { background-position: -200% 0; }
    }
    
    .loading-card {
        min-height: 200px;
        background: #f8fafc;
        border-radius: var(--mobile-border-radius);
        display: flex;
        align-items: center;
        justify-content: center;
        color: #64748b;
        font-size: 0.9rem;
    }
}

/* Enhanced Mobile Accessibility */
@media (max-width: 768px) {
    /* Focus indicators for better accessibility */
    .btn:focus,
    .form-control:focus,
    .form-select:focus,
    .nav-link:focus {
        outline: 2px solid #3b82f6;
        outline-offset: 2px;
    }
    
    /* High contrast mode support */
    @media (prefers-contrast: high) {
        .card {
            border: 2px solid #000;
        }
        
        .btn {
            border: 2px solid #000;
        }
        
        .table td {
            border-bottom: 2px solid #000;
        }
        
        .dropdown-menu {
            border: 2px solid #000 !important;
            background: #fff !important;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
        }
        
        .dropdown-item {
            color: #000 !important;
            border-bottom: 1px solid #000;
        }
        
        .dropdown-item:hover {
            background: #000 !important;
            color: #fff !important;
        }
        
        .dropdown-divider {
            border-top: 2px solid #000 !important;
        }
    }
    
    /* Reduced motion support */
    @media (prefers-reduced-motion: reduce) {
        .card,
        .btn,
        .nav-link,
        .table tr {
            transition: none;
        }
        
        .mobile-fade-in,
        .mobile-slide-up {
            animation: none;
        }
    }
}

/* Enhanced Mobile Dark Mode Support */
@media (max-width: 768px) {
    @media (prefers-color-scheme: dark) {
        :root {
            --mobile-bg-primary: #1e293b;
            --mobile-bg-secondary: #334155;
            --mobile-text-primary: #f1f5f9;
            --mobile-text-secondary: #cbd5e1;
            --mobile-border-color: #475569;
        }
        
        .card {
            background: var(--mobile-bg-secondary);
            border-color: var(--mobile-border-color);
            color: var(--mobile-text-primary);
        }
        
        .navbar {
            background: var(--mobile-bg-primary) !important;
        }
        
        .navbar-collapse {
            background: var(--mobile-bg-primary);
            border-color: var(--mobile-border-color);
        }
        
        .table td {
            background: var(--mobile-bg-secondary);
            color: var(--mobile-text-secondary);
        }
        
        .form-control, .form-select {
            background: var(--mobile-bg-secondary);
            border-color: var(--mobile-border-color);
            color: var(--mobile-text-primary);
        }
        
        /* Dark mode dropdown styling */
        .dropdown-menu {
            background: var(--mobile-bg-secondary) !important;
            border-color: var(--mobile-border-color);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        }
        
        .dropdown-item {
            color: var(--mobile-text-primary) !important;
        }
        
        .dropdown-item:hover {
            background: var(--mobile-bg-primary) !important;
            color: var(--mobile-text-primary) !important;
        }
        
        .dropdown-item:active {
            background: var(--mobile-border-color) !important;
        }
        
        .dropdown-divider {
            border-top-color: var(--mobile-border-color) !important;
        }
        
        .dropdown-toggle::after {
            border-top-color: var(--mobile-text-secondary);
        }
        
        /* Dark mode dropdown toggle button */
        .dropdown-toggle {
            background: var(--mobile-bg-secondary) !important;
            border-color: var(--mobile-border-color) !important;
            color: var(--mobile-text-primary) !important;
        }
        
        .dropdown-toggle:hover {
            background: var(--mobile-bg-primary) !important;
            border-color: var(--mobile-text-secondary) !important;
            color: var(--mobile-text-primary) !important;
        }
        
        .dropdown-toggle:focus {
            background: var(--mobile-bg-secondary) !important;
            border-color: var(--mobile-text-secondary) !important;
            color: var(--mobile-text-primary) !important;
        }
        
        .dropdown-toggle.show {
            background: var(--mobile-bg-primary) !important;
            border-color: var(--mobile-text-secondary) !important;
            color: var(--mobile-text-primary) !important;
        }
    }
}

/* Mobile dropdown: keep static width and spacing without forcing visibility */
@media (max-width: 768px) {
    .navbar .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        margin: 0.75rem 0 0 0;
        border: 2px solid #3b82f6 !important;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25) !important;
        border-radius: var(--mobile-border-radius);
        padding: 0.5rem;
    }
    .dropdown-item {
        padding: 0.875rem 1.5rem;
        border-radius: var(--mobile-border-radius);
        min-height: var(--mobile-touch-target);
        display: flex;
        align-items: center;
        gap: 0.75rem;
        font-weight: 600;
    }
}
