/**
 * Spotlights — the pill switcher.
 *
 * A SECOND sheet, loaded only when a spotlight is set to the pill style, sitting
 * on top of spotlights.css. It is separate for one reason and it is not taste:
 * spotlights.css is diffed byte for byte against ALLOut Video Manager's copy on
 * every test run, because this plugin ships its own duplicate of that file and a
 * silent drift there means live pages render in last season's colours while the
 * markup still matches. Adding rules to it would delete that guarantee. Nothing
 * in here belongs to Video Manager, so nothing in here can drift from it.
 *
 * Everything below is literal to the approved design export: the gray track that
 * sizes to its own content, the 10px/20px pill, the 7px status dot that turns
 * brand red on the open pill, the navy fill and its shadow. Do not round these.
 *
 * The classic strip's three-state machine (row / grid / scroll, chosen by
 * measuring wrap rows) does not apply here — the track is one group that scrolls
 * inside itself. The renderer emits no measurer in this style, which is what
 * makes spotlights.js skip the state machine entirely.
 *
 * @package   AlloutBlocks
 * @author    ALLOut Security
 * @copyright 2026 ALLOut Security
 * @license   Proprietary
 */

.allout-vm-spotlights--pills {
    /* Tokens the base sheet does not carry. The rest (red-500, navy-700,
       gray-50/200, the two font stacks) come from .allout-vm-spotlights above. */
    --avs-navy-600: #1a2a52;
    --avs-gray-100: #eff1f6;
    --avs-gray-400: #aab2c4;
    --avs-blue-400: #3d63d8;
    --avs-radius-pill: 999px;
    --avs-shadow-xs: 0 1px 2px rgba(8, 22, 52, 0.06);
}

/* The strip loses the base sheet's full-width bottom rule: in this design the
   track IS the divider, and a hairline running edge to edge under a floating
   pill group reads as a leftover. */
.allout-vm-spotlights--pills .allout-vm-spotlights__tabs-block {
    padding: 0 20px;
}

/* --- The track ----------------------------------------------------------- */

.allout-vm-spotlights--pills .allout-vm-spotlights__nav {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 6px;
    width: max-content;
    max-width: 100%;
    margin: 18px auto;
    padding: 6px;
    border: 1px solid var(--avs-border-subtle);
    border-bottom: 1px solid var(--avs-border-subtle);
    border-radius: var(--avs-radius-pill);
    background: var(--avs-gray-100);
    box-shadow: var(--avs-shadow-xs);
    /* Too many pills for the viewport: the group scrolls inside itself rather
       than wrapping into a lumpy second row inside a rounded track. */
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.allout-vm-spotlights--pills .allout-vm-spotlights__nav::-webkit-scrollbar {
    display: none;
}

/* --- The pills ------------------------------------------------------------ */

/* Doubled root class for specificity over the base sheet's own doubled
   selector, which owns padding, borders and the underline. */
.allout-vm-spotlights--pills .allout-vm-spotlights .allout-vm-spotlights__tab,
.allout-vm-spotlights--pills .allout-vm-spotlights__tab {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
    margin: 0;
    padding: 10px 20px;
    border: 0;
    border-right: 0;
    border-radius: var(--avs-radius-pill);
    background: transparent;
    box-shadow: none;
    overflow: visible;
    font-family: var(--avs-font-body);
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: normal;
    text-transform: none;
    color: var(--avs-navy-600);
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.allout-vm-spotlights--pills .allout-vm-spotlights__dot {
    width: 7px;
    height: 7px;
    flex: none;
    border-radius: 50%;
    background: var(--avs-gray-400);
    transition: background 0.15s ease;
}

.allout-vm-spotlights--pills .allout-vm-spotlights .allout-vm-spotlights__tab:hover,
.allout-vm-spotlights--pills .allout-vm-spotlights__tab:hover {
    background: rgba(255, 255, 255, 0.7);
    color: var(--avs-navy-600);
}

.allout-vm-spotlights--pills .allout-vm-spotlights .allout-vm-spotlights__tab:focus-visible,
.allout-vm-spotlights--pills .allout-vm-spotlights__tab:focus-visible {
    outline: 2px solid var(--avs-blue-400);
    outline-offset: 2px;
}

.allout-vm-spotlights--pills .allout-vm-spotlights .allout-vm-spotlights__tab.is-active,
.allout-vm-spotlights--pills .allout-vm-spotlights__tab.is-active {
    background: var(--avs-navy-700);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(8, 22, 52, 0.28);
}

/* The base sheet draws the active tab's 2.5px underline through ::after. A pill
   has no underline — it is the fill that says which one is open. */
.allout-vm-spotlights--pills .allout-vm-spotlights .allout-vm-spotlights__tab.is-active::after,
.allout-vm-spotlights--pills .allout-vm-spotlights__tab.is-active::after {
    content: none;
}

.allout-vm-spotlights--pills .allout-vm-spotlights__tab.is-active .allout-vm-spotlights__dot {
    background: var(--avs-red-500);
}

/* BeTheme paints bare <button>s from these variables, and the base sheet already
   redefines them for the classic strip. The pill is a different shape with a
   different hover, so it restates its own — same defence, this style's values. */
.allout-vm-spotlights--pills {
    --mfn-button-bg: transparent;
    --mfn-button-bg-hover: rgba(255, 255, 255, 0.7);
    --mfn-button-color: var(--avs-navy-600);
    --mfn-button-color-hover: var(--avs-navy-600);
    --mfn-button-border-radius: var(--avs-radius-pill);
    --mfn-button-padding: 10px 20px;
    --mfn-button-font-size: 14.5px;
}

@media (max-width: 640px) {
    .allout-vm-spotlights--pills .allout-vm-spotlights .allout-vm-spotlights__tab,
    .allout-vm-spotlights--pills .allout-vm-spotlights__tab {
        padding: 9px 16px;
        font-size: 13.5px;
    }

    .allout-vm-spotlights--pills .allout-vm-spotlights__nav {
        /* On a narrow screen the track has to be allowed to start at the left
           edge, or the first pill sits half off-screen once it scrolls. */
        margin-left: 0;
        margin-right: 0;
        width: auto;
        justify-content: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .allout-vm-spotlights--pills .allout-vm-spotlights__tab,
    .allout-vm-spotlights--pills .allout-vm-spotlights__dot {
        transition: none;
    }
}
