/* Hierarchy Tree Styling - Premium Design */
#controlled-by-tree-container {
    padding: 60px 20px;
    background: #f8fafc;
    border-radius: 16px;
    margin-top: 10px;
    overflow-x: auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.tree-loader {
    text-align: center;
    color: #64748b;
    padding: 20px;
    font-style: italic;
}


.node-button-div {
    margin-top: 60%;
    height: 70% !important;
}

.org-tree {
    display: flex;
    flex-direction: column-reverse;
    /* Target Company at the bottom */
    align-items: center;
    gap: 60px;
    position: relative;
}

.tree-level {
    display: flex;
    justify-content: center;
    gap: 30px;
    width: 100%;
}

.tree-node {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    width: 280px;
    min-height: 120px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    text-decoration: none;
    color: #0f172a;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.tree-node:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.tree-node--company {
    border-left: 6px solid #27ae60;
}

.tree-node--person {
    border-left: 6px solid #3498db;
}

.tree-node--base {
    background: #1e293b;
    color: #ffffff;
    border-left: 6px solid #27ae60;
    z-index: 10;
}

.tree-node__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.tree-node__icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tree-node__type {
    font-size: 10px;
    color: #27ae60;
    /* Company green by default */
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.tree-node--person .tree-node__type {
    color: #3498db;
}

.tree-node--base .tree-node__type {
    color: #94a3b8;
}

.tree-node__name {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 4px;
    line-height: 1.2;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tree-node__meta {
    font-size: 11px;
    color: #27ae60;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}

.tree-node--person .tree-node__meta {
    color: #3498db;
}

.tree-node--base .tree-node__meta {
    border-top-color: rgba(255, 255, 255, 0.1);
    color: #27ae60;
}

/* Vertical line connecting levels */
.has-controllers::after {
    content: '';
    position: absolute;
    bottom: 120px;
    /* Adjust based on base node height */
    left: 50%;
    width: 2px;
    height: 60px;
    background: #cbd5e1;
    z-index: 1;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.tree-node {
    animation: fadeIn 0.4s ease forwards;
}