﻿/**
 * tom-select.css - Tailwind Theme Version
 * Using your design system variables
 */

:root {
    --ts-pr-clear-button: 0;
    --ts-pr-caret: 0;
    --ts-pr-min: 0.75rem;
    --ts-multi-min-height: 2.5rem;
    --ts-multi-item-gap: 0.25rem;
}

.ts-wrapper.single .ts-control,
.ts-wrapper.single .ts-control input {
    cursor: pointer;
}

.ts-control {
    padding-right: max(var(--ts-pr-min), calc(var(--ts-pr-clear-button) + var(--ts-pr-caret))) !important;
}

/* Drag & Drop Plugin */
.ts-wrapper.plugin-drag_drop.multi > .ts-control > div.ui-sortable-placeholder {
    visibility: visible !important;
    background: var(--color-surface-light) !important;
    background: color-mix(in srgb, var(--color-text) 6%, transparent) !important;
    border: 0 none !important;
    box-shadow: inset 0 0 12px 4px var(--color-surface);
}

.ts-wrapper.plugin-drag_drop .ui-sortable-placeholder::after {
    content: "!";
    visibility: hidden;
}

.ts-wrapper.plugin-drag_drop .ui-sortable-helper {
    box-shadow: 0 2px 5px var(--color-shadow);
}

/* Checkbox Options */
.plugin-checkbox_options .option input {
    margin-right: 0.5rem;
}

/* Clear Button Plugin */
.plugin-clear_button {
    --ts-pr-clear-button: 1em;
}

    .plugin-clear_button .clear-button {
        opacity: 0;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        right: calc(8px - 6px);
        margin-right: 0 !important;
        background: transparent !important;
        transition: opacity 0.5s;
        cursor: pointer;
        color: var(--color-text-muted);
    }

    .plugin-clear_button.form-select .clear-button,
    .plugin-clear_button.single .clear-button {
        right: max(var(--ts-pr-caret), 8px);
    }

    .plugin-clear_button.focus.has-items .clear-button,
    .plugin-clear_button:not(.disabled):hover.has-items .clear-button {
        opacity: 1;
        color: var(--color-text);
    }

/* Dropdown Header */
.ts-wrapper .dropdown-header {
    position: relative;
    padding: 10px 8px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface-light);
    border-radius: 3px 3px 0 0;
}

.ts-wrapper .dropdown-header-close {
    position: absolute;
    right: 8px;
    top: 50%;
    color: var(--color-text);
    opacity: 0.4;
    margin-top: -12px;
    line-height: 20px;
    font-size: 20px !important;
}

    .ts-wrapper .dropdown-header-close:hover {
        opacity: 1;
    }

/* Dropdown Input Plugin */
.plugin-dropdown_input.focus.dropdown-active .ts-control {
    box-shadow: none;
    border: 1px solid var(--color-border);
}

.plugin-dropdown_input .dropdown-input {
    border: 1px solid var(--color-border);
    border-width: 0 0 1px 0;
    display: block;
    padding: 8px 8px;
    box-shadow: none;
    width: 100%;
    background: transparent;
    color: var(--color-text);
}

.plugin-dropdown_input .items-placeholder {
    border: 0 none !important;
    box-shadow: none !important;
    width: 100%;
}

.plugin-dropdown_input.has-items .items-placeholder,
.plugin-dropdown_input.dropdown-active .items-placeholder {
    display: none !important;
}

/* Input Autogrow Plugin */
.ts-wrapper.plugin-input_autogrow.has-items .ts-control > input {
    min-width: 0;
}

.ts-wrapper.plugin-input_autogrow.has-items.focus .ts-control > input {
    flex: none;
    min-width: 4px;
}

    .ts-wrapper.plugin-input_autogrow.has-items.focus .ts-control > input::-ms-input-placeholder {
        color: transparent;
    }

    .ts-wrapper.plugin-input_autogrow.has-items.focus .ts-control > input::placeholder {
        color: transparent;
    }

/* Optgroup Columns Plugin */
.ts-dropdown.plugin-optgroup_columns .ts-dropdown-content {
    display: flex;
}

.ts-dropdown.plugin-optgroup_columns .optgroup {
    border-right: 1px solid var(--color-border);
    border-top: 0 none;
    flex-grow: 1;
    flex-basis: 0;
    min-width: 0;
}

    .ts-dropdown.plugin-optgroup_columns .optgroup:last-child {
        border-right: 0 none;
    }

    .ts-dropdown.plugin-optgroup_columns .optgroup:before {
        display: none;
    }

.ts-dropdown.plugin-optgroup_columns .optgroup-header {
    border-top: 0 none;
}

/* Remove Button Plugin */
.ts-wrapper.plugin-remove_button .item {
    display: inline-flex;
    align-items: center;
    padding-right: 0 !important;
}

    .ts-wrapper.plugin-remove_button .item .remove {
        color: inherit;
        text-decoration: none;
        vertical-align: middle;
        display: inline-block;
        padding: 0 6px;
        border-radius: 0 2px 2px 0;
        box-sizing: border-box;
    }

        .ts-wrapper.plugin-remove_button .item .remove:hover {
            background: color-mix(in srgb, var(--color-text) 5%, transparent);
        }

.ts-wrapper.plugin-remove_button.disabled .item .remove:hover {
    background: none;
}

.ts-wrapper.plugin-remove_button .remove-single {
    position: absolute;
    right: 0;
    top: 0;
    font-size: 23px;
}

/* RTL Support */
.ts-wrapper.plugin-remove_button:not(.rtl) .item .remove {
    border-left: 1px solid var(--color-border);
    margin-left: 6px;
}

.ts-wrapper.plugin-remove_button:not(.rtl) .item.active .remove {
    border-left-color: var(--color-primary);
}

.ts-wrapper.plugin-remove_button:not(.rtl).disabled .item .remove {
    border-left-color: transparent;
}

.ts-wrapper.plugin-remove_button.rtl .item .remove {
    border-right: 1px solid var(--color-border);
    margin-right: 6px;
}

.ts-wrapper.plugin-remove_button.rtl .item.active .remove {
    border-right-color: var(--color-primary);
}

.ts-wrapper.plugin-remove_button.rtl.disabled .item .remove {
    border-right-color: transparent;
}

/* Core Styles */
.ts-wrapper {
    position: relative;
}

.ts-dropdown,
.ts-control,
.ts-control input {
    color: var(--color-text);
    font-family: inherit;
    font-size: 13px;
    line-height: 18px;
    -webkit-font-smoothing: inherit;
}

.ts-control,
.ts-wrapper.single.input-active .ts-control {
    background: var(--color-surface);
    cursor: text;
}

.ts-control {
    border: 1px solid var(--color-border);
    padding: 8px 8px;
    width: 100%;
    overflow: hidden;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    box-shadow: none;
    border-radius: 3px;
    display: flex;
    flex-wrap: wrap;

}

.ts-wrapper.multi.has-items .ts-control {
    padding: calc(8px - 2px - 0px) 8px calc(8px - 2px - 3px - 0px);
}

.full .ts-control {
    background-color: var(--color-surface);
}

.disabled .ts-control,
.disabled .ts-control * {
    cursor: default !important;
}

.focus .ts-control {
    box-shadow: 0 0 0 1px var(--color-primary);
}

.ts-control > * {
    vertical-align: baseline;
    display: inline-block;
}

.ts-wrapper.multi .ts-control > div {
    cursor: pointer;
    margin: 0 3px 3px 0;
    padding: 2px 6px;
    background: var(--color-surface-light);
    color: var(--color-text);
    border: 0px solid var(--color-border);
}

    .ts-wrapper.multi .ts-control > div.active {
        background: color-mix(in srgb, var(--color-primary) 20%, transparent);
        color: var(--color-primary);
    }

.ts-wrapper.multi.disabled .ts-control > div,
.ts-wrapper.multi.disabled .ts-control > div.active {
    color: var(--color-text-muted);
    background: var(--color-surface);
    border: 0px solid transparent;
}

.ts-control > input {
    flex: 1 1 auto;
    min-width: 7rem;
    display: inline-block !important;
    padding: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    max-width: 100% !important;
    margin: 0 !important;
    text-indent: 0 !important;
    border: 0 none !important;
    background: none !important;
    line-height: inherit !important;
    -webkit-user-select: auto !important;
    -moz-user-select: auto !important;
    user-select: auto !important;
    box-shadow: none !important;
    color: var(--color-text);
}

    .ts-control > input::-ms-clear {
        display: none;
    }

    .ts-control > input:focus {
        outline: none !important;
    }

.has-items .ts-control > input {
    margin: 0px 4px !important;
}

.ts-control.rtl {
    text-align: right;
}

    .ts-control.rtl.single .ts-control:after {
        left: 15px;
        right: auto;
    }

    .ts-control.rtl .ts-control > input {
        margin: 0px 4px 0px -2px !important;
    }

.disabled .ts-control {
    opacity: 0.5;
    background-color: var(--color-surface-dark);
}

.input-hidden .ts-control > input {
    opacity: 0;
    position: absolute;
    left: -10000px;
}

/* Dropdown */
.ts-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 10;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    margin: 0.25rem 0 0 0;
    border-top: 0 none;
    box-sizing: border-box;
    box-shadow: 0 1px 3px var(--color-shadow);
    border-radius: 0 0 3px 3px;
}

    .ts-dropdown [data-selectable] {
        cursor: pointer;
        overflow: hidden;
    }

        .ts-dropdown [data-selectable] .highlight {
            background: color-mix(in srgb, var(--color-primary) 20%, transparent);
            border-radius: 1px;
        }

    .ts-dropdown .option,
    .ts-dropdown .optgroup-header,
    .ts-dropdown .no-results,
    .ts-dropdown .create {
        padding: 5px 8px;
    }

    .ts-dropdown .option,
    .ts-dropdown [data-disabled],
    .ts-dropdown [data-disabled] [data-selectable].option {
        cursor: inherit;
        opacity: 0.5;
    }

    .ts-dropdown [data-selectable].option {
        opacity: 1;
        cursor: pointer;
    }

    .ts-dropdown .optgroup:first-child .optgroup-header {
        border-top: 0 none;
    }

    .ts-dropdown .optgroup-header {
        color: var(--color-text);
        background: var(--color-surface-light);
        cursor: default;
    }

    .ts-dropdown .active {
        background-color: color-mix(in srgb, var(--color-primary) 10%, transparent);
        color: var(--color-primary);
    }

        .ts-dropdown .active.create {
            color: var(--color-primary);
        }

    .ts-dropdown .create {
        color: var(--color-text-muted);
    }

    .ts-dropdown .spinner {
        display: inline-block;
        width: 30px;
        height: 30px;
        margin: 5px 8px;
    }

        .ts-dropdown .spinner:after {
            content: " ";
            display: block;
            width: 24px;
            height: 24px;
            margin: 3px;
            border-radius: 50%;
            border: 5px solid var(--color-border);
            border-color: var(--color-border) transparent var(--color-border) transparent;
            animation: lds-dual-ring 1.2s linear infinite;
        }

@keyframes lds-dual-ring {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.ts-dropdown-content {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 200px;
    overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.ts-hidden-accessible {
    border: 0 !important;
    clip: rect(0 0 0 0) !important;
    -webkit-clip-path: inset(50%) !important;
    clip-path: inset(50%) !important;
    overflow: hidden !important;
    padding: 0 !important;
    position: absolute !important;
    width: 1px !important;
    white-space: nowrap !important;
}

.ts-wrapper.multi .ts-control {
    min-height: 5rem; /* Adjust as needed */
    max-height: none; /* Allow it to grow */
    overflow-y: auto; /* Make it scrollable if needed */
}

.ts-wrapper.multi.has-items .ts-control {
    padding: calc(8px - 2px - 0px) 8px calc(8px - 2px - 3px - 0px);
    min-height: 5rem; /* Same as above for consistency */
    align-items: flex-start; /* Better alignment for multiple items */
}

/* Ensure items wrap properly */
.ts-control {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem; /* Small gap between items */
}


/* Responsive Adjustments */
@media (max-width: 640px) {
    .ts-dropdown {
        max-height: 40vh;
    }
}
