/* tp-select - themed dropdown drawn over a native <select>.
   Paired with assets/js/tp-select.js. The native control keeps
   name/value/options and stays in the DOM; these rules only hide it and
   style the replacement, so a page still works if the JS never runs.
   Self-contained: the --pred-* tokens fall back when a page does not
   define them. */
.tp-sel {
    position: relative;
    width: 100%;
}

.tp-sel__native {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

.tp-sel__trigger {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.8rem 1rem;
    background: linear-gradient(135deg, #1a1f2e 0%, #1e2435 100%);
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
    color: var(--pred-text-primary, #ffffff);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-base, 0.25s ease);
}

.tp-sel__trigger:hover {
    border-color: rgba(0, 212, 255, 0.4);
    background: linear-gradient(135deg, #1e2435 0%, #232a3d 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.2);
}

.tp-sel__trigger:focus-visible {
    outline: none;
    border-color: var(--pred-accent-cyan, #00d4ff);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.18), 0 4px 14px rgba(0, 212, 255, 0.3);
}

.tp-sel.is-open .tp-sel__trigger {
    border-color: var(--pred-accent-cyan, #00d4ff);
    background: linear-gradient(135deg, #1e2435 0%, #232a3d 100%);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.14);
}

.tp-sel__icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    background: currentColor;
    color: #94a3b8;
    transition: color var(--transition-base, 0.25s ease);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.tp-sel__value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tp-sel__value.is-placeholder {
    color: #8593a9;
}

.tp-sel__chev {
    flex-shrink: 0;
    color: var(--pred-accent-cyan, #00d4ff);
    transition: transform var(--transition-base, 0.25s ease);
}

.tp-sel.is-open .tp-sel__chev {
    transform: rotate(180deg);
}

.tp-sel__panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 60;
    background: #131927;
    border: 1px solid rgba(0, 212, 255, 0.22);
    border-radius: 12px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(99, 102, 241, 0.12);
    overflow: hidden;
    animation: tpSelIn 0.14s ease-out;
}

.tp-sel__panel.is-above {
    top: auto;
    bottom: calc(100% + 8px);
}

@keyframes tpSelIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tp-sel__search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #8593a9;
}

.tp-sel__search-input {
    flex: 1;
    min-width: 0;
    background: none;
    border: none;
    outline: none;
    color: var(--pred-text-primary, #ffffff);
    font-family: inherit;
    font-size: 0.875rem;
}

.tp-sel__search-input::placeholder {
    color: #8593a9;
}

.tp-sel__list {
    max-height: 260px;
    overflow-y: auto;
    margin: 0;
    padding: 0.35rem;
    list-style: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 212, 255, 0.35) transparent;
}

.tp-sel__list::-webkit-scrollbar {
    width: 8px;
}

.tp-sel__list::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.3);
    border-radius: 8px;
}

.tp-sel__opt {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 40px;
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
    color: #cbd5e1;
    font-size: 0.9rem;
    cursor: pointer;
}

.tp-sel__opt-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tp-sel__opt.is-active {
    background: rgba(0, 212, 255, 0.12);
    color: #ffffff;
}

.tp-sel__opt.is-selected {
    color: var(--pred-accent-cyan, #00d4ff);
    font-weight: 600;
}

.tp-sel__tick {
    flex-shrink: 0;
    opacity: 0;
}

.tp-sel__opt.is-selected .tp-sel__tick {
    opacity: 1;
}

.tp-sel__badge {
    flex-shrink: 0;
    padding: 1px 7px;
    border-radius: 20px;
    background: rgba(251, 191, 36, 0.14);
    border: 1px solid rgba(251, 191, 36, 0.35);
    color: #fbbf24;
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.tp-sel__opt.is-locked .tp-sel__opt-text {
    color: #94a3b8;
}

.tp-sel__empty {
    padding: 1rem;
    text-align: center;
    color: #8593a9;
    font-size: 0.875rem;
}

.tp-sel.is-open .tp-sel__icon,
.tp-sel__trigger:hover .tp-sel__icon {
    color: var(--pred-accent-cyan, #00d4ff);
}

@media (max-width: 480px) {
    .tp-sel__trigger { padding: 0.7rem 0.85rem; font-size: 0.875rem; }
    .tp-sel__opt     { min-height: 44px; }
    .tp-sel__list    { max-height: 240px; }
}