/* Organization Chart Level Styles */
.org-level {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    position: relative;
    margin-top: 80px;
    width: max-content;
    margin-left: auto;
    margin-right: auto;
}

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

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

/* Node styles for levels */
.org-node {
    position: relative;
    margin: 0px 15px 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 200px;
}

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

.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-referral {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 8px;
    padding: 4px 8px;
    background: rgba(3, 128, 192, 0.1);
    border-radius: 6px;
}

.referral-code {
    font-size: 12px;
    font-weight: 500;
    color: #0380C0;
    font-family: 'Courier New', monospace;
}

.referral-icon {
    --mud-icon-size-small: 16px;
    padding: 2px;
    min-width: auto;
    width: 20px;
    height: 20px;
}

.referral-icon:hover {
    background-color: rgba(3, 128, 192, 0.2);
}

.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;
}

/* Responsive adjustments for levels */
@media (max-width: 768px) {
    .org-level {
        flex-direction: column;
        align-items: center;
        margin-top: 20px;
    }

    .org-node {
        margin: 10px 0;
    }

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

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

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

/* Animation for level expansion */
.org-level {
    animation: fadeInLevel 0.3s ease-in-out;
}

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

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