/*
 * Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0
 */

.asset-links-tree-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--color-background-container-content);
    border: 1px solid #eaeded;
    border-radius: 4px;
}

/* Search box styling */
.asset-links-search-box {
    padding: 10px 5px;
    border-bottom: 1px solid #eaeded;
    background-color: var(--color-background-container-header);
}

.asset-links-search-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.asset-links-search-container > div {
    flex: 1;
}

/* Tree styling */
.asset-links-tree {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.asset-links-tree-footer {
    padding: 8px 10px;
    border-top: 1px solid #eaeded;
    background-color: #f8f9fa;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.asset-links-toggle-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.asset-links-toggle-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 16px;
}

.selection-note {
    font-size: 11px;
    color: #6c757d;
    text-align: center;
}

.asset-links-tree-item {
    margin-bottom: 2px;
}

.asset-links-tree-item-content {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.15s ease;
    min-height: 32px;
}

.asset-links-tree-item-content:hover {
    background-color: var(--color-background-item-selected);
}

.asset-links-tree-item-content.selected {
    background-color: var(--color-background-item-selected, #e3f2fd);
    border: 1px solid var(--color-border-item-selected, #1976d2);
    color: var(--color-text-accent, #1976d2);
    font-weight: 500;
}

.asset-links-tree-item-caret {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-right: 4px;
    cursor: pointer;
    color: var(--color-text-interactive-default);
}

.asset-links-tree-item-caret:hover {
    color: var(--color-text-interactive-hover);
}

.asset-links-tree-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    color: var(--color-text-body-secondary);
}

.asset-links-tree-item-name {
    flex: 1;
    font-size: 14px;
    color: var(--color-text-body-default);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.asset-links-count {
    margin-left: 8px;
    font-size: 12px;
    color: var(--color-text-body-secondary);
    font-weight: normal;
}

.asset-links-tags {
    margin-left: 8px;
    font-size: 12px;
    color: var(--color-text-body-secondary);
    font-weight: normal;
    font-style: italic;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

.asset-links-tree-item-children {
    margin-left: 0;
}

/* Root node styling - only level 0 nodes should be bold */
.asset-links-tree-item-content[style*="padding-left: 0px"] {
    font-weight: 600;
}

/* Asset nodes (level 1 and higher) should not be bold */
.asset-links-tree-item-content[style*="padding-left: 16px"],
.asset-links-tree-item-content[style*="padding-left: 32px"],
.asset-links-tree-item-content[style*="padding-left: 48px"],
.asset-links-tree-item-content[style*="padding-left: 64px"] {
    font-weight: normal;
}

/* Nested asset nodes should have slightly smaller font */
.asset-links-tree-item-content[style*="padding-left: 32px"],
.asset-links-tree-item-content[style*="padding-left: 48px"],
.asset-links-tree-item-content[style*="padding-left: 64px"] {
    font-size: 13px;
}

/* Search results styling */
.asset-links-search-results {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.asset-links-search-result-item {
    display: flex;
    align-items: center;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    margin-bottom: 4px;
    transition: background-color 0.15s ease;
}

.asset-links-search-result-item:hover {
    background-color: var(--color-background-item-hover);
}

.asset-links-search-result-item.selected {
    background-color: var(--color-background-item-selected, #e3f2fd);
    border: 1px solid var(--color-border-item-selected, #1976d2);
    color: var(--color-text-accent, #1976d2);
    font-weight: 500;
}

.asset-links-search-result-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    color: var(--color-text-body-secondary);
}

.asset-links-search-result-name {
    flex: 1;
    font-size: 14px;
    color: var(--color-text-body-default);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.asset-links-search-result-type {
    margin-left: 8px;
    font-size: 12px;
    color: var(--color-text-body-secondary);
    background-color: var(--color-background-status-info);
    padding: 2px 6px;
    border-radius: 10px;
}
