/**
 * TreeDropdown Component Styles
 * Collapsible hierarchical dropdown component
 */

.tree-dropdown {
    position: relative;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.tree-dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.2s;
}

.tree-dropdown-toggle:hover {
    border-color: #999;
}

.tree-dropdown-value {
    flex: 1;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-dropdown-arrow {
    margin-left: 10px;
    color: #666;
    font-size: 12px;
    transition: transform 0.2s;
}

.tree-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    width: 100%;
}

.tree-dropdown-menu.open {
    display: block;
}

.tree-dropdown-menu.open-upward {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 4px;
}

.tree-dropdown-item {
    position: relative;
}

.tree-dropdown-item-content {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s;
    white-space: nowrap;
}

.tree-dropdown-item-content:hover {
    background-color: #f5f5f5;
}

.tree-dropdown-item.selected > .tree-dropdown-item-content {
    background-color: #e3f2fd;
    color: #1976d2;
    font-weight: 500;
}

.tree-dropdown-item.selected > .tree-dropdown-item-content:hover {
    background-color: #bbdefb;
}

.tree-dropdown-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-right: 6px;
    font-size: 10px;
    color: #666;
    cursor: pointer;
    transition: transform 0.2s;
}

.tree-dropdown-icon:hover {
    color: #333;
}

.tree-dropdown-spacer {
    display: inline-block;
    width: 16px;
    margin-right: 6px;
}

.tree-dropdown-label {
    flex: 0 1 auto;
}

.tree-dropdown-children {
    overflow: hidden;
    transition: all 0.2s ease-in-out;
}

/* Scrollbar styling */
.tree-dropdown-menu::-webkit-scrollbar {
    width: 8px;
}

.tree-dropdown-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.tree-dropdown-menu::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.tree-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Disabled state */
.tree-dropdown.disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* Focus state for accessibility */
.tree-dropdown-toggle:focus-within {
    outline: 2px solid #1976d2;
    outline-offset: 2px;
}

/* Default badge indicator */
.tree-dropdown-default-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    background: #4CAF50;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
