﻿ 
  

.org-chart-wrapper {
    direction: ltr;
    width: 100%;
    text-align: center;
}
    .org-chart-wrapper .member-card {
        direction: rtl;
    }
.tree, .tree ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

    .tree ul {
        display: flex;
        justify-content: center;
        position: relative;
        padding-top: 20px;
    }

    .tree li {
        text-align: center;
        position: relative;
        padding: 20px 10px 0 10px;
    }

        /* خطوط اتصال */
        .tree li::before, .tree li::after {
            content: '';
            position: absolute;
            top: 0;
            right: 50%;
            width: 50%;
            height: 20px;
            border-top: 2px solid #4a76c2;
        }

        .tree li::after {
            right: auto;
            left: 50%;
            border-left: 2px solid #4a76c2;
        }

        .tree li:only-child::after, .tree li:only-child::before {
            display: none;
        }

        .tree li:first-child::before, .tree li:last-child::after {
            border: 0 none;
        }

        .tree li:last-child::before {
            border-right: 2px solid #4a76c2;
            border-radius: 0 5px 0 0;
        }

        .tree li:first-child::after {
            border-radius: 5px 0 0 0;
        }

    .tree ul::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        width: 0;
        height: 20px;
        border-left: 2px solid #4a76c2;
    }

/* استایل باکس‌ها */
.member-card {
    background: #4a76c2;
    color: white;
    padding: 15px;
    border-radius: 5px;
    display: inline-block;
    min-width: 150px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
}

.member-info strong {
    display: block;
    font-size: 1.1em;
    margin-bottom: 5px;
    border-bottom: 1px solid rgba(255,255,255,0.3);
}

/* حذف خطوط افقی زمانی که گره فقط یک فرزند دارد */
.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 ul ul::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    /*border-left: 1px solid #ccc;*/
    width: 0;
    height: 20px;
}

