.tags-dropdown-widget {
    position: relative;
    width: 100%;
    max-width: 400px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: white;
    min-height: 42px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    padding: 4px 8px;
}

.tags-container {
    flex: 1;
    min-width: 0;
    cursor: pointer;
    min-height: 30px;
}

.tags-placeholder {
    position: absolute;
    left: 5%;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
    pointer-events: none;
}

.tags-list:has(.tag) ~ .tags-placeholder {
    display: none;
}

.tags-list:not(:empty) ~ .tags-placeholder {
    display: none;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    pointer-events: none;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #e3f2fd;
    border-radius: 16px;
    font-size: 13px;
    color: #1976d2;
    pointer-events: auto;
}

.tag-remove {
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: #1976d2;
    margin-left: 2px;
}

.tag-remove:hover {
    color: #d32f2f;
}

.dropdown-trigger {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #999;
    padding: 0 4px;
}

.dropdown-trigger:hover {
    color: #333;
}

.dropdown-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-top: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    max-height: 280px;
    display: flex;
    flex-direction: column;
}

.dropdown-header {
    padding: 10px 12px;
    background: #fafafa;
}

.select-all-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

.select-all-option input {
    margin: 0;
}

.dropdown-divider {
    height: 1px;
    background: #eee;
}

.dropdown-options {
    overflow-y: auto;
    max-height: 230px;
    padding: 8px 0;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
}

.option-item:hover {
    background: #f5f5f5;
}

.option-item input {
    margin: 0;
}

.option-checkbox,
.select-all-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-item span,
.select-all-option span {
    position: relative;
    padding-left: 22px;
    cursor: pointer;
}

.option-item span:before,
.select-all-option span:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border: 1px solid #777;
    border-radius: 2px;
    background: white;
    box-sizing: border-box;
}

.option-checkbox:checked + span:after,
.select-all-checkbox:checked + span:after {
    content: '✓';
    position: absolute;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    line-height: 1;
    color: #333;
}

.select-all-checkbox:indeterminate + span:after {
    content: '−';
    position: absolute;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    line-height: 1;
    color: #333;
}

.option-item span,
.select-all-option span,
.tags-placeholder {
    font-family: 'Montserrat', sans-serif;
}
