/* ============================================================
   CustomSelect component  (prefix: cs-)
   ============================================================ */

.cs-wrapper {
    position: relative;
    width: 100%;
    user-select: none;
}

.cs-wrapper--disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ── Trigger ──────────────────────────────────────────────── */

.cs-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    cursor: pointer;
    min-height: 40px;
    transition: border-color 150ms, box-shadow 150ms;
    gap: 8px;
}

.cs-wrapper--open .cs-trigger {
    border-color: #6366F1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.cs-trigger:hover {
    border-color: #6366F1;
}

/* ── Selected value / placeholder text ───────────────────── */

.cs-value-text {
    flex: 1;
    font-size: 14px;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.cs-placeholder-text {
    flex: 1;
    font-size: 14px;
    color: #9CA3AF;
    text-align: left;
}

/* kept for backwards compat — no longer generated by CustomSelect */
.cs-selected { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.cs-selected-label { font-size: 14px; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-placeholder { font-size: 14px; color: #9CA3AF; flex: 1; }

/* ── Chevron ──────────────────────────────────────────────── */

.cs-chevron {
    flex-shrink: 0;
    color: #9CA3AF;
    width: 16px;
    height: 16px;
    transition: transform 200ms;
}

.cs-wrapper--open .cs-chevron {
    transform: rotate(180deg);
}

/* ── Clear button ─────────────────────────────────────────── */

.cs-clear {
    background: none;
    border: none;
    cursor: pointer;
    color: #9CA3AF;
    padding: 0;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    border-radius: 4px;
    transition: color 150ms;
}

.cs-clear:hover {
    color: #374151;
}

/* ── Avatar circle ────────────────────────────────────────── */

.cs-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Click-outside backdrop ───────────────────────────────── */

.cs-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: transparent;
}

/* ── Dropdown panel ───────────────────────────────────────── */

.cs-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
    z-index: 1000;
    overflow: hidden;
    animation: cs-fade-in 0.1s ease;
}

/* Fixed-position variant - used inside overflow:hidden containers (modals etc.) */
.cs-dropdown--fixed {
    position: fixed;
    z-index: 99999;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    min-width: 200px;
}

@keyframes cs-fade-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Search input ─────────────────────────────────────────── */

.cs-search-wrap {
    padding: 8px;
    border-bottom: 1px solid #F3F4F6;
}

.cs-search {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: #111827;
    background: #F9FAFB;
    box-sizing: border-box;
    outline: none;
    transition: border-color 150ms;
}

.cs-search:focus {
    border-color: #6366F1;
    background: #FFFFFF;
}

/* ── Options list ─────────────────────────────────────────── */

.cs-options {
    max-height: 240px;
    overflow-y: auto;
    padding: 4px;
}

.cs-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 100ms;
    font-size: 14px;
    color: #111827;
}

.cs-option:hover,
.cs-option--highlighted {
    background: #F9FAFB;
}

.cs-option--selected {
    background: #EEF2FF;
    color: #6366F1;
}

.cs-option--selected:hover {
    background: #E0E7FF;
}

.cs-option--selected.cs-option--highlighted {
    background: #E0E7FF;
}

/* ── Option content ───────────────────────────────────────── */

.cs-option-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.cs-option-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cs-option-sub {
    font-size: 12px;
    color: #9CA3AF;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Check icon ───────────────────────────────────────────── */

.cs-check {
    flex-shrink: 0;
    color: #6366F1;
    width: 14px;
    height: 14px;
}

/* ── Empty message ────────────────────────────────────────── */

.cs-empty {
    padding: 16px;
    text-align: center;
    font-size: 13px;
    color: #9CA3AF;
}
