/* Anglo Eastern Table Header Fix - Option 2 (Light Maritime) as Default */

/* DEFAULT THEME: Option 2 - Light Maritime Theme */
.table thead th,
.table thead tr th,
.dataGrid thead th,
.dataGrid thead tr th,
.blazorise .table thead th,
.blazorise .table thead tr th,
[class*="table"] thead th,
[class*="dataGrid"] thead th,
.ae-data-table thead th {
    background: linear-gradient(135deg, #E8F4FD 0%, #F8FAFB 100%) !important;
    color: var(--ae-primary) !important;
    font-weight: 600 !important;
    border: 1px solid var(--ae-border) !important;
    border-bottom: 3px solid var(--ae-accent) !important;
    text-shadow: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    padding: 12px 8px !important;
    text-transform: uppercase !important;
    font-size: 0.85rem !important;
    letter-spacing: 0.5px !important;
}

/* Force visibility for all header content */
.table thead th *,
.table thead tr th *,
.dataGrid thead th *,
.dataGrid thead tr th *,
.blazorise .table thead th *,
.blazorise .table thead tr th *,
[class*="table"] thead th *,
[class*="dataGrid"] thead th *,
.ae-data-table thead th * {
    color: var(--ae-primary) !important;
    background: transparent !important;
    text-shadow: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure header text is always visible */
.table thead th:not([style*="display: none"]) {
    color: var(--ae-primary) !important;
    background: linear-gradient(135deg, #E8F4FD 0%, #F8FAFB 100%) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Override any potential Blazorise header styling conflicts */
.table[class*="blazorise"] thead th,
.table[class*="dataGrid"] thead th,
.table[class*="data-grid"] thead th {
    background: linear-gradient(135deg, #E8F4FD 0%, #F8FAFB 100%) !important;
    color: var(--ae-primary) !important;
    border: 1px solid var(--ae-border) !important;
    border-bottom: 3px solid var(--ae-accent) !important;
}

/* Force header text color in all possible contexts */
.table thead th span,
.table thead th div,
.table thead th a,
.table thead th button,
.table thead th input,
.table thead th .form-control {
    color: var(--ae-primary) !important;
    background: transparent !important;
}

/* Fix for HeaderThemeContrast.Light override */
.table[class*="theme-contrast-light"] thead th,
.table.thead-light thead th {
    background: linear-gradient(135deg, #E8F4FD 0%, #F8FAFB 100%) !important;
    color: var(--ae-primary) !important;
    border: 1px solid var(--ae-border) !important;
    border-bottom: 3px solid var(--ae-accent) !important;
}

/* Blazorise DataGrid specific header styling */
.blazorise .table thead th,
.blazorise .table-responsive .table thead th,
.dataGrid thead tr th,
.table[class*="dataGrid"] thead th,
.table.mb-0 thead th {
    background: linear-gradient(135deg, #E8F4FD 0%, #F8FAFB 100%) !important;
    color: var(--ae-primary) !important;
    font-weight: 600 !important;
    border: 1px solid var(--ae-border) !important;
    border-bottom: 3px solid var(--ae-accent) !important;
    text-shadow: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Fix for DataGrid components specifically */
.blazorise-datagrid .table thead th,
.blazorise-datagrid .table thead tr th {
    background: linear-gradient(135deg, #E8F4FD 0%, #F8FAFB 100%) !important;
    color: var(--ae-primary) !important;
    border: 1px solid var(--ae-border) !important;
    border-bottom: 3px solid var(--ae-accent) !important;
}

/* Fix for sort arrows and filter controls in headers */
.table thead th .sort-icon,
.table thead th .filter-icon,
.table thead th .dropdown-toggle {
    color: var(--ae-primary) !important;
}

/* OPTION 1: Subtle Gray Theme */
.table-theme-subtle thead th,
.table-theme-subtle thead tr th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    color: #495057 !important;
    font-weight: 600 !important;
    border: 1px solid #dee2e6 !important;
    border-bottom: 2px solid var(--ae-primary) !important;
    padding: 12px 8px !important;
    text-transform: uppercase !important;
    font-size: 0.85rem !important;
    letter-spacing: 0.5px !important;
    text-shadow: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.table-theme-subtle thead th * {
    color: #495057 !important;
    background: transparent !important;
}

/* OPTION 2: Light Maritime Theme (Now Default) */
.table-theme-light thead th,
.table-theme-light thead tr th {
    background: linear-gradient(135deg, #E8F4FD 0%, #F8FAFB 100%) !important;
    color: var(--ae-primary) !important;
    font-weight: 600 !important;
    border: 1px solid var(--ae-border) !important;
    border-bottom: 3px solid var(--ae-accent) !important;
    padding: 12px 8px !important;
    text-transform: uppercase !important;
    font-size: 0.85rem !important;
    letter-spacing: 0.5px !important;
    text-shadow: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.table-theme-light thead th * {
    color: var(--ae-primary) !important;
    background: transparent !important;
}

/* OPTION 3: Minimal Accent Theme */
.table-theme-minimal thead th,
.table-theme-minimal thead tr th {
    background: white !important;
    color: var(--ae-text) !important;
    font-weight: 600 !important;
    border: none !important;
    border-bottom: 4px solid var(--ae-accent) !important;
    border-left: 4px solid transparent !important;
    padding: 12px 8px !important;
    text-transform: uppercase !important;
    font-size: 0.85rem !important;
    letter-spacing: 0.5px !important;
    text-shadow: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
}

.table-theme-minimal thead th:first-child {
    border-left: 4px solid var(--ae-accent) !important;
}

.table-theme-minimal thead th * {
    color: var(--ae-text) !important;
    background: transparent !important;
}

/* LEGACY: Deep Blue Theme (for backwards compatibility) */
.table-theme-deep-blue thead th,
.table-theme-deep-blue thead tr th {
    background: linear-gradient(135deg, #1B365D 0%, #2E5984 100%) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    border: none !important;
    border-bottom: none !important;
    text-shadow: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    padding: 12px 8px !important;
    text-transform: uppercase !important;
    font-size: 0.85rem !important;
    letter-spacing: 0.5px !important;
}

.table-theme-deep-blue thead th * {
    color: #ffffff !important;
    background: transparent !important;
}

/* Header borders and corners */
.table thead th:first-child {
    border-top-left-radius: 8px !important;
}

.table thead th:last-child {
    border-top-right-radius: 8px !important;
}

/* Table body styling */
.table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background: linear-gradient(90deg, rgba(27, 54, 93, 0.05), rgba(27, 54, 93, 0.02));
}

.table tbody td {
    border-bottom: 1px solid #E8F4FD;
    vertical-align: middle;
    padding: 12px 8px;
}

/* Last row corner rounding */
.table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 8px;
}

.table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 8px;
}

/* Responsive table headers */
@media (max-width: 768px) {
    .table thead th,
    .table thead tr th,
    .dataGrid thead th,
    .dataGrid thead tr th {
        padding: 8px 4px !important;
        font-size: 0.75rem !important;
    }
}

/* Debug helper - remove this in production */
/*
.table thead th {
    border: 2px solid red !important;
}
*/