/* MOBILE RESPONSIVE STYLES */

/* Mobile and Tablet breakpoints - up to 1200px */
@media screen and (max-width: 1200px) {
    /* Show hamburger menu - high specificity to override inline styles */
    .mobile-burger-btn,
    #mobile-menu-button.mobile-burger-btn,
    .mantine-ActionIcon-root.mobile-burger-btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        visibility: visible !important;
    }
    
    /* Hide desktop navigation elements */
    .desktop-only-section {
        display: none !important;
    }
    
    .desktop-nav-section {
        display: none !important;
    }
    
    /* Hide sidebar on mobile/tablet */
    .sidebar-container {
        display: none !important;
    }
    
    /* Mobile header adjustments - logo sizing */
    .header-logo img {
        height: 22px !important;
        width: auto !important;
        transition: transform 0.2s ease !important;
    }
    
    .header-logo span {
        font-size: 20px !important;
        margin-left: 6px !important;
        transition: font-size 0.2s ease !important;
    }
    
    /* Touch-friendly header elements */
    .header-logo:active {
        transform: scale(0.95) !important;
    }
    
    /* Ensure header elements are properly spaced */
    .mantine-Group-root {
        gap: 8px !important;
    }
    
    /* Mobile-friendly header padding */
    .mantine-AppShell-header {
        padding: 0 16px !important;
        min-height: 56px !important;
    }
}

/* Phone-specific styles - below 768px */
@media screen and (max-width: 768px) {
    /* Smaller logo on phones */
    .header-logo img {
        height: 18px !important;
        width: auto !important;
    }
    
    .header-logo span {
        font-size: 18px !important;
        margin-left: 4px !important;
    }
    
    /* Tighter spacing */
    .mantine-Group-root {
        gap: 4px !important;
    }
    
    /* Header padding adjustment for phones */
    .mantine-Group-root[style*="padding"] {
        padding: 0 16px !important;
    }
    
    /* Mobile-optimized header height */
    .mantine-AppShell-header {
        min-height: 52px !important;
        padding: 0 12px !important;
    }
}

/* Extra small phones - below 480px */
@media screen and (max-width: 480px) {
    .header-logo img {
        height: 16px !important;
    }
    
    .header-logo span {
        font-size: 16px !important;
        margin-left: 3px !important;
    }
    
    .mantine-Group-root[style*="padding"] {
        padding: 0 12px !important;
    }
    
    .mantine-AppShell-header {
        min-height: 48px !important;
        padding: 0 8px !important;
    }
    
    /* Smaller hamburger button on very small screens */
    .mobile-burger-btn,
    #mobile-menu-button.mobile-burger-btn {
        min-width: 36px !important;
        min-height: 36px !important;
    }
    
    /* Full width usage for small phones - remove all margins */
    html body div[data-mantine-component="AppShellMain"],
    [data-mantine-component="AppShellMain"],
    #page-content,
    #page-container-wrapper {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* Mobile-specific animations */
@media screen and (max-width: 1200px) {
    /* Smooth transitions for mobile interactions */
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Touch feedback for interactive elements */
    .mantine-NavLink-root:active,
    .mantine-Button-root:active,
    .mantine-ActionIcon-root:active {
        transform: scale(0.95) !important;
        transition: transform 0.1s ease !important;
    }
    
    /* Improved scroll behavior on mobile */
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
}

/* AG-GRID MOBILE OPTIMIZATIONS */
@media screen and (max-width: 1200px) {
    /* Touch-friendly ag-grid sizing */
    .explorer-ag-grid {
        margin-left: 10px !important;
        margin-right: 10px !important;
        max-height: 90vh !important;
        width: calc(100% - 20px) !important;
    }
    
    /* Bigger touch targets for ag-grid header cells */
    .ag-theme-alpine .ag-header-cell {
        padding: 10px 8px !important;
        min-height: 48px !important;  /* Touch-friendly minimum */
    }
    
    /* Bigger touch targets for ag-grid cells */
    .ag-theme-alpine .ag-cell {
        padding: 8px 6px !important;
        min-height: 40px !important;  /* Touch-friendly minimum */
    }
    
    /* Always show filter menu icon on mobile */
    .ag-theme-alpine .ag-header-menu-icon {
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Better floating filter visibility */
    .ag-theme-alpine .ag-floating-filter {
        padding: 4px 2px !important;
        min-height: 32px !important;
    }
    
    /* Ensure filter input is touchable */
    .ag-theme-alpine .ag-floating-filter-input input {
        padding: 6px 8px !important;
        font-size: 14px !important;
    }
    
    /* Better column header interaction area */
    .ag-theme-alpine .ag-header-cell-top {
        padding: 4px !important;
    }
    
    /* Prevent horizontal scrolling lock - leave margin for browser scroll */
    .ag-root {
        margin-left: 5px !important;
        margin-right: 5px !important;
    }
}

/* Small phones optimization (max 480px) */
@media screen and (max-width: 480px) {
    .explorer-ag-grid {
        margin-left: 5px !important;
        margin-right: 5px !important;
        width: calc(100% - 10px) !important;
    }
    
    .ag-theme-alpine .ag-header-cell {
        padding: 8px 4px !important;
        font-size: 12px !important;
    }
    
    .ag-theme-alpine .ag-cell {
        padding: 6px 4px !important;
        font-size: 12px !important;
    }
    
    /* Stack filter controls better on small screens */
    .ag-theme-alpine .ag-floating-filter {
        padding: 3px 2px !important;
    }
}