/*
 * ThreeSixOh! Feedback #65
 * Make the selected sales appointment time immediately obvious.
 *
 * The picker already owns the behavioral state:
 *   - .selected
 *   - aria-pressed="true"
 *
 * This file intentionally changes presentation only. Scheduling logic,
 * validation, date selection, and submitted values remain untouched.
 */

.fixed-sales-time-button {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 7px;
    isolation: isolate;
    transition:
        transform 120ms ease,
        box-shadow 120ms ease,
        border-color 120ms ease,
        background-color 120ms ease;
}

/*
 * Support both state signals so the visual state remains correct even if
 * another ThreeSixOh! view keys off aria-pressed instead of the class.
 */
.fixed-sales-time-button.selected,
.fixed-sales-time-button[aria-pressed="true"] {
    background: linear-gradient(135deg, #0f9f9b 0%, #087b82 100%) !important;
    border: 2px solid #63e6df !important;
    color: #ffffff !important;
    box-shadow:
        0 0 0 3px rgba(15, 159, 155, 0.34),
        0 8px 20px rgba(3, 31, 45, 0.34) !important;
    font-weight: 900 !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.24);
    transform: translateY(-1px);
}

.fixed-sales-time-button.selected::before,
.fixed-sales-time-button[aria-pressed="true"]::before {
    content: "???";
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border-radius: 999px;
    background: #ffffff;
    color: #087b82;
    font-size: 12px;
    font-weight: 1000;
    line-height: 1;
    text-shadow: none;
}

/* Keep the selected state dominant when the pointer is over it. */
.fixed-sales-time-button.selected:hover,
.fixed-sales-time-button[aria-pressed="true"]:hover {
    background: linear-gradient(135deg, #12aaa6 0%, #087b82 100%) !important;
    border-color: #8df2ec !important;
    color: #ffffff !important;
    box-shadow:
        0 0 0 4px rgba(15, 159, 155, 0.38),
        0 9px 22px rgba(3, 31, 45, 0.38) !important;
}

/* Keyboard focus must remain independently visible. */
.fixed-sales-time-button:focus-visible {
    outline: 3px solid #f4c542 !important;
    outline-offset: 3px !important;
}

.fixed-sales-time-button.selected:focus-visible,
.fixed-sales-time-button[aria-pressed="true"]:focus-visible {
    outline-color: #ffffff !important;
}

/*
 * The selection is also exposed to assistive technology through aria-pressed.
 * This attribute selector makes the CSS resilient if the JS class name is
 * refactored later while the accessible state remains intact.
 */
@media (prefers-reduced-motion: reduce) {
    .fixed-sales-time-button {
        transition: none;
    }

    .fixed-sales-time-button.selected,
    .fixed-sales-time-button[aria-pressed="true"] {
        transform: none;
    }
}
