/* ======================================================
   SC Build Tags editor — only patterns that can't be
   expressed with utility.css u-* classes inline.
   (tag pill states, counter styling, autocomplete)
   ====================================================== */

/* ---- Counter -------------------------------------------- */
.sc-tags-counter {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    min-width: 0;
    overflow: hidden;
}

.sc-tags-counter__pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.05);
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.65);
    transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
    white-space: nowrap;
}

.sc-tags-counter__hint {
    transition: color 200ms ease;
    white-space: nowrap;
}

/* ---- Tag pill ------------------------------------------- */
.sc-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition:
        background-color 150ms ease,
        border-color     150ms ease,
        color            150ms ease,
        opacity          150ms ease;
    white-space: nowrap;
    user-select: none;
}

@media (hover: hover) and (pointer: fine) {
    .sc-tag-pill:not(.is-disabled):not(.is-active):hover {
        background: rgba(255, 255, 255, 0.09);
        border-color: rgba(255, 255, 255, 0.18);
        color: rgba(255, 255, 255, 0.75);
    }
}

/* Active (selected) — red tint */
.sc-tag-pill.is-active {
    background: rgba(226, 56, 56, 0.14);
    border-color: rgba(226, 56, 56, 0.45);
    color: #f0a0a0;
}

/* Active hover */
@media (hover: hover) and (pointer: fine) {
    .sc-tag-pill.is-active:hover {
        background: rgba(226, 56, 56, 0.20);
        border-color: rgba(226, 56, 56, 0.60);
    }
}

/* Disabled — unselected pills when cap is hit */
.sc-tag-pill.is-disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* Red dot before label (active state only) */
.sc-tag-pill__dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #e23838;
    flex-shrink: 0;
}

/* ---- Custom pill (amber tint) --------------------------- */
.sc-tag-pill--custom {
    background: rgba(212, 170, 60, 0.12);
    border-color: rgba(212, 170, 60, 0.35);
    color: #d4b060;
    padding-right: 6px; /* tighter so the × doesn't crowd */
}

.sc-tag-pill--custom .sc-tag-pill__dot {
    background: #d4aa3c;
}

.sc-tag-pill--custom .sc-tag-pill__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    background: rgba(212, 170, 60, 0.18);
    color: #d4b060;
    flex-shrink: 0;
    transition: background-color 130ms ease, color 130ms ease;
}

@media (hover: hover) and (pointer: fine) {
    .sc-tag-pill--custom:hover .sc-tag-pill__remove {
        background: rgba(212, 170, 60, 0.35);
        color: #ffe58a;
    }
}

/* ---- Autocomplete dropdown ------------------------------ */
.sc-tags-autocomplete {
    position: relative;
}

.sc-tags-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 20;
    background: #222222;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    max-height: 220px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.sc-tags-dropdown::-webkit-scrollbar { width: 3px; }
.sc-tags-dropdown::-webkit-scrollbar-track { background: transparent; }
.sc-tags-dropdown::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

.sc-tags-dropdown__row {
    list-style: none;
    transition: background-color 120ms ease;
    border-radius: 0;
}

.sc-tags-dropdown__row:hover,
.sc-tags-dropdown__row.is-focused {
    background: rgba(255, 255, 255, 0.06);
}

/* Amber "create" row */
.sc-tags-dropdown__row--create {
    color: #d4aa3c;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sc-tags-dropdown__row--create .sc-tags-dropdown__name {
    color: #d4aa3c;
}

/* Empty state row */
.sc-tags-dropdown__row--empty {
    cursor: default;
    pointer-events: none;
}

.sc-tags-dropdown__row--empty .sc-tags-dropdown__name {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

/* ---- Clear all button ----------------------------------- */
.sc-tags-clear-all {
    color: rgba(226, 85, 75, 0.55);
    transition: color 150ms ease;
}

.sc-tags-clear-all:hover {
    color: rgba(226, 85, 75, 1);
}

.sc-tags-clear-all:disabled,
.sc-tags-clear-all[aria-disabled="true"] {
    opacity: 0.35;
    pointer-events: none;
}

/* ---- Custom input disabled state ----------------------- */
.sc-tags-custom-input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.sc-tags-custom-input:not(:disabled):hover,
.sc-tags-custom-input:not(:disabled):focus {
    border-color: rgba(212, 170, 60, 0.45);
    background: rgba(212, 170, 60, 0.04);
    outline: none;
}

.sc-tags-custom-add:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
