.org-chart-container {
    width: 100%;
    height: 600px;
    overflow: auto;
    padding: 20px 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    position: relative;
}

.org-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    position: absolute;
}

.org-node {
    position: relative;
}

.child-node {
    display: inline-block;
    margin: 0 15px;
    vertical-align: top;
}

.grandchild-node {
    display: inline-block;
    margin: 20px 10px 0;
    vertical-align: top;
}

.node-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid #f0f0f0;
    min-width: 200px;
    max-width: 280px;
    transition: all 0.3s ease;
}

    .node-card:hover {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
        border-color: #e0e0e0;
    }

.node-avatar {
    position: relative;
    text-align: center;
    margin-bottom: 12px;
}

.expand-btn {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: #0380C0;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

    .expand-btn:hover {
        background: #026a9e;
        transform: translateX(-50%) scale(1.1);
    }

.node-info {
    text-align: center;
}

.node-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
}

.node-amounts {
    font-size: 12px;
}

    .node-amounts > div {
        margin-bottom: 4px;
    }

.personal-amount {
    color: #0380C0;
}

.team-amount {
    color: #05AF82;
}

.label {
    font-weight: 500;
    margin-left: 4px;
}

.amount {
    font-weight: 600;
}

.node-connector {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 20px;
    background: #ddd;
}

.org-level {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
}

    .org-level::before {
        content: '';
        position: absolute;
        top: -40px;
        left: 50%;
        transform: translateX(-50%);
        width: 2px;
        height: 20px;
        background: #ddd;
    }

    .org-level::after {
        content: '';
        position: absolute;
        top: -20px;
        left: 0;
        right: 0;
        height: 2px;
        background: #ddd;
        z-index: 1;
    }

.org-sublevel {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
    position: relative;
}

    .org-sublevel::before {
        content: '';
        position: absolute;
        top: -20px;
        left: 50%;
        transform: translateX(-50%);
        width: 2px;
        height: 20px;
        background: #ddd;
    }

    .org-sublevel::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 2px;
        background: #ddd;
        z-index: 1;
    }

/* Responsive adjustments */
@media (max-width: 768px) {
    .org-chart-container {
        padding: 10px 0;
    }

    .org-tree {
        min-width: 100%;
    }

    .child-node {
        margin: 0 8px;
    }

    .grandchild-node {
        margin: 15px 5px 0;
    }

    .node-card {
        min-width: 160px;
        max-width: 220px;
        padding: 12px;
    }

    .node-name {
        font-size: 13px;
    }

    .node-amounts {
        font-size: 11px;
    }
}

/* Animation for expand/collapse */
.org-level,
.org-sublevel {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Connector lines styling */
.node-connector,
.org-level::before,
.org-sublevel::before {
    background: linear-gradient(to bottom, #ddd, #bbb);
}

/* Hover effects */
.node-card:hover .node-avatar .mud-avatar {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

.expand-btn:active {
    transform: translateX(-50%) scale(0.95);
}
