
/* ==================================================
   JETBET — QUERY UX
================================================== */

.query-shell {
    position: relative;
}

.query-builder {
    gap: 9px;
}

.query-control {
    transition:
        border-color 120ms ease,
        box-shadow 120ms ease,
        background 120ms ease;
}

.query-control:focus,
.context-control:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow:
        0 0 0 3px rgba(128,92,255,.12);
}

.player-search-shell {
    position: relative;
    width: 190px;
    flex: 0 0 190px;
}

.player-search-shell .player-control {
    width: 100%;
    padding-right: 34px;
}

.player-clear {
    position: absolute;
    right: 7px;
    top: 50%;
    z-index: 4;

    width: 24px;
    height: 24px;

    display: none;
    place-items: center;

    transform: translateY(-50%);

    border: 0;
    border-radius: 6px;

    background: transparent;
    color: var(--muted);

    font-size: 17px;
    line-height: 1;

    cursor: pointer;
}

.player-search-shell.has-value .player-clear {
    display: grid;
}

.player-clear:hover {
    background: var(--surface-3);
    color: white;
}

.player-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 100;

    width: min(330px, 80vw);
    max-height: 310px;

    overflow-y: auto;

    padding: 5px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: #0d1119;

    box-shadow:
        0 18px 50px rgba(0,0,0,.45);

    display: none;
}

.player-suggestions.open {
    display: block;
}

.player-suggestion {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    padding: 9px 10px;

    border: 0;
    border-radius: 7px;

    background: transparent;
    color: white;

    text-align: left;
    cursor: pointer;
}

.player-suggestion:hover,
.player-suggestion.active {
    background: var(--surface-3);
}

.player-suggestion-name {
    min-width: 0;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: 12px;
    font-weight: 800;
}

.player-suggestion-meta {
    flex: 0 0 auto;

    color: var(--muted);

    font-size: 9px;
    font-weight: 800;
    letter-spacing: .04em;
}

.season-segmented {
    height: 32px;

    display: flex;
    align-items: center;

    padding: 2px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--surface);
}

.season-segment {
    height: 26px;
    min-width: 42px;

    padding: 0 9px;

    border: 0;
    border-radius: 6px;

    background: transparent;
    color: var(--muted);

    font-size: 9px;
    font-weight: 900;
    letter-spacing: .04em;

    cursor: pointer;
}

.season-segment:hover {
    color: var(--text-soft);
}

.season-segment.active {
    background: var(--surface-3);
    color: white;

    box-shadow:
        inset 0 0 0 1px rgba(128,92,255,.38);
}

#season-type.query-ux-native-hidden {
    position: absolute !important;

    width: 1px !important;
    height: 1px !important;

    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.threshold-control {
    width: 82px;
}

.window-control input {
    width: 36px;
    min-width: 36px;

    border-radius: 4px;

    transition:
        background 120ms ease,
        color 120ms ease;
}

.window-control input:focus {
    outline: none;
    background: rgba(128,92,255,.10);
    color: white;
}

.primary-button {
    min-width: 78px;

    box-shadow:
        0 5px 18px rgba(128,92,255,.12);
}

.primary-button:hover {
    transform: translateY(-1px);
}

@media (max-width: 800px) {

    .player-search-shell {
        width: auto;
        flex: 1 1 170px;
    }

    .player-suggestions {
        width: min(330px, calc(100vw - 34px));
    }

    .season-segment {
        min-width: 38px;
        padding: 0 7px;
    }
}


/* ==================================================
   QUERY UX — STRUCTURE PASS
================================================== */

.query-builder {
    align-items: center;
}

.query-cluster {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 4px;

    border: 1px solid var(--border-soft);
    border-radius: 10px;

    background: rgba(13,17,25,.55);
}

.query-cluster-label {
    padding-left: 7px;

    color: var(--muted);

    font-size: 8px;
    font-weight: 900;
    letter-spacing: .10em;

    text-transform: uppercase;
}

.query-action-inline {
    height: 40px;

    padding: 0 19px;

    border: 0;
    border-radius: 8px;

    background: var(--purple);
    color: #090b10;

    font-size: 11px;
    font-weight: 950;

    cursor: pointer;

    box-shadow:
        0 6px 22px rgba(128,92,255,.18);

    transition:
        background 120ms ease,
        transform 120ms ease;
}

.query-action-inline:hover {
    background: var(--purple-hover);
    transform: translateY(-1px);
}

.query-action-inline:active {
    transform: translateY(0);
}

.query-subrow {
    row-gap: 8px;
}

.date-clear-button {
    height: 32px;
    padding: 0 9px;

    border: 1px solid var(--border);
    border-radius: 7px;

    background: transparent;
    color: var(--muted);

    font-size: 9px;
    font-weight: 800;

    cursor: pointer;

    display: none;
}

.date-clear-button.visible {
    display: inline-flex;
    align-items: center;
}

.date-clear-button:hover {
    color: white;
    border-color: #343c4d;
    background: var(--surface-2);
}

.keyboard-hint {
    margin-left: 2px;

    color: var(--muted-2);

    font-size: 8px;
    font-weight: 800;

    white-space: nowrap;
}

.keyboard-hint kbd {
    min-width: 20px;
    height: 20px;

    display: inline-grid;
    place-items: center;

    margin-right: 4px;

    border: 1px solid var(--border);
    border-radius: 5px;

    background: var(--surface-2);
    color: var(--text-soft);

    font-family: inherit;
    font-size: 9px;
}

@media (max-width: 1100px) {

    .query-cluster {
        flex-wrap: wrap;
    }

    .query-action-inline {
        flex: 0 0 auto;
    }
}

@media (max-width: 700px) {

    .query-cluster {
        width: 100%;
    }

    .query-cluster-label {
        width: 100%;
        padding: 2px 4px 0;
    }

    .query-action-inline {
        width: 100%;
    }

    .keyboard-hint {
        display: none;
    }
}



/* ==================================================
   SEARCH CONTEXT UX — V3
================================================== */

.query-ux-native-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}


/* LOCATION */

.context-segmented {
    height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.context-segment {
    height: 26px;
    min-width: 42px;
    padding: 0 9px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .04em;
    cursor: pointer;
}

.context-segment:hover {
    color: var(--text-soft);
}

.context-segment.active {
    background: var(--surface-3);
    color: white;
    box-shadow:
        inset 0 0 0 1px
        rgba(128,92,255,.38);
}


/* TEAM PICKER */

.team-picker-shell {
    position: relative;
    width: 160px;
    flex: 0 0 160px;
}

.team-picker-trigger {
    width: 100%;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;

    padding: 0 11px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--surface);
    color: white;

    font-family: inherit;
    font-size: 11px;
    font-weight: 850;

    cursor: pointer;

    transition:
        border-color 120ms ease,
        box-shadow 120ms ease,
        background 120ms ease;
}

.team-picker-trigger:hover,
.team-picker-shell.open
.team-picker-trigger {
    border-color: var(--purple);
}

.team-picker-shell.open
.team-picker-trigger {
    box-shadow:
        0 0 0 3px
        rgba(128,92,255,.12);
}

.team-picker-trigger-left {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-picker-trigger-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-picker-logo,
.team-picker-option-logo {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    object-fit: contain;
}

.team-picker-chevron {
    color: var(--muted);
    font-size: 14px;
    line-height: 1;
    transition: transform 120ms ease;
}

.team-picker-shell.open
.team-picker-chevron {
    transform: rotate(180deg);
}

.team-picker-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 180;

    width: 280px;
    max-height: 380px;
    overflow-y: auto;

    display: none;

    padding: 5px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: #0d1119;

    box-shadow:
        0 20px 55px
        rgba(0,0,0,.50);
}

.team-picker-shell.open
.team-picker-menu {
    display: block;
}

.team-picker-option {
    width: 100%;
    min-height: 42px;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 6px 8px;

    border: 0;
    border-radius: 7px;

    background: transparent;
    color: white;

    font-family: inherit;
    text-align: left;

    cursor: pointer;
}

.team-picker-option:hover,
.team-picker-option.selected {
    background: var(--surface-3);
}

.team-picker-logo-blank {
    display: block;
}

.team-picker-option-text {
    min-width: 0;
    flex: 1;

    display: flex;
    flex-direction: column;
    gap: 2px;
}

.team-picker-option-text strong {
    font-size: 11px;
    font-weight: 900;
}

.team-picker-option-text span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: var(--muted);

    font-size: 9px;
    font-weight: 700;
}

.team-picker-check {
    width: 16px;
    flex: 0 0 16px;

    color: var(--purple);
    font-size: 11px;
    font-weight: 950;

    text-align: center;
}

.team-picker-menu::-webkit-scrollbar,
.calendar-year-grid::-webkit-scrollbar {
    width: 8px;
}

.team-picker-menu::-webkit-scrollbar-thumb,
.calendar-year-grid::-webkit-scrollbar-thumb {
    border: 2px solid #0d1119;
    border-radius: 999px;
    background: #69707b;
}


/* DATE PICKER */

.jetbet-date-shell {
    position: relative;
}

.jetbet-date-trigger {
    height: 32px;
    min-width: 142px;

    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    padding: 0 10px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--surface);
    color: var(--text-soft);

    font-family: inherit;
    font-size: 10px;
    font-weight: 800;

    cursor: pointer;

    transition:
        border-color 120ms ease,
        box-shadow 120ms ease;
}

.jetbet-date-shell.has-date
.jetbet-date-trigger {
    color: white;
}

.jetbet-date-trigger:hover,
.jetbet-date-shell.open
.jetbet-date-trigger {
    border-color: var(--purple);
}

.jetbet-date-shell.open
.jetbet-date-trigger {
    box-shadow:
        0 0 0 3px
        rgba(128,92,255,.12);
}

.jetbet-date-trigger-icon {
    color: var(--muted);
    font-size: 12px;
}

.jetbet-calendar {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    z-index: 200;

    width: 292px;

    display: none;

    padding: 10px;

    border: 1px solid var(--border);
    border-radius: 11px;

    background: #0d1119;
    color: white;

    box-shadow:
        0 22px 60px
        rgba(0,0,0,.55);
}

.jetbet-date-shell.open
.jetbet-calendar {
    display: block;
}

.jetbet-calendar-head {
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 7px;
}

.calendar-title {
    display: flex;
    align-items: center;
    gap: 3px;
}

.calendar-nav,
.calendar-title-button {
    border: 0;
    border-radius: 6px;

    background: transparent;
    color: white;

    font-family: inherit;
    font-weight: 850;

    cursor: pointer;
}

.calendar-nav {
    width: 32px;
    height: 32px;

    color: var(--text-soft);

    font-size: 20px;
    line-height: 1;
}

.calendar-title-button {
    height: 28px;
    padding: 0 5px;

    font-size: 11px;
}

.calendar-nav:hover,
.calendar-title-button:hover {
    background: var(--surface-3);
}

.calendar-weekdays,
.calendar-days {
    display: grid;
    grid-template-columns:
        repeat(7, 1fr);
}

.calendar-weekdays {
    margin-bottom: 3px;
}

.calendar-weekdays span {
    height: 24px;

    display: grid;
    place-items: center;

    color: var(--muted);

    font-size: 8px;
    font-weight: 850;
}

.calendar-day {
    aspect-ratio: 1;

    display: grid;
    place-items: center;

    margin: 1px;

    border: 0;
    border-radius: 7px;

    background: transparent;
    color: var(--text-soft);

    font-family: inherit;
    font-size: 10px;
    font-weight: 750;

    cursor: pointer;
}

.calendar-day:not(.blank):not(:disabled):hover {
    background: var(--surface-3);
    color: white;
}

.calendar-day.today {
    box-shadow:
        inset 0 0 0 1px
        rgba(128,92,255,.50);
}

.calendar-day.selected {
    background: var(--purple);
    color: #090b10;
    font-weight: 950;
}

.calendar-day:disabled {
    opacity: .25;
    cursor: default;
}

.calendar-day.blank {
    pointer-events: none;
}

.calendar-month-grid {
    display: grid;
    grid-template-columns:
        repeat(3, 1fr);
    gap: 5px;

    min-height: 245px;
    align-content: center;
}

.calendar-year-grid {
    max-height: 245px;
    overflow-y: auto;

    display: grid;
    grid-template-columns:
        repeat(3, 1fr);
    gap: 5px;

    padding-right: 3px;
}

.calendar-jump-option {
    height: 38px;

    border: 0;
    border-radius: 7px;

    background: var(--surface-2);
    color: var(--text-soft);

    font-family: inherit;
    font-size: 10px;
    font-weight: 850;

    cursor: pointer;
}

.calendar-jump-option:hover {
    background: var(--surface-3);
    color: white;
}

.calendar-jump-option.selected {
    background:
        rgba(128,92,255,.18);
    color: white;

    box-shadow:
        inset 0 0 0 1px
        rgba(128,92,255,.45);
}

.jetbet-calendar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-top: 8px;
    padding-top: 8px;

    border-top:
        1px solid var(--border-soft);
}

.jetbet-calendar-footer button {
    height: 28px;
    padding: 0 7px;

    border: 0;
    border-radius: 6px;

    background: transparent;
    color: var(--purple);

    font-family: inherit;
    font-size: 9px;
    font-weight: 850;

    cursor: pointer;
}

.jetbet-calendar-footer button:hover {
    background: var(--surface-3);
}

.date-clear-button {
    display: none !important;
}


@media (max-width: 800px) {

    .team-picker-shell {
        width: 150px;
        flex-basis: 150px;
    }

    .team-picker-menu {
        width: min(
            280px,
            calc(100vw - 34px)
        );
    }

    .context-segment {
        min-width: 38px;
        padding: 0 7px;
    }

    .jetbet-calendar {
        right: auto;
        left: 0;

        width: min(
            292px,
            calc(100vw - 34px)
        );
    }
}



/* ==================================================
   TIME SCOPE UX — V4
================================================== */

.time-scope-hidden {
    display: none !important;
}

.time-scope-segmented {
    flex: 0 0 auto;
}

.time-scope-button {
    min-width: 50px;
}

.time-season-shell {
    position: relative;
    flex: 0 0 auto;
}

.time-season-trigger {
    min-width: 96px;
    height: 32px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    padding: 0 10px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--surface);
    color: white;

    font-family: inherit;
    font-size: 10px;
    font-weight: 850;

    cursor: pointer;

    transition:
        border-color 120ms ease,
        box-shadow 120ms ease;
}

.time-season-trigger:hover,
.time-season-shell.open
.time-season-trigger {
    border-color: var(--purple);
}

.time-season-shell.open
.time-season-trigger {
    box-shadow:
        0 0 0 3px
        rgba(128,92,255,.12);
}

.time-season-chevron {
    color: var(--muted);
    font-size: 14px;
    line-height: 1;

    transition:
        transform 120ms ease;
}

.time-season-shell.open
.time-season-chevron {
    transform: rotate(180deg);
}

.time-season-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 190;

    width: 126px;
    max-height: 300px;
    overflow-y: auto;

    display: none;

    padding: 5px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: #0d1119;

    box-shadow:
        0 20px 55px
        rgba(0,0,0,.50);
}

.time-season-shell.open
.time-season-menu {
    display: block;
}

.time-season-option {
    width: 100%;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 7px;

    background: transparent;
    color: var(--text-soft);

    font-family: inherit;
    font-size: 10px;
    font-weight: 850;

    cursor: pointer;
}

.time-season-option:hover {
    background: var(--surface-3);
    color: white;
}

.time-season-option.selected {
    background:
        rgba(128,92,255,.18);
    color: white;

    box-shadow:
        inset 0 0 0 1px
        rgba(128,92,255,.45);
}

.time-season-menu::-webkit-scrollbar {
    width: 8px;
}

.time-season-menu::-webkit-scrollbar-thumb {
    border: 2px solid #0d1119;
    border-radius: 999px;
    background: #69707b;
}

@media (max-width: 800px) {

    .time-scope-button {
        min-width: 44px;
        padding: 0 6px;
    }

    .time-season-menu {
        right: auto;
        left: 0;
    }
}


/* ==================================================
   AUTO QUERY V5
================================================== */

/* Search remains as a hidden compatibility hook for
   legacy JS, but is gone from the actual interface. */
#run-query-top,
.query-action-inline {
    display: none !important;
}


@media (max-width: 700px) {

    .query-cluster {
        gap: 5px;
        padding: 3px;
    }

    .query-cluster-label {
        display: none;
    }

    .team-picker-shell {
        width: auto;
        flex: 1 1 140px;
    }

    .player-search-shell {
        min-width: 0;
        flex: 1 1 150px;
    }
}
