/**
 * Стили для множественного выбора с поиском
 * Используется для IT статуса, профессий и навыков
 */

/* Контейнер множественного выбора */
.multi-select-wrapper {
    position: relative;
    width: 100%;
}

/* Само поле выбора */
.multi-select-filter {
    width: 100%;
    min-height: 200px;
    max-height: 350px;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.95em;
    background: white;
    overflow-y: auto;
    overflow-x: hidden;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    scroll-behavior: auto;
    overscroll-behavior: contain;
}

.multi-select-filter:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    scroll-behavior: auto;
}

.multi-select-filter:focus-within {
    scroll-behavior: auto;
}

/* Опции в списке */
.multi-select-filter option {
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 5px;
    margin-bottom: 3px;
    transition: all 0.2s;
    font-weight: 500;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
    min-height: 45px;
}

/* Выбранные опции */
.multi-select-filter option:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
}

/* Hover эффект */
.multi-select-filter option:hover {
    background: #f0f8ff;
    transform: translateX(3px);
}

.multi-select-filter option:checked:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8b 100%);
}

/* Кнопка очистки выбора */
.btn-clear-selection {
    padding: 4px 12px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
}

.btn-clear-selection:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

.btn-clear-selection:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(231, 76, 60, 0.3);
}

.btn-clear-selection i {
    font-size: 0.9em;
}

/* Поле поиска внутри селекта */
.select-search-box {
    width: 100%;
    padding: 8px 35px 8px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    box-sizing: border-box;
}

.select-search-box:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .multi-select-wrapper {
        position: relative;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        scrollbar-width: thick;
        scrollbar-color: #3498db #e0e0e0;
        padding-bottom: 10px;
    }
    
    .multi-select-wrapper::after {
        content: '← Прокрутите вправо для полного текста →';
        position: absolute;
        bottom: -8px;
        left: 0;
        right: 0;
        font-size: 0.7em;
        color: #3498db;
        text-align: center;
        font-weight: 600;
        pointer-events: none;
        background: linear-gradient(to right, transparent, #fff 20%, #fff 80%, transparent);
        padding: 2px 0;
    }
    
    .multi-select-wrapper::-webkit-scrollbar {
        height: 12px;
    }
    
    .multi-select-wrapper::-webkit-scrollbar-track {
        background: #e0e0e0;
        border-radius: 6px;
        box-shadow: inset 0 0 3px rgba(0,0,0,0.1);
    }
    
    .multi-select-wrapper::-webkit-scrollbar-thumb {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-radius: 6px;
        border: 2px solid #e0e0e0;
    }
    
    .multi-select-wrapper::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(135deg, #5568d3 0%, #653a8b 100%);
    }
    
    .multi-select-filter {
        min-height: 150px;
        max-height: 250px;
        font-size: 0.85em;
        padding: 6px;
        min-width: 100%;
        box-sizing: border-box;
    }
    
    .multi-select-filter option {
        padding: 10px 12px;
        white-space: nowrap;
        line-height: 1.5;
        min-height: 42px;
        display: block;
    }
    
    .select-search-box {
        font-size: 0.85em;
        padding: 6px;
    }
    
    .btn-clear-selection {
        padding: 3px 8px;
        font-size: 0.75em;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .multi-select-wrapper {
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 20px;
        scrollbar-width: thick;
        scrollbar-color: #667eea #f0f0f0;
    }
    
    .multi-select-wrapper::after {
        content: '← Прокрутите для полного текста →';
        font-size: 0.65em;
        bottom: -2px;
    }
    
    .multi-select-wrapper::-webkit-scrollbar {
        height: 16px;
    }
    
    .multi-select-wrapper::-webkit-scrollbar-track {
        background: #f0f0f0;
        border-radius: 8px;
        box-shadow: inset 0 0 5px rgba(0,0,0,0.15);
    }
    
    .multi-select-wrapper::-webkit-scrollbar-thumb {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-radius: 8px;
        border: 3px solid #f0f0f0;
        min-width: 50px;
    }
    
    .multi-select-wrapper::-webkit-scrollbar-thumb:active {
        background: linear-gradient(135deg, #4556c9 0%, #543670 100%);
    }
    
    .multi-select-filter {
        font-size: 0.75em;
        min-height: 180px;
        max-height: 300px;
        min-width: 160%;
    }
    
    .multi-select-filter option {
        padding: 12px 14px;
        white-space: nowrap !important;
        line-height: 1.6 !important;
        min-height: 55px !important;
        height: auto !important;
        font-size: 1.1em;
    }
}
