/* Sport.Web grid pages (Blazor + QuickGrid). The rest of the look comes from Content/*.css (Bootstrap 5, Site, Soccer). */

/* Tables scroll sideways on a phone instead of squeezing the columns. Framed: rounded border and a light shadow. */
.sport-grid-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-lg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
    background-color: var(--bs-body-bg);
}

/* Cards around a grid: slightly rounder, with the same soft shadow. */
.sport-grid-card,
#gameGrid {
    --bs-card-border-radius: var(--bs-border-radius-lg);
}

.sport-grid-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

/* QuickGrid pads a short page with empty rows (to keep its height): not wanted here, the pager sits under the data.
   Only in QuickGrid tables (class quickgrid): plain tables with sport-grid (e.g. the season close-out) have no aria-rowindex
   on their rows, and this rule would hide all of them. */
.sport-grid.quickgrid > tbody > tr:not([aria-rowindex]) {
    display: none;
}

.sport-grid th,
.sport-grid td {
    white-space: nowrap;
    vertical-align: middle;
}

/* Header: tinted, semibold titles and a firm line under it. */
.sport-grid > thead > tr > th {
    background-color: var(--bs-primary-bg-subtle);
    color: var(--bs-primary-text-emphasis);
    font-size: .875rem;
    font-weight: 600;
    border-bottom: 2px solid var(--bs-primary-border-subtle);
    padding-top: .25rem;
    padding-bottom: .25rem;
}

.sport-grid > thead > tr > th .col-title {
    color: inherit;
    font-weight: inherit;
    border-radius: var(--bs-border-radius);
}

.sport-grid > thead > tr > th .col-title:hover {
    background-color: rgba(var(--bs-primary-rgb), .08);
}

/* The sort arrow and the filter button take the header colour; a column with an active sort is bolder. */
.sport-grid > thead > tr > th .sort-indicator,
.sport-grid > thead > tr > th .col-options-button {
    opacity: .75;
}

.sport-grid > thead > tr > th[aria-sort] .sort-indicator {
    opacity: 1;
}

.sport-grid > thead > tr > th .col-options-button {
    border-radius: var(--bs-border-radius);
}

.sport-grid > thead > tr > th .col-options-button:hover {
    background-color: rgba(var(--bs-primary-rgb), .12);
    opacity: 1;
}

/* Body: roomier cells, zebra stripes, a clear hover row. */
.sport-grid > tbody > tr > td {
    padding: .5rem .6rem;
    border-color: var(--bs-border-color-translucent);
}

.sport-grid > tbody > tr[aria-rowindex]:nth-child(even) > td {
    background-color: var(--bs-tertiary-bg);
}

.sport-grid > tbody > tr[aria-rowindex]:hover > td {
    background-color: rgba(var(--bs-primary-rgb), .07);
}

.sport-grid > tbody > tr:last-child > td {
    border-bottom: 0;
}

/* Column options (filter) popup: a proper dropdown panel. */
.sport-grid .col-options {
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-lg);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
    padding: .75rem;
    font-weight: normal;
    font-size: 1rem;
    color: var(--bs-body-color);
}

.sport-grid td.col-value {
    white-space: normal;
    word-break: break-word;
    min-width: 12rem;
}

/* Big tap targets (at least 44 x 44 px). */
.btn-tap,
.form-control-tap,
.form-select-tap {
    min-height: 44px;
}

.btn-tap {
    min-width: 44px;
}

.sport-grid .btn-tap {
    padding-left: .6rem;
    padding-right: .6rem;
}

/* Sort buttons in the headers are full-height tap targets too. */
.sport-grid th .col-title,
.sport-grid th .col-options-button {
    min-height: 44px;
}

/* QuickGrid's pager buttons (scoped styles of the package) are small: make them tap-sized, rounded outline buttons. */
.grid-pager {
    color: var(--bs-secondary-color);
    font-size: .9rem;
}

.grid-pager .paginator {
    margin-top: 0 !important;
    gap: .75rem;
    align-items: center;
}

.grid-pager nav {
    gap: .25rem;
    align-items: center;
}

.grid-pager nav button {
    min-width: 44px !important;
    min-height: 44px !important;
    border: 1px solid var(--bs-border-color) !important;
    border-radius: var(--bs-border-radius) !important;
    background-color: var(--bs-body-bg) !important;
}

.grid-pager nav button:not([disabled]):hover {
    border-color: var(--bs-primary) !important;
    background-color: var(--bs-primary-bg-subtle) !important;
}

.grid-pager nav button[disabled] {
    opacity: .4;
}

.grid-pager .pagination-text {
    margin: 0 .5rem !important;
}

/* The legacy Site.css narrows main's padding to 4px on phones: match the row gutter so nothing sticks out (no sideways page scroll). */
#body > .row {
    --bs-gutter-x: 8px;
}

.grid-filter {
    min-width: 14rem;
}

/* Row colours of the legacy games grid (dataBound): coming / drop-in (green), not coming (red), past due (orange).
   Same colours, a little softer, with a strong bar on the left so the status still reads at a glance. */
.sport-grid > tbody > tr.row-coming > td {
    background-color: #d7f0d1 !important;
    box-shadow: none !important;
}

.sport-grid > tbody > tr.row-notcoming > td {
    background-color: #f6cdcd !important;
    box-shadow: none !important;
}

.sport-grid > tbody > tr.row-pastdue > td {
    background-color: #ffc888 !important;
    box-shadow: none !important;
}

.sport-grid > tbody > tr.row-coming > td:first-child {
    box-shadow: inset 4px 0 0 #2e9e44 !important;
}

.sport-grid > tbody > tr.row-notcoming > td:first-child {
    box-shadow: inset 4px 0 0 #c9302c !important;
}

.sport-grid > tbody > tr.row-pastdue > td:first-child {
    box-shadow: inset 4px 0 0 #e07800 !important;
}
/* The legacy grid hid Response and Confirmed below 450 px. */
@media (max-width: 449.98px) {
    .sport-grid .col-narrow-hide {
        display: none;
    }
}

/* Photo: show the large copy on tap as well as on hover (Content/Soccer.css .player-thumb). */
.player-thumb:focus span,
.player-thumb:focus-within span {
    visibility: visible;
    top: 250px;
    left: 60px;
}

@media (max-width: 575.98px) {
    .player-thumb:hover span,
    .player-thumb:focus span {
        top: 120px;
        left: 16px;
    }
}

/* Progress window of the reminder command (legacy #dialog). */
.reminder-dialog {
    position: fixed;
    top: 10vh;
    left: 10vw;
    width: 50%;
    min-width: 280px;
    max-width: calc(100vw - 32px);
    max-height: 80vh;
    overflow: auto;
    z-index: 1050;
}

@media (max-width: 575.98px) {
    .reminder-dialog {
        left: 16px;
        right: 16px;
        width: auto;
    }
}
