/* Custom Multiselect Component Styles */

.custom-multiselect-wrapper {
    position: relative;
    width: 100%;
}

.custom-multiselect-trigger {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background-color: rgba(3, 12, 41, 0.50);
    border-radius: 10px;
    padding: 12px 50px 12px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    position: relative;
    transition: background-color 0.2s, border-color 0.2s;
    box-sizing: border-box;
}

.custom-multiselect-trigger.has-icon {
    padding-right: 70px;
}

.custom-multiselect-trigger:hover {
    background-color: rgba(3, 12, 41, 0.75);
    border-color: rgba(255, 255, 255, 0.25);
    transition-duration: 0s;
}

.custom-multiselect-wrapper.is-open .custom-multiselect-trigger {
    background-color: rgba(3, 12, 41, 0.75);
    border-color: rgba(255, 255, 255, 0.25);
}

.custom-multiselect-text {
    color: #FFF;
    font-size: 16px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    opacity: 0.9;
}

.custom-multiselect-wrapper.has-changed .custom-multiselect-text {
    opacity: 1;
}

.custom-multiselect-icon {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1;
}

.custom-multiselect-icon img {
    max-width: 24px;
    max-height: 24px;
    display: block;
}

.custom-multiselect-icon span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Styles for premium icon in select */
.custom-multiselect-icon.premium-locked {
    font-size: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.custom-multiselect-icon.premium-locked > span {
    font-size: 0;
    display: none;
}

.custom-multiselect-icon.premium-locked img.screener-locked {
    max-width: 24px;
    max-height: 24px;
    display: block;
    margin: 0;
    display: none;
}

body.user-subscription-no .custom-multiselect-icon.premium-locked img.screener-locked,
body.user-subscription-basic .custom-multiselect-icon.premium-locked img.screener-locked {
    display: block;
}

.custom-multiselect-arrow {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='none'%3E%3Cpath opacity='0.75' d='M2 7L11 16L20 7' stroke='%238797D1' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: cover;
    transition: transform 0.2s;
    pointer-events: none;
}

.custom-multiselect-wrapper.is-open .custom-multiselect-arrow {
    transform: translateY(-50%) rotate(180deg);
}

/* Измененный вид селекта */
.custom-multiselect-wrapper.has-changed .custom-multiselect-trigger {
    background-color: rgba(18, 49, 154, 0.50);
    border-color: rgba(18, 49, 154, 0.10);
}

.custom-multiselect-wrapper.has-changed.is-open .custom-multiselect-trigger {
    background-color: rgba(18, 49, 154, 0.50);
    border-color: rgba(18, 49, 154, 0.10);
}

/* Выпадающий список */
.custom-multiselect-dropdown {
    position: absolute;
    width: 324px;
    top: calc(100% + 8px);
    left: 0;
    right: auto;
    background: #0B1740;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.custom-multiselect-dropdown.align-right {
    left: auto;
    right: 0;
}

.custom-multiselect-wrapper.is-open .custom-multiselect-dropdown {
    display: block;
}

/* Заголовок */
.custom-multiselect-title {
    padding: 15px 20px;
    color: #8797D1;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Поисковое поле */
.custom-multiselect-search {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.custom-multiselect-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 15px;
    color: #FFF;
    font-size: 16px;
    box-sizing: border-box;
    transition: background-color 0.2s, border-color 0.2s;
}

.custom-multiselect-search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.custom-multiselect-search-input::placeholder {
    color: #8797D1;
    opacity: 0.7;
}

/* Секции (выбранные/невыбранные) */
.custom-multiselect-section {
    padding: 10px 0;
}

.custom-multiselect-section-title {
    padding: 10px 20px 8px;
    color: #8797D1;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.8;
}

.custom-multiselect-items {
    display: flex;
    flex-direction: column;
}

/* Разделитель */
.custom-multiselect-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 8px 20px;
}

/* Элемент списка */
.custom-multiselect-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.15s;
    position: relative;
}

.custom-multiselect-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.custom-multiselect-item:active {
    background: rgba(255, 255, 255, 0.08);
}

/* Чекбокс */
.custom-multiselect-checkbox {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    margin-right: 12px;
    position: relative;
    transition: border-color 0.2s, background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-multiselect-checkbox-icon {
    width: 12px;
    height: 12px;
    opacity: 0;
    transition: opacity 0.2s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M10 3L4.5 8.5L2 6' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
}

.custom-multiselect-checkbox.checked {
    background: rgba(135, 151, 209, 0.3);
    border-color: #8797D1;
}

.custom-multiselect-checkbox.checked .custom-multiselect-checkbox-icon {
    opacity: 1;
}

/* Контент элемента */
.custom-multiselect-item-content {
    flex: 1;
    color: #FFF;
    font-size: 16px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.custom-multiselect-item-content img {
    max-width: 24px;
    max-height: 24px;
    border-radius: 4px;
    object-fit: cover;
}

.custom-multiselect-item-content .color-circle {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* Блок справки */
.custom-multiselect-item-help {
    width: 24px;
    height: 24px;
    min-width: 24px;
    margin-left: 8px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
}

.custom-multiselect-item-help:hover {
    opacity: 1;
}

.custom-multiselect-item-help i {
    width: 24px;
    height: 24px;
    background-size: contain;
    display: inline-block;
}

/* Скрытие секции выбранных если пусто */
.custom-multiselect-chosen:empty + .custom-multiselect-divider,
.custom-multiselect-chosen.hidden + .custom-multiselect-divider {
    display: none;
}

/* Скроллбар для выпадающего списка */
.custom-multiselect-dropdown::-webkit-scrollbar {
    width: 8px;
}

.custom-multiselect-dropdown::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.custom-multiselect-dropdown::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.custom-multiselect-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Адаптивность */
@media screen and (max-width: 800px) {
    .custom-multiselect-dropdown {
        width: 250px;
        max-height: 300px;
    }

    .custom-multiselect-item {
        padding: 12px 15px;
    }

    .custom-multiselect-search,
    .custom-multiselect-title {
        padding: 12px 15px;
    }
}
