/* Styling untuk Halaman My Network */

.page-title {
    text-align: center;
    font-size: 2.5rem;
    color: white;
    margin-bottom: 2rem;
}

/* Kartu Ringkasan */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.card {
    background-color: var(--card-color);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.card-label {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary-color);
    font-weight: 600;
}

.card-value {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    word-break: break-all;
}

/* =================================== */
/* VISUALISASI POHON BINER (REVISED) */
/* =================================== */

.tree-container {
    background-color: var(--card-color);
    border-radius: 16px;
    padding: 2rem;
    overflow-x: auto;
}

.tree {
    /* Wrapper ini menggunakan flex untuk menengahkan seluruh pohon */
    display: flex;
    justify-content: center;
    min-width: fit-content; /* Memastikan container pohon tidak lebih kecil dari isinya */
}

.tree ul {
    padding-top: 20px;
    position: relative;
    display: flex; /* Setiap level adalah flex container */
    justify-content: center;
}

.tree li {
    list-style-type: none;
    position: relative;
    padding: 20px 5px 0 5px;
    display: flex;
    flex-direction: column; /* Menumpuk node dan cabang anaknya secara vertikal */
    align-items: center;
}

/* Garis konektor (disesuaikan untuk flexbox) */
.tree li::before, .tree li::after {
    content: '';
    position: absolute;
    top: 0;
    right: 50%;
    border-top: 2px solid var(--border-color);
    width: 50%;
    height: 20px;
}

.tree li::after {
    right: auto;
    left: 50%;
    border-left: 2px solid var(--border-color);
}

.tree li:only-child::after, .tree li:only-child::before {
    display: none;
}

.tree li:only-child {
    padding-top: 0;
}

.tree li:first-child::before, .tree li:last-child::after {
    border: 0 none;
}

.tree li:last-child::before {
    border-right: 2px solid var(--border-color);
    border-radius: 0 5px 0 0;
}

.tree li:first-child::after {
    border-radius: 5px 0 0 0;
}

.tree ul ul::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    border-left: 2px solid var(--border-color);
    width: 0;
    height: 20px;
}

/* Node (Kotak Pengguna) */
.tree .node {
    padding: 1rem;
    text-decoration: none;
    background-color: var(--background-color);
    color: var(--text-color);
    border-radius: 8px;
    display: inline-block;
    min-width: 150px;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s, color 0.3s;
}

.tree .node-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.tree .node-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: color 0.3s;
}

.tree .node-address {
    font-size: 0.8rem;
    font-weight: 600;
}

.tree .node-counts {
    font-size: 0.7rem;
    color: var(--text-secondary-color);
}

.tree .node.current-user {
    background-color: var(--primary-color);
    color: white;
}

.tree .node.current-user .node-icon {
    color: white;
}

.tree .node.empty-node {
    background-color: transparent;
    border: 2px dashed var(--border-color);
    color: var(--text-secondary-color);
}

.tree .node:hover, .tree .node:hover .node-icon {
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
}
