﻿.ms-container {
    width: 100%;
    position: relative;
    display: block;
    box-sizing: border-box;
}

.ms-wrap {
    position: relative;
    user-select: none;
    width: 100%;
    display: block;
    box-sizing: border-box;
}

.ms-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    overflow: visible;
    width: 100%;
    min-height: 42px;
    height: auto;
    padding: 6px 60px 6px 10px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    position: relative;
    box-sizing: border-box;
}

    .ms-trigger:hover {
        border-color: #94a3b8;
    }

    .ms-trigger.open {
        border-color: #6366f1;
        box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
    }

.ms-placeholder {
    color: black;
    font-size: 1rem;
    pointer-events: none;
    white-space: nowrap;
}

.ms-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ede9fe;
    color: #5b21b6;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 99px;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
    max-width: 140px;
    overflow: hidden;
}

.ms-tag-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.ms-tag-remove {
    cursor: pointer;
    color: #7c3aed;
    font-size: 1rem;
    margin-left: 2px;
    flex-shrink: 0;
}

    .ms-tag-remove:hover {
        color: #dc2626;
    }

.ms-summary-badge {
    display: inline-flex;
    align-items: center;
    background: #ede9fe;
    color: #5b21b6;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 99px;
    white-space: nowrap;
    flex-shrink: 0;
}

.ms-arrow {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #94a3b8;
    pointer-events: none;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.ms-trigger.open .ms-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.ms-clear {
    position: absolute;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.1rem;
    display: none;
    z-index: 2;
    flex-shrink: 0;
}

    .ms-clear:hover {
        color: #ef4444;
    }

    .ms-clear.visible {
        display: block;
    }

.ms-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    width: 100%;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    z-index: 9999;
    overflow: hidden;
    display: none;
    box-sizing: border-box;
}

    .ms-panel.open {
        display: block;
    }

.ms-search {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
}

    .ms-search input {
        width: 100%;
        border: none;
        outline: none;
        font-size: 1rem;
        background: transparent;
        font-family: inherit;
    }

        .ms-search input::placeholder {
            color: #cbd5e1;
        }

.ms-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 4px 0;
}

    .ms-list::-webkit-scrollbar {
        width: 4px;
    }

    .ms-list::-webkit-scrollbar-thumb {
        background: #e2e8f0;
        border-radius: 4px;
    }

.ms-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 1rem;
    color: #334155;
    cursor: pointer;
    transition: background 0.1s;
}

    .ms-option:hover {
        background: #f8fafc;
    }

    .ms-option.selected {
        color: #5b21b6;
        background: #faf5ff;
    }

.ms-checkbox {
    width: 16px;
    height: 16px;
    border: 1.5px solid #cbd5e1;
    border-radius: 4px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    transition: all 0.15s;
}

.ms-option.selected .ms-checkbox {
    background: #6366f1;
    border-color: #6366f1;
}

    .ms-option.selected .ms-checkbox::after {
        content: '';
        width: 9px;
        height: 5px;
        border-left: 2px solid #fff;
        border-bottom: 2px solid #fff;
        transform: rotate(-45deg) translateY(-1px);
        display: block;
    }

.ms-footer {
    border-top: 1px solid #f1f5f9;
    padding: 6px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    color: #94a3b8;
}

    .ms-footer button {
        background: none;
        border: none;
        color: #6366f1;
        font-size: 1rem;
        cursor: pointer;
        font-weight: 500;
        font-family: inherit;
    }

        .ms-footer button:hover {
            text-decoration: underline;
        }
