/* Custom Multiselect Component Styles */

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

.custom-multiselect-trigger {
    width: 100%;
    height: 46px;
    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-item.is-premium-locked .custom-multiselect-item-content span,
.custom-multiselect-item.is-premium-locked .custom-multiselect-checkbox {
    opacity: 0.5;
}

.custom-multiselect-item.is-premium-locked .custom-multiselect-item-content:after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 8px;
    height: 9px;
    background: no-repeat center bottom;
    background-image: url("data:image/svg+xml,%3Csvg width='9' height='10' viewBox='0 0 9 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.60254 0.5C3.14406 0.5 1.96118 1.68221 1.96094 3.14062V3.64844C1.1111 3.90909 0.500346 4.62211 0.5 5.46289V7.08203C0.500278 8.14318 1.47196 9.00373 2.6709 9.00391H6.32812C7.52723 9.00391 8.49972 8.14328 8.5 7.08203V5.46289C8.49968 4.6913 7.98474 4.02745 7.24316 3.72168V3.14062C7.24292 1.68236 6.06081 0.500242 4.60254 0.5ZM4.60254 2.5C4.95624 2.50024 5.24292 2.78693 5.24316 3.14062V3.54102H3.96094V3.14062C3.96118 2.78678 4.24863 2.5 4.60254 2.5Z' fill='url(%23paint0_linear_2276_8140)'/%3E%3Cpath d='M4.60254 0.5V0H4.60262L4.60254 0.5ZM1.96094 3.14062H1.46094V3.14054L1.96094 3.14062ZM1.96094 3.64844H2.46094V4.01807L2.10755 4.12646L1.96094 3.64844ZM0.5 5.46289H0V5.46269L0.5 5.46289ZM0.5 7.08203L0 7.08216V7.08203H0.5ZM2.6709 9.00391V9.50391H2.67083L2.6709 9.00391ZM8.5 7.08203H9L9 7.08216L8.5 7.08203ZM8.5 5.46289L9 5.46269V5.46289H8.5ZM7.24316 3.72168L7.05257 4.18393L6.74316 4.05635V3.72168H7.24316ZM7.24316 3.14062L7.74316 3.14054V3.14062H7.24316ZM4.60254 2.5V2L4.60288 2L4.60254 2.5ZM5.24316 3.14062L5.74316 3.14028V3.14062H5.24316ZM5.24316 3.54102H5.74316V4.04102H5.24316V3.54102ZM3.96094 3.54102V4.04102H3.46094V3.54102H3.96094ZM3.96094 3.14062H3.46094V3.14028L3.96094 3.14062ZM4.60254 0.5V1C3.42005 1 2.46113 1.95853 2.46094 3.14071L1.96094 3.14062L1.46094 3.14054C1.46123 1.40589 2.86808 0 4.60254 0V0.5ZM1.96094 3.14062H2.46094V3.64844H1.96094H1.46094V3.14062H1.96094ZM1.96094 3.64844L2.10755 4.12646C1.42686 4.33523 1.00024 4.88179 1 5.4631L0.5 5.46289L0 5.46269C0.000452042 4.36243 0.795341 3.48294 1.81433 3.17042L1.96094 3.64844ZM0.5 5.46289H1V7.08203H0.5H0V5.46289H0.5ZM0.5 7.08203L1 7.0819C1.00019 7.81158 1.68922 8.50376 2.67097 8.50391L2.6709 9.00391L2.67083 9.50391C1.25469 9.5037 0.000365257 8.47477 0 7.08216L0.5 7.08203ZM2.6709 9.00391V8.50391H6.32812V9.00391V9.50391H2.6709V9.00391ZM6.32812 9.00391V8.50391C7.31021 8.50391 7.99981 7.81148 8 7.0819L8.5 7.08203L9 7.08216C8.99963 8.47509 7.74426 9.50391 6.32812 9.50391V9.00391ZM8.5 7.08203H8V5.46289H8.5H9V7.08203H8.5ZM8.5 5.46289L8 5.4631C7.99978 4.92873 7.64135 4.4267 7.05257 4.18393L7.24316 3.72168L7.43376 3.25943C8.32813 3.6282 8.99959 4.45388 9 5.46269L8.5 5.46289ZM7.24316 3.72168H6.74316V3.14062H7.24316H7.74316V3.72168H7.24316ZM7.24316 3.14062L6.74316 3.14071C6.74297 1.95852 5.78465 1.0002 4.60246 1L4.60254 0.5L4.60262 0C6.33697 0.000287831 7.74288 1.40619 7.74316 3.14054L7.24316 3.14062ZM4.60254 2.5L4.60288 2C5.23246 2.00043 5.74273 2.51071 5.74316 3.14028L5.24316 3.14062L4.74316 3.14097C4.74311 3.06314 4.68002 3.00005 4.6022 3L4.60254 2.5ZM5.24316 3.14062H5.74316V3.54102H5.24316H4.74316V3.14062H5.24316ZM5.24316 3.54102V4.04102H3.96094V3.54102V3.04102H5.24316V3.54102ZM3.96094 3.54102H3.46094V3.14062H3.96094H4.46094V3.54102H3.96094ZM3.96094 3.14062L3.46094 3.14028C3.46137 2.50991 3.97314 2 4.60254 2V2.5V3C4.52412 3 4.46099 3.06364 4.46094 3.14097L3.96094 3.14062Z' fill='%230C2066'/%3E%3Cdefs%3E%3ClinearGradient id='paint0_linear_2276_8140' x1='8.61429' y1='5.62415' x2='0.614286' y2='5.62415' gradientUnits='userSpaceOnUse'%3E%3Cstop stop-color='%23E5D161'/%3E%3Cstop offset='1' stop-color='%23D5AC15'/%3E%3C/linearGradient%3E%3C/defs%3E%3C/svg%3E%0A");

}

.custom-multiselect-item.is-premium-locked:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Чекбокс */
.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;
    position: relative;
}

.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;
    }
}
