/* /var/www/family_site/static/css/components/custom-select.css */
/* ============================================================
   custom-select.css — универсальная кастомная выпадашка
   ============================================================ */

/* ============================================================
   ОБЁРТКА
   ============================================================ */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

/* ============================================================
   ТРИГГЕР (визуально = input с иконкой слева)
   ============================================================ */
.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 0 4px 0;
    background: transparent;
    border: none;
    border-bottom: 2px solid #ffffff;
    color: #ffffff;
    font-size: 15px;
    cursor: pointer;
    font-family: inherit;
    min-height: 32px;
    box-sizing: border-box;
    line-height: 1.2;
}

/* Если триггер внутри .field-group-icon — учитываем отступ под иконку */
.field-group-icon.custom-select-wrapper .custom-select-trigger {
    padding-left: 0;
}

/* Внутри flex-контейнера .field-group-icon триггер занимает свободное место */
.field-group-icon .custom-select-trigger,
.field-group-icon-right .custom-select-trigger {
    flex: 1;
    border-bottom: none;
}

.custom-select-trigger .custom-select-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-select-trigger .custom-select-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
    margin-left: 8px;
}

.custom-select-trigger.open .custom-select-arrow {
    transform: rotate(180deg);
}

/* ============================================================
   ВЫПАДАЮЩИЙ СПИСОК ОПЦИЙ
   ============================================================ */
.custom-select-options {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    min-width: 200px;
    background: rgba(232, 237, 242, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    overflow: hidden;
    z-index: var(--z-modal);
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.06), 0 2px 12px rgba(0, 0, 0, 0.03);
}

.custom-select-options.open {
    display: block;
    animation: customSelectSlideDown 0.2s ease forwards;
}

@keyframes customSelectSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   ОПЦИЯ
   ============================================================ */
.custom-select-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #1a1a2e;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s ease;
    font-family: inherit;
}

.custom-select-option:hover {
    background: rgba(108, 92, 231, 0.08);
}

.custom-select-option.selected {
    background: rgba(108, 92, 231, 0.15);
    font-weight: 500;
}

.custom-select-option i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 16px;
    flex-shrink: 0;
    line-height: 1;
}

/* ============================================================
   СКРОЛЛБАР
   ============================================================ */
.custom-select-options::-webkit-scrollbar {
    width: 6px;
}

.custom-select-options::-webkit-scrollbar-track {
    background: transparent;
}

.custom-select-options::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

.custom-select-options::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}