﻿/* Container for the data grid */
.dwc-datagrid-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 20px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ccc;
}

/* Table styling */
.dwc-datagrid-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: #333;
    border: 2px solid #999;
    overflow: hidden;
    table-layout: auto;
}

    /* Highlight dirty rows */
    .dwc-datagrid-table tbody tr.highlight-dirty-row {
        background-color: #fff3cd !important; /* Light yellow background */
        border-left: 4px solid #ffc107; /* Optional visual cue */
    }

.dwc-datagrid-table th,
.dwc-datagrid-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

    .dwc-datagrid-table tbody td.dirty input {
        color: #d9534f; /* Change text color for dirty cells */
        font-weight: bold; /* Make text bold for dirty cells */
    }

    .dwc-datagrid-table.sorting {
        opacity: 0.5;
    }

/* Table header styling */
.dwc-datagrid-table thead th {
    background-color: #f2f2f2;
    color: #333;
    border-bottom: 2px solid #ddd;
    text-align: center;
    vertical-align: middle;
}

.dwc-datagrid-table thead th:first-child {
    border-top-left-radius: 8px;
}

.dwc-datagrid-table thead th:last-child {
    border-top-right-radius: 8px;
}

/* Table body styling */
.dwc-datagrid-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 0;
}

.dwc-datagrid-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 0;
}

.dwc-datagrid-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.dwc-datagrid-table tbody tr:nth-child(odd) {
    background-color: #fff;
}

.dwc-datagrid-table tbody td {
    border-bottom: 1px solid #ddd;
    text-align: center;
    vertical-align: middle;
}

/* Hover effect for table rows */
.dwc-datagrid-table tbody tr:hover {
    background-color: #f1f1f1;
}

.dwc-datagrid-header-controls {
    background-color: #f2f2f2;
    border: 2px solid #999;
    border-bottom: none;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #00126f;
}

.dwc-datagrid-header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25em;
    white-space: nowrap;
}

.dwc-datagrid-header-title {
    font-size: 16px;
    font-weight: bold;
    display: inline-block;
    cursor: default;
}

.dwc-datagrid-column-sortable .dwc-datagrid-header-title {
    cursor: pointer;
}

.dwc-datagrid-table thead th.dwc-datagrid-column-sortable .dwc-datagrid-header-title:hover {
    color: blue;
    text-decoration: underline;
}

.dwc-datagrid-table.sorting .dwc-datagrid-column-sortable .dwc-datagrid-header-title {
    cursor: wait;
}

.dwc-datagrid-filter-modal {
    position: fixed;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 460px;
    background: #f2f2f2;
    border: 2px solid #999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    padding: 16px;
    border-radius: 8px;
    font-family: Arial, sans-serif;
    font-size: 13px;
}

.dwc-datagrid-filter-header {
    font-size: 15px;
    margin-bottom: 10px;
    font-family: Arial, sans-serif;
}

.dwc-datagrid-filter-header b {
    font-weight: bold;
}

.dwc-datagrid-filter-header span {
    font-weight: 600;
}

.dwc-datagrid-filter-modal select,
.dwc-datagrid-filter-modal input {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    width: auto;
    min-width: 100px;
    max-width: 200px;
    box-sizing: border-box;
    margin-bottom: 6px;
}

.dwc-datagrid-filter-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 4px;
}

.dwc-datagrid-col-filter {
    display: inline-block;
    cursor: pointer;
}

.dwc-datagrid-col-filter-icon {
    position: relative;
    width: 1.5em;
    height: 100%;
    fill: #333;
    border: dashed 1px rgba(3, 3, 3, 0.0);
}

.dwc-datagrid-col-filter-icon:hover {
    opacity: 1;
    border: dashed 1px rgba(3, 3, 3, 1.0);
}

.dwc-datagrid-col-filter .filter-triangle {
    position: absolute;
    top: 0;
    left: 0;
    width: 1em;
}

.dwc-datagrid-col-filter .filter-bar {
    top: 0.1em;
    position: absolute;
    left: 0.5em;
    width: 1em;
}

.dwc-datagrid-checkselect-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: .2em;
}

.dwc-datagrid-checkselect {
    height: .75em;
    width: .75em;
    border-radius: 10px;
}

.dwc-datagrid-updown-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 1em;
    height: 1em;
    fill: #333;
    flex-shrink: 0;
    margin-left: 0.25em;
}

.dwc-datagrid-updown-icon:hover {
    opacity: 1;
    border: dashed 1px rgba(3, 3, 3, 1.0);
}

.dwc-datagrid-updown-icon .up,
.dwc-datagrid-updown-icon .down {
    display: none;
    width: 1em;
    height: 1em;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
}

.dwc-datagrid-updown-icon.ascending .up,
.dwc-datagrid-updown-icon.descending .down {
    display: block;
    opacity: 1;
}

.dwc-datagrid-footer {
    background-color: #f2f2f2;
    border: 2px solid #999;
    border-top: none;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 8px 8px;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #00126f;
}

.dwc-datagrid-paginator {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
    justify-content: space-between;
}

.dwc-datagrid-page-number {
    width: 60px;
    height: 28px; 
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px; 
    border: 1px solid #ccc;
}

.dwc-datagrid-page-total {
    margin-left: 6px; 
}

.dwc-datagrid-page-size,
.dwc-datagrid-page-size-select {
    height: 28px;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.dwc-datagrid-page-size {
    width: 70px;
}

.dwc-datagrid-page-button {
    border: 1px solid #ccc;
    background-color: white;
    color: #333;
    padding: 4px 8px;
    margin: 0 2px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s, color 0.2s;
}

.dwc-datagrid-page-button-selected {
    background-color: #007bff;
    color: white;
    font-weight: bold;
}

.dwc-datagrid-page-button:hover:not(.dwc-datagrid-page-button-disabled) {
    background-color: #f0f0f0;
}

.dwc-datagrid-page-button:disabled,
.dwc-datagrid-page-button-disabled {
    background-color: #e0e0e0 !important;
    color: #aaa !important;
    cursor: not-allowed;
    border: 1px solid #ccc !important;
    opacity: 0.6;
}

.dwc-datagrid-col-filter-icon.dwc-datagrid-filter-active {
    fill: #007bff;
    border: solid 1px #007bff;
    border-radius: 4px;
    background-color: rgba(0, 123, 255, 0.1);
    width: 1.5em;
    height: 1.5em;
    box-sizing: border-box;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dwc-datagrid-col-filter-icon.dwc-datagrid-filter-active svg {
    width: 100%;
    height: 100%;
}

.dwc-datagrid-filter-controls button {
    border-radius: 4px;
    margin-right: 8px;
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #ccc;
    background-color: white;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.dwc-datagrid-filter-controls button:hover {
    background-color: #f0f0f0;
}

.dwc-datagrid-filter-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5em;
    margin-bottom: 8px;
}

.dwc-datagrid-filter-logic {
    height: 28px;
    font-size: 13px;
    border-radius: 4px;
    border: 1px solid #ccc;
    padding: 2px 6px;
    background-color: white;
    color: #333;
    margin-right: 6px;
}

.dwc-datagrid-filter-delete {
    margin-left: 0.5em;
    border: none;
    background: transparent;
    font-size: 16px;
    color: #c00;
    cursor: pointer;
}

.dwc-datagrid-filter-delete:hover {
    color: #a00;
}

.hidden {
    display: none !important;
}

.dwc-datagrid-table th[data-field="id"],
.dwc-datagrid-table td[data-field="id"] {
    width: 56px; 
    min-width: 48px;
    max-width: 48px;
    text-align: center;
    vertical-align: middle;
    padding: 4px 0;
}

/* Dirty row highlight */
.dwc-datagrid-table tr.dirty {
    background-color: #fff4c2 !important; /* Light yellow */
    transition: background-color 0.3s ease-in-out;
}

    /* Animation for recent edits */
    .dwc-datagrid-table tr.dirty.highlighted {
        animation: fadeHighlight 1.5s ease-in-out;
    }

@keyframes fadeHighlight {
    0% {
        background-color: #ffe58a;
    }

    100% {
        background-color: #fff4c2;
    }
}

