/* Tabulator theme overrides for Aeroportal */
:root {
    --aero-blue: #1F497D;
    --aero-pink: #EC1178;
    --aero-border: #d9e1ec;
    --aero-header-bg: #ffffff;
    --aero-row-alt: #fbfcfe;
}

.tabulator {
    border: 1px solid var(--aero-border);
    border-radius: 4px;
    font-size: 0.9rem;
    overflow: hidden;
}

.tabulator .tabulator-header {
    background-color: var(--aero-header-bg);
    border-bottom: 1px solid var(--aero-border);
    color: #000;
    font-weight: 700;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.tabulator .tabulator-header .tabulator-col {
    background-color: var(--aero-header-bg);
    border-right: 1px solid var(--aero-border);
    box-sizing: border-box;
}

.tabulator .tabulator-header .tabulator-col-group {
    background-color: var(--aero-header-bg);
    border-right: 1px solid var(--aero-border);
    box-sizing: border-box;
}

.tabulator .tabulator-header .tabulator-col,
.tabulator .tabulator-header .tabulator-col *,
.tabulator .tabulator-header .tabulator-col-group,
.tabulator .tabulator-header .tabulator-col-group * {
    cursor: grab !important;
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-resize-handle {
    cursor: col-resize !important;
}

.tabulator .tabulator-col {
    border-right: 1px solid var(--aero-border);
}

.tabulator .tabulator-row {
    background-color: #fff;
}

.tabulator .tabulator-row.tabulator-row-odd {
    background-color: #fff;
}

.aero-tabulator-wrap .tabulator .tabulator-row:hover .tabulator-cell:not(.cell-green):not(.cell-amber):not(.cell-red) {
    background-color: #f2f2f2 !important;
}

.aero-tabulator-wrap .tabulator .tabulator-cell {
    padding: 6px 8px;
    color: #000;
    text-align: left !important;
    border-right: 1px solid var(--aero-border);
    border-bottom: 1px solid var(--aero-border);
    background-color: transparent;
    cursor: default !important;
    box-sizing: border-box;
}

.aero-tabulator-wrap .tabulator .tabulator-row,
.aero-tabulator-wrap .tabulator .tabulator-row * {
    cursor: default !important;
}

.aero-tabulator-wrap .tabulator .tabulator-cell[tabulator-field="isSelected"] {
    text-align: center !important;
}

.tabulator .tabulator-row .tabulator-cell:first-child {
    border-left: 1px solid var(--aero-border);
}

.tabulator .tabulator-row:first-child .tabulator-cell {
    border-top: 1px solid var(--aero-border);
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-content {
    padding: 0 4px !important;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 29px;
    box-sizing: border-box;
}

.tabulator .tabulator-header .tabulator-col-group .tabulator-col-group-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    min-height: 29px;
    border-bottom: 1px solid var(--aero-border);
    box-sizing: border-box;
}

.tabulator .tabulator-col .tabulator-col-title {
    color: #000;
    font-weight: 700;
    text-align: center;
    white-space: normal;
    line-height: 1.1;
    text-overflow: clip;
    overflow: visible !important;
    word-break: break-word;
}

.tabulator .tabulator-header .tabulator-col-group .tabulator-col-title {
    text-align: center;
    white-space: nowrap;
}

.tabulator .tabulator-col .tabulator-arrow {
    display: none;
}


.aero-tabulator-wrap {
    position: relative;
}

.aero-tabulator-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.aero-tabulator-column-chooser {
    position: absolute;
    top: 2.5rem;
    right: 0;
    background: #fff;
    border: 1px solid var(--aero-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    padding: 0.75rem;
    z-index: 1300;
    display: none;
    max-height: 240px;
    overflow-y: auto;
    min-width: 220px;
}

.aero-tabulator-column-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #2c2c2c;
    padding: 0.25rem 0;
}

.aero-tabulator-column-item .aero-tabulator-checkbox {
    accent-color: var(--aero-blue) !important;
}

.aero-tabulator-host .mud-tabs.mud-tabs-rounded {
    overflow: visible !important;
}

.aero-baseline-btn {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--aero-blue);
    background: transparent;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.aero-baseline-btn.is-selected::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--aero-blue);
    display: block;
}

.tabulator .tabulator-cell.truncate-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aero-tabulator-lap-checkbox {
    accent-color: var(--aero-blue);
    cursor: pointer;
}

.cell-green {
    background-color: #4CAF50 !important;
    color: #000;
}

.cell-amber {
    background-color: #FFC107 !important;
    color: #000;
}

.cell-red {
    background-color: #F44336 !important;
    color: #000;
}

.tabulator .tabulator-tableholder {
    scrollbar-color: #b7c0cd #ffffff;
    background: #fff;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

.tabulator .tabulator-tableholder::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.tabulator .tabulator-tableholder::-webkit-scrollbar-track {
    background: #ffffff;
}

.tabulator .tabulator-tableholder::-webkit-scrollbar-thumb {
    background-color: #b7c0cd;
    border-radius: 8px;
    border: 2px solid #ffffff;
}

.aero-tabulator-wrap .tabulator .tabulator-row.aero-lap-invalid .tabulator-cell {
    background-color: #f5f5f5;
    color: #4a4a4a;
}

.aero-tabulator-wrap .tabulator .tabulator-row.aero-lap-invalid:hover .tabulator-cell {
    background-color: #e8e8e8;
}

.aero-lap-summary-grid .tabulator .tabulator-row:not(.aero-lap-invalid):hover .tabulator-cell:not(.cell-green):not(.cell-amber):not(.cell-red) {
    background-color: #ffffff !important;
}

.aero-lap-summary-grid .tabulator .tabulator-row.aero-lap-invalid:hover .tabulator-cell:not(.cell-green):not(.cell-amber):not(.cell-red) {
    background-color: #e8e8e8 !important;
}

.tabulator .tabulator-cell.tabulator-frozen {
    background-color: #ffffff;
}

.aero-tabulator-wrap .tabulator .tabulator-row.aero-lap-invalid .tabulator-cell.tabulator-frozen {
    background-color: #f5f5f5;
}

.aero-tabulator-wrap .tabulator .tabulator-row.tabulator-selected .tabulator-cell {
    background-color: #ffffff !important;
}
