﻿/* Giao diện Sơ đồ tổ chức dạng cây */
.org-tree {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    margin-bottom: 50px;
    overflow-x: auto; /* Bật cuộn ngang nếu màn hình mobile quá nhỏ */
}

    .org-tree ul {
        padding-top: 20px;
        position: relative;
        transition: all 0.5s;
        display: flex;
        justify-content: center;
        padding-left: 0;
    }

    .org-tree li {
        text-align: center;
        list-style-type: none;
        position: relative;
        padding: 20px 10px 0 10px;
        transition: all 0.5s;
    }

        /* Vẽ các đường thẳng kết nối */
        .org-tree li::before, .org-tree li::after {
            content: '';
            position: absolute;
            top: 0;
            right: 50%;
            border-top: 2px solid #0056b3; /* Màu xanh nhận diện */
            width: 50%;
            height: 20px;
        }

        .org-tree li::after {
            right: auto;
            left: 50%;
            border-left: 2px solid #0056b3;
        }

        /* Xóa đường kẻ ở phần tử con đầu/cuối */
        .org-tree li:only-child::after, .org-tree li:only-child::before {
            display: none;
        }

        .org-tree li:only-child {
            padding-top: 0;
        }

        .org-tree li:first-child::before, .org-tree li:last-child::after {
            border: 0 none;
        }

        .org-tree li:last-child::before {
            border-right: 2px solid #0056b3;
            border-radius: 0 5px 0 0;
        }

        .org-tree li:first-child::after {
            border-radius: 5px 0 0 0;
        }

    /* Đường thẳng đâm xuống thẻ của Node cha */
    .org-tree ul ul::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        border-left: 2px solid #0056b3;
        width: 0;
        height: 20px;
        margin-left: -1px;
    }

/* Khối thiết kế cho từng Node (Phòng/Ban/Lãnh đạo) */
.org-node {
    border: 1px solid #c2d6eb;
    padding: 15px 20px;
    text-decoration: none;
    color: #333;
    font-family: Arial, sans-serif;
    font-size: 14px;
    display: inline-block;
    border-radius: 8px;
    background-color: #f8fbfd;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    min-width: 150px;
}

/* Tô màu nổi bật cho cấp Lãnh đạo */
.node-director {
    background-color: #0056b3;
    color: #fff;
    font-weight: bold;
    border-color: #0056b3;
}

.node-vice {
    background-color: #17a2b8;
    color: #fff;
    border-color: #17a2b8;
}

/* Hiệu ứng Hover */
.org-tree li .org-node:hover {
    background: #e9ecef;
    color: #000;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.org-tree li .node-director:hover, .org-tree li .node-vice:hover {
    background: #004494;
    color: #fff;
}
