﻿.leaflet-popup {
    pointer-events: none;
}

.fsh-center-text {
    text-align: center !important;
}

.mud-button-filled {
    box-shadow: 0 3px 1px -2px rgb(0 0 0 / 30%), 0 2px 2px 0 rgb(0 0 0 / 0), 0 1px 5px 0 rgb(0 0 0 / 10%) !important;
}

.mud-dialog {
    box-shadow: 0 3px 1px -2px rgb(0 0 0 / 10%), 0 2px 2px 0 rgb(0 0 0 / 0), 0 10px 10px 0 rgb(0 0 0 / 5%) !important;
}

.mud-nav-link {
    white-space: normal !important;
    padding: 12px 16px 12px 38px;
}

    .mud-nav-link.active:not(.mud-nav-link-disabled) {
        border-right: 3px solid var(--mud-palette-primary);
        background-color: rgba(var(--mud-palette-primary-rgb), 0.1);
    }

.mud-table {
    padding: 20px !important;
    margin-bottom: 20px !important;
}

.mud-card {
    margin-bottom: 20px !important;
}

#blazor-error-ui {
    color: var(--mud-palette-drawer-text);
    background: var(--mud-palette-drawer-background);
}

.mud-overlay-dark {
    backdrop-filter: blur(2px);
}

.mud-card-header .mud-card-header-avatar {
    margin-inline-end: 10px !important;
}

.mud-nav-link {
    padding: 12px 16px 12px 15px !important;
}

.mud-dialog-content {
    max-height: 75vh !important;
    overflow: auto !important;
}

.mud-grid-spacing-xs-3 {
    margin: 0px !important;
    margin-left: -12px !important;
}

.mud-table-toolbar
{
    flex-wrap:wrap;
    margin-bottom:20px!important;
}

::-webkit-scrollbar {
    width: 2px!important;
    height: 6px!important;
}
.fsh-nav-child {
    padding-left: 10px !important;
}

/* ========================================
   LOADING SCREEN LOGO RESPONSIVE
   ======================================== */
.loading-logo {
    width: 450px;
    height: auto;
    opacity: 0.8;
    max-width: 90%;
}

@media (max-width: 599px) {
    .loading-logo {
        width: 100%;
        max-width: 420px;
        height: auto;
    }
}

@media (min-width: 600px) and (max-width: 899px) {
    .loading-logo {
        width: 350px;
        max-width: 80%;
    }
}

/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

/* PHONES: 0-599px */
@media (max-width: 599px) {
    /* Container adjustments */
    .mud-container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    /* Table horizontal scroll */
    .mud-table-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .mud-table {
        min-width: 100%;
        font-size: 0.75rem !important;
        width: 100%;
    }

    /* Hide non-critical columns on phones (data rows) */
    .mud-table-body .mud-table-cell.mobile-hide {
        display: none !important;
    }

    /* Ensure table header row is visible */
    .mud-table-head,
    .mud-table-head tr,
    .mud-table thead,
    .mud-table thead tr {
        display: table-header-group !important;
        visibility: visible !important;
    }

    .mud-table-head tr,
    .mud-table thead tr {
        display: table-row !important;
    }

    /* HEADER ROW: Hide all header cells EXCEPT the first one (checkbox) */
    .mud-table-head .mud-table-cell:not(:first-child),
    .mud-table-head th:not(:first-child),
    .mud-table thead th:not(:first-child) {
        display: none !important;
    }

    /* Ensure checkbox header (first cell) is visible */
    .mud-table-head .mud-table-cell:first-child,
    .mud-table-head th:first-child,
    .mud-table thead th:first-child {
        display: table-cell !important;
        visibility: visible !important;
        text-align: center !important;
        padding: 8px !important;
        min-width: 50px !important;
    }

    /* Ensure the checkbox inside header is visible */
    .mud-table-head .mud-checkbox,
    .mud-table thead .mud-checkbox {
        display: inline-flex !important;
        visibility: visible !important;
    }

    /* Larger action buttons for touch (48px - WCAG AAA) */
    .action-btn {
        min-width: 48px !important;
        width: 48px !important;
        height: 48px !important;
    }

    /* Full-width drawer on phones */
    .mud-drawer-left {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Compact stats */
    .stat-value {
        font-size: 1.5rem !important;
    }

    .stat-label {
        font-size: 0.75rem !important;
    }

    /* Card spacing */
    .mud-card {
        margin-bottom: 12px !important;
    }

    /* Dialog adjustments */
    .mud-dialog {
        margin: 8px !important;
    }

    .mud-dialog-content {
        padding: 12px !important;
    }

    /* Form spacing */
    .mud-input {
        font-size: 0.875rem !important;
    }

    /* Toolbar adjustments */
    .mud-toolbar {
        padding: 8px !important;
    }

    /* Reduce table padding */
    .mud-table {
        padding: 8px !important;
    }
}

/* TABLETS: 600-899px */
@media (min-width: 600px) and (max-width: 899px) {
    /* Table horizontal scroll */
    .mud-table-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .mud-table {
        min-width: 100%;
        width: 100%;
    }

    /* Hide very low priority columns on tablets (data rows) */
    .mud-table-body .mud-table-cell.tablet-hide {
        display: none !important;
    }

    /* Ensure table header row is visible */
    .mud-table-head,
    .mud-table-head tr,
    .mud-table thead,
    .mud-table thead tr {
        display: table-header-group !important;
        visibility: visible !important;
    }

    .mud-table-head tr,
    .mud-table thead tr {
        display: table-row !important;
    }

    /* HEADER ROW: Hide all header cells EXCEPT the first one (checkbox) */
    .mud-table-head .mud-table-cell:not(:first-child),
    .mud-table-head th:not(:first-child),
    .mud-table thead th:not(:first-child) {
        display: none !important;
    }

    /* Ensure checkbox header (first cell) is visible */
    .mud-table-head .mud-table-cell:first-child,
    .mud-table-head th:first-child,
    .mud-table thead th:first-child {
        display: table-cell !important;
        visibility: visible !important;
        text-align: center !important;
        min-width: 50px !important;
    }

    /* Ensure the checkbox inside header is visible */
    .mud-table-head .mud-checkbox,
    .mud-table thead .mud-checkbox {
        display: inline-flex !important;
        visibility: visible !important;
    }

    /* Medium action buttons (44px - WCAG AA) */
    .action-btn {
        min-width: 44px !important;
        width: 44px !important;
        height: 44px !important;
    }

    /* 280px drawer on tablets */
    .mud-drawer-left {
        width: 280px !important;
    }

    /* Container adjustments */
    .mud-container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

/* MOBILE COMMON: Both phones and tablets */
@media (max-width: 899px) {
    /* Table cell text handling */
    .mud-table-cell {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Checkbox and radio adjustments */
    .mud-checkbox,
    .mud-radio {
        padding: 8px !important;
    }

    /* Navigation adjustments */
    .mud-nav-link {
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
    }

    .fsh-nav-child {
        padding-left: 8px !important;
        font-size: 0.8rem !important;
    }

    .mud-nav-link .mud-icon-root {
        font-size: 1.2rem !important;
    }

    .mud-navgroup-header {
        padding: 6px 12px !important;
    }

    /* Button adjustments */
    .mud-button {
        padding: 8px 12px !important;
    }

    /* Appbar adjustments */
    .mud-appbar {
        padding: 8px !important;
    }

    /* Scroll indicator for tables */
    .scroll-indicator {
        position: absolute;
        top: 0;
        right: 0;
        background: rgba(33, 150, 243, 0.9);
        color: white;
        padding: 4px 8px;
        font-size: 0.7rem;
        border-radius: 0 0 0 8px;
        z-index: 1;
        transition: opacity 0.3s;
    }

    /* Grid adjustments */
    .mud-grid-spacing-xs-3 {
        margin-left: -6px !important;
    }

    /* Card header adjustments */
    .mud-card-header {
        padding: 12px !important;
    }

    .mud-card-content {
        padding: 12px !important;
    }

    /* Chip adjustments */
    .mud-chip {
        font-size: 0.75rem !important;
    }
}