/* Searchable filter selects */

.searchable-select {
    position: relative;
    width: 100%;
}

.searchable-select-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    color: #f0f0f0;
    cursor: pointer;
    font-size: 0.9em;
    transition: border-color 0.15s;
    text-align: left;
}

.searchable-select-trigger:hover {
    border-color: #444;
}

.searchable-select-trigger:focus {
    outline: none;
    border-color: #ff3b3b;
}

.searchable-select-value {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 8px;
}

.searchable-select-value.placeholder {
    color: #666;
}

.searchable-select-arrow {
    color: #666;
    font-size: 16px;
    transition: transform 0.15s;
    flex-shrink: 0;
}

.searchable-select-panel.open ~ .searchable-select-trigger .searchable-select-arrow,
.searchable-select-trigger:has(+ .searchable-select-panel.open) .searchable-select-arrow {
    transform: rotate(180deg);
}

.searchable-select-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #0d0d0d;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: none;
    overflow: hidden;
}

.searchable-select-panel.open {
    display: block;
}

.searchable-select-search-wrap {
    padding: 8px;
    border-bottom: 1px solid #1a1a1a;
}

.searchable-select-search {
    width: 100%;
    padding: 7px 10px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 5px;
    color: #f0f0f0;
    font-size: 0.85em;
    outline: none;
    box-sizing: border-box;
}

.searchable-select-search:focus {
    border-color: #ff3b3b;
}

.searchable-select-list {
    max-height: 200px;
    overflow-y: auto;
}

.searchable-select-list::-webkit-scrollbar {
    width: 4px;
}

.searchable-select-list::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.searchable-select-item {
    padding: 8px 12px;
    cursor: pointer;
    color: #ccc;
    font-size: 0.85em;
    transition: background 0.15s;
    border-bottom: 1px solid #161616;
}

.searchable-select-item:last-child {
    border-bottom: none;
}

.searchable-select-item:hover {
    background: #1a1a1a;
    color: #f0f0f0;
}

.searchable-select-item.selected {
    background: #2a1515;
    color: #ff3b3b;
    font-weight: 500;
}

.searchable-select-empty {
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 0.85em;
}

/* Filter presets block */
.filter-presets-block {
    padding-bottom: 12px;
    margin-bottom: 4px;
    border-bottom: 1px solid #2a2a2a;
}

.filter-presets-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.filter-presets-title {
    color: #ff3b3b;
    font-weight: bold;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-preset-save-btn {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #f0f0f0;
    padding: 4px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8em;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
}

.filter-preset-save-btn:hover {
    border-color: #ff3b3b;
    color: #ff3b3b;
}

.filter-presets-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 150px;
    overflow-y: auto;
}

.filter-presets-list::-webkit-scrollbar {
    width: 4px;
}

.filter-presets-list::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.filter-preset-item {
    display: flex;
    align-items: center;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 5px;
    padding: 6px 8px;
    transition: border-color 0.15s;
}

.filter-preset-item:hover {
    border-color: #444;
}

.filter-preset-name {
    flex: 1;
    color: #ccc;
    font-size: 0.85em;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-preset-name:hover {
    color: #ff3b3b;
}

.filter-preset-delete {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 1.3em;
    line-height: 1;
    padding: 0 4px;
    margin-left: 4px;
}

.filter-preset-delete:hover {
    color: #ff3b3b;
}

.filter-presets-empty {
    color: #555;
    font-size: 0.8em;
    font-style: italic;
    text-align: center;
    padding: 8px;
}

/* Multi-select checkboxes */
.searchable-select-multi .searchable-select-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.searchable-select-checkbox {
    width: 14px;
    height: 14px;
    border: 1px solid #555;
    border-radius: 3px;
    background: #0d0d0d;
    flex-shrink: 0;
    position: relative;
    transition: background 0.15s, border-color 0.15s;
}

.searchable-select-checkbox.checked {
    background: #ff3b3b;
    border-color: #ff3b3b;
}

.searchable-select-checkbox.checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.searchable-select-multi .searchable-select-item.selected {
    background: transparent;
    color: #f0f0f0;
}

.searchable-select-multi .searchable-select-item:hover {
    background: #1a1a1a;
}

.searchable-select-item-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
