/* ================================================
   Custom MultiSelect Dropdown
   Bağımlılık yok, Bootstrap temasıyla uyumlu
   ================================================ */

.cms-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

/* Ana buton */
.cms-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1.42857;
    color: #555;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    box-sizing: border-box;
    min-height: 30px;
    text-align: left;
    outline: none;
    transition: border-color 0.2s;
    -webkit-user-select: none;
    user-select: none;
}

.cms-button:hover {
    border-color: #aaa;
}

.cms-button.cms-open {
    border-color: #66afe9;
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px rgba(102,175,233,.6);
}

.cms-button-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #555;
}

.cms-button-text.cms-placeholder {
    color: #999;
}

.cms-caret {
    margin-left: 6px;
    border-top: 4px solid #777;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    display: inline-block;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.cms-button.cms-open .cms-caret {
    transform: rotate(180deg);
}

/* Dropdown panel */
.cms-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
    min-width: 100%;
}

.cms-dropdown.cms-open {
    display: block;
}

/* Üst aksiyon butonları */
.cms-actions {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e5e5e5;
}

.cms-action-btn {
    flex: 1;
    padding: 5px 8px;
    font-size: 11px;
    background: #f8f8f8;
    border: none;
    cursor: pointer;
    color: #555;
    text-align: center;
    outline: none;
    transition: background 0.15s;
}

.cms-action-btn:first-child {
    border-right: 1px solid #e5e5e5;
}

.cms-action-btn:hover {
    background: #eee;
    color: #333;
}

.cms-action-btn.cms-select-all:hover {
    background: #e8f4f8;
    color: #3598dc;
}

.cms-action-btn.cms-clear-all:hover {
    background: #fdf2f2;
    color: #e74c3c;
}

/* Arama kutusu */
.cms-search-box {
    padding: 5px 6px;
    border-bottom: 1px solid #e5e5e5;
}

.cms-search-input {
    width: 100%;
    padding: 3px 6px;
    font-size: 11px;
    border: 1px solid #ddd;
    border-radius: 3px;
    outline: none;
    box-sizing: border-box;
}

.cms-search-input:focus {
    border-color: #66afe9;
}

/* Liste */
.cms-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 4px 0;
}

.cms-item {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
    color: #444;
    transition: background 0.1s;
    gap: 7px;
}

.cms-item:hover {
    background: #f0f6fc;
}

.cms-item.cms-selected {
    background: #e8f4f8;
}

.cms-item input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.cms-item label {
    margin: 0;
    cursor: pointer;
    font-weight: normal;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cms-item.cms-hidden {
    display: none;
}

/* Sonuç yok */
.cms-no-results {
    padding: 8px 10px;
    font-size: 11px;
    color: #999;
    text-align: center;
    display: none;
}

/* Scrollbar */
.cms-list::-webkit-scrollbar {
    width: 5px;
}
.cms-list::-webkit-scrollbar-track {
    background: #f5f5f5;
}
.cms-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}
