/* 
 * EM Custom Select Component
 * High-performance, fully custom select dropdown
 */

.em-custom-select-wrap {
    position: relative;
    display: inline-block;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    user-select: none;
    margin-top: 5px; /* Spacing below labels similar to em-form-input */
}

/* Trigger / Display Box */
.em-custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
    min-height: 38px;
    box-sizing: border-box;
}

.em-custom-select-trigger:hover {
    border-color: #94a3b8;
}

.em-custom-select-wrap.is-open .em-custom-select-trigger {
    border-color: #7835d6;
    box-shadow: 0 0 0 3px rgba(120, 53, 214, 0.1);
}

.em-custom-select-value {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 10px;
}

.em-custom-select-value.is-placeholder {
    color: #94a3b8;
}

.em-custom-select-arrow {
    width: 12px;
    height: 12px;
    transition: transform 0.2s ease;
    color: #64748b;
    flex-shrink: 0;
}

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

/* Dropdown Menu */
.em-custom-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    z-index: 9999999;
    max-height: 250px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.em-custom-select-wrap.is-open .em-custom-select-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Options */
.em-custom-select-option {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    font-size: 14px;
    color: #334155;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f8fafc;
}

.em-custom-select-option:last-child {
    border-bottom: none;
}

.em-custom-select-option:hover {
    background: #f1f5f9;
}

.em-custom-select-option.is-selected {
    background: #eef2ff;
    color: #4f46e5;
    font-weight: 500;
}

/* Multi-select Checkbox Style */
.em-custom-select-option .em-cs-checkbox {
    width: 16px;
    height: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    background: #fff;
    flex-shrink: 0;
}

.em-custom-select-option.is-selected .em-cs-checkbox {
    background: #7835d6;
    border-color: #7835d6;
}

.em-custom-select-option .em-cs-checkbox svg {
    width: 10px;
    height: 10px;
    color: #fff;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s;
}

.em-custom-select-option.is-selected .em-cs-checkbox svg {
    opacity: 1;
    transform: scale(1);
}

/* Multi-select Tags */
.em-cs-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.em-cs-tag {
    background: #f1f5f9;
    color: #475569;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
}

.em-cs-tag-remove {
    margin-left: 4px;
    cursor: pointer;
    opacity: 0.6;
}

.em-cs-tag-remove:hover {
    opacity: 1;
    color: #ef4444;
}
.em-custom-select-search { padding: 8px; border-bottom: 1px solid #e2e8f0; position: sticky; top: 0; background: #fff; z-index: 2; }
.em-custom-select-search input { width: 100%; padding: 6px 10px; border: 1px solid #cbd5e1; border-radius: 4px; font-size: 13px; box-sizing: border-box; }
.em-custom-select-options-wrap { max-height: 250px; overflow-y: auto; }
.em-custom-select-trigger {
    min-width: 0;
}
.em-custom-select-value {
    min-width: 0;
    flex: 1;
}
.em-filters .em-custom-select-wrap {
    min-width: 250px;
    max-width: 350px;
}
