/*
 * OTS-UX-SEL-1: look of the searchable select (Tom Select, see otosorgu-select.js).
 * Matches the other form controls of otosorgu-ui.css section 4 (44 px high, 1px line-strong border, radius 8,
 * 2 px accent focus ring + ink border, 16 px text). Loads after tom-select.min.css, so equal specificity wins.
 */
.ts-wrapper { max-width: 100%; }
.ts-wrapper.single .ts-control {
    box-sizing: border-box;
    min-height: var(--ou-control-h, 44px);
    padding: 0 var(--ou-s6, 32px) 0 var(--ou-s3, 12px) !important;
    border: 1px solid var(--ou-line-strong, #d9d9d9);
    border-radius: var(--ou-r-control, 8px);
    background: var(--ou-surface, #fff);
    color: var(--ou-ink, #313131);
    font-size: max(16px, var(--ou-fs-md, 16px));
    line-height: 1.25;
    flex-wrap: nowrap;
    align-items: center;
    cursor: pointer;
    transition: border-color var(--ou-t, 150ms ease), box-shadow var(--ou-t, 150ms ease);
}
.ts-wrapper.single .ts-control > .item {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* While the list is open the current value stays visible, dimmed; the search input overlays it and the value hides once text is typed. */
.ts-wrapper.single.input-active .ts-control > .item { display: block; opacity: .55; }
.ts-wrapper.single.input-active.ots-has-query .ts-control > .item { visibility: hidden; }
.ts-wrapper.single.input-active .ts-control > input {
    position: absolute !important;
    left: var(--ou-s3, 12px);
    right: var(--ou-s6, 32px);
    top: 0;
    bottom: 0;
    width: auto;
    opacity: 1 !important;
}
/* chevron */
.ts-wrapper.single .ts-control::after {
    content: "";
    position: absolute;
    right: var(--ou-s4, 16px);
    top: 50%;
    width: 7px;
    height: 7px;
    margin-top: -6px;
    border-right: 2px solid var(--ou-ink-soft, #5c5c5c);
    border-bottom: 2px solid var(--ou-ink-soft, #5c5c5c);
    transform: rotate(45deg);
    pointer-events: none;
}
.ts-wrapper.single.dropdown-active .ts-control::after { margin-top: -2px; transform: rotate(-135deg); }
.ts-wrapper .ts-control input {
    font-size: max(16px, var(--ou-fs-md, 16px));
    line-height: 1.25;
    color: var(--ou-ink, #313131);
    min-width: 0;
    width: 100%;
}
.ts-wrapper.focus .ts-control,
.ts-wrapper.single.input-active .ts-control {
    border-color: var(--ou-ink, #313131);
    box-shadow: 0 0 0 2px var(--ou-accent, #fecc16);
    background: var(--ou-surface, #fff);
}
.ts-wrapper.disabled .ts-control { background: var(--ou-canvas, #f3f3f3); color: var(--ou-ink-soft, #5c5c5c); cursor: not-allowed; opacity: 1; }
.ts-wrapper.errorvalidation .ts-control { border-color: var(--ou-error-ink, #b3261e); }

/* dropdown (lives under <body>, so it is never clipped by a card or table wrapper) */
.ts-dropdown {
    z-index: 2000;
    margin: 4px 0 0;
    border: 1px solid var(--ou-line-strong, #d9d9d9);
    border-radius: var(--ou-r-control, 8px);
    background: var(--ou-surface, #fff);
    color: var(--ou-ink, #313131);
    font-size: max(16px, var(--ou-fs-md, 16px));
    line-height: 1.3;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    overflow: hidden;
}
.ts-dropdown .ts-dropdown-content { max-height: min(320px, 50vh); }
.ts-dropdown .option,
.ts-dropdown .no-results { padding: var(--ou-s3, 12px); min-height: 44px; box-sizing: border-box; display: flex; align-items: center; }
.ts-dropdown .option { white-space: normal; overflow-wrap: anywhere; }
.ts-dropdown .no-results { color: var(--ou-ink-soft, #5c5c5c); }
.ts-dropdown .active { background: var(--ou-accent-tint, #fff9e1); color: var(--ou-ink, #313131); }
.ts-dropdown .option.selected { font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
    .ts-wrapper.single .ts-control { transition: none; }
}
