/* ==========================================================================
   Blazor Components Custom Styles
   ========================================================================== */

/* QuickGrid Component Styles
   ========================================================================== */

/* QuickGrid Container */
.quickgrid {
    width: 100%;
    border-collapse: collapse;
}

/* Remove default button styling from column headers */
.quickgrid thead th button,
.quickgrid th button.col-sort-button {
    all: unset;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    background-color: #f8f8f8;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease-in-out;
    user-select: none;
}

/* Header cell styling */
.quickgrid thead th {
    padding: 0;
    background-color: #f8f8f8;
    border-bottom: 2px solid #ddd;
    position: relative;
}

/* Hover effect on sortable columns */
.quickgrid thead th button:hover {
    background-color: #e8e8e8;
}

/* Active sort column */
.quickgrid thead th[aria-sort="ascending"] button,
.quickgrid thead th[aria-sort="descending"] button {
    background-color: #2196f3;
    color: #fff;
    font-weight: 700;
}

.quickgrid thead th[aria-sort="ascending"] button:hover,
.quickgrid thead th[aria-sort="descending"] button:hover {
    background-color: #0c7cd5;
}

/* Sort direction arrows */
.quickgrid thead th button::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 8px;
    opacity: 0.3;
    transition: opacity 0.2s ease-in-out;
}

/* Default arrow (unsorted) - up/down combined indicator */
.quickgrid thead th button::after {
    content: "⇅";
    width: auto;
    height: auto;
    font-size: 14px;
    border: none;
}

/* Ascending arrow */
.quickgrid thead th[aria-sort="ascending"] button::after {
    content: "";
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 6px solid currentColor;
    opacity: 1;
}

/* Descending arrow */
.quickgrid thead th[aria-sort="descending"] button::after {
    content: "";
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid currentColor;
    opacity: 1;
}

/* Show arrow on hover for unsorted columns */
.quickgrid thead th:not([aria-sort]) button:hover::after {
    opacity: 0.6;
}

/* Non-sortable column headers (no button) */
.quickgrid thead th:not(:has(button)) {
    padding: 12px 20px;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    background-color: #f8f8f8;
}

/* Body cells */
.quickgrid tbody td {
    padding: 12px 20px;
    border-top: 1px solid #ddd;
    vertical-align: middle;
}

/* Striped rows */
.quickgrid tbody tr:nth-of-type(odd) {
    background-color: #fcfcfc;
}

/* Hover effect on rows */
.quickgrid tbody tr:hover {
    background-color: #f0f0f0;
}

/* Column Options (Filter inputs) */
.quickgrid .col-options {
    padding: 8px;
    background-color: #fff;
}

.quickgrid .col-options .search-box input {
    width: 100%;
    padding: 6px 11px;
    font-size: 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* Responsive table */
@media (max-width: 768px) {
    .quickgrid thead th button,
    .quickgrid thead th:not(:has(button)),
    .quickgrid tbody td {
        padding: 8px 12px;
        font-size: 12px;
    }

    .quickgrid thead th button::after {
        margin-left: 4px;
    }
}

/* Text alignment utilities for QuickGrid */
.quickgrid .text-center {
    text-align: center;
}

.quickgrid .text-right {
    text-align: right;
}

/* ==========================================================================
   Additional Blazor Component Styles
   ========================================================================== */

/* Blazor loading indicator */
.blazor-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

/* Blazor error boundary */
.blazor-error-boundary {
    background-color: #fbe9e7;
    border: 1px solid #f44336;
    border-radius: 3px;
    padding: 20px;
    margin: 20px 0;
}

.blazor-error-boundary h3 {
    color: #d84315;
    margin-top: 0;
}
