.ftp-family-tree-container {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    font-family: Arial, sans-serif;
    position: relative;
    background: #c0392b; /* Nền đỏ */
    padding: 20px;
    border: 5px solid #f1c40f; /* Viền vàng nhạt */
    border-radius: 10px;
    color: #fff;
}

.ftp-family-tree-header {
    text-align: center;
    margin-bottom: 20px;
}

.ftp-family-tree-header h1 {
    font-size: 36px;
    color: #f1c40f; /* Màu vàng nhạt */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.ftp-family-tree-header p {
    font-size: 18px;
    color: #fff;
}

.ftp-family-info {
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 5px;
}

.ftp-family-info h2 {
    font-size: 24px;
    color: #f1c40f; /* Màu vàng nhạt */
    margin-bottom: 10px;
}

.ftp-family-info .content {
    font-size: 16px;
}

.ftp-family-tree-tabs {
    margin-bottom: 20px;
    text-align: center;
}

.ftp-family-tree-tabs button {
    padding: 10px 20px;
    margin: 0 5px;
    cursor: pointer;
    background: #f1c40f; /* Màu vàng nhạt */
    border: none;
    border-radius: 5px;
    font-size: 14px;
    color: #fff;
}

.ftp-family-tree-tabs button.active {
    background: #e67e22; /* Màu cam nhạt khi active */
}

.ftp-tree-view, .ftp-list-view {
    display: none;
}

.ftp-tree-view.active, .ftp-list-view.active {
    display: block;
}

.ftp-tree-view {
    position: relative;
}

.ftp-tree-generation {
    position: relative;
    margin-bottom: 120px; /* Tăng khoảng cách giữa các đời */
}

.ftp-generation-members {
    display: flex;
    flex-wrap: nowrap; /* Ngăn xuống dòng */
    overflow-x: auto; /* Thêm thanh cuộn ngang */
    gap: 20px; /* Khoảng cách giữa các nhóm gia đình */
    justify-content: center; /* Căn giữa các thành viên */
    align-items: start; /* Căn chỉnh các ô thành viên ở đầu hàng */
    padding-bottom: 10px; /* Đảm bảo thanh cuộn không che nội dung */
}

.ftp-generation-members::-webkit-scrollbar {
    height: 8px; /* Chiều cao thanh cuộn */
}

.ftp-generation-members::-webkit-scrollbar-track {
    background: #f1c40f; /* Màu nền thanh cuộn */
    border-radius: 4px;
}

.ftp-generation-members::-webkit-scrollbar-thumb {
    background: #e67e22; /* Màu thanh cuộn */
    border-radius: 4px;
}

.ftp-generation-members::-webkit-scrollbar-thumb:hover {
    background: #d35400; /* Màu thanh cuộn khi hover */
}

.ftp-tree-generation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    border-top: 2px solid #f1c40f; /* Đường kẻ vàng nhạt */
    height: 1px;
}

.ftp-family-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 0 0 auto; /* Đảm bảo không co giãn */
}

.ftp-member-wrapper {
    display: flex;
    align-items: center;
    min-height: 120px; /* Đảm bảo chiều cao cố định để thẳng hàng */
    position: relative;
}

.ftp-tree-member {
    text-align: center;
    position: relative;
    display: inline-block !important; /* Đảm bảo không bị ẩn */
    width: 120px;
    background: #ffffff; /* Màu trắng cho ô thành viên */
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.ftp-tree-member img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #f1c40f; /* Viền vàng nhạt */
    margin-bottom: 5px;
}

.ftp-tree-member .name {
    font-size: 14px;
    font-weight: bold;
    color: #000000; /* Tên màu đen */
    cursor: pointer;
}

.ftp-tree-member .name:hover {
    color: #e67e22; /* Màu cam nhạt khi hover */
}

.ftp-tree-member .generation {
    font-size: 12px;
    color: #000000; /* Số thứ tự màu đen */
}

.ftp-tree-member .actions {
    position: absolute;
    top: 0;
    right: 0;
    display: none;
}

.ftp-tree-member:hover .actions {
    display: block;
}

.ftp-tree-member .actions a {
    margin-left: 5px;
    color: #e67e22; /* Màu cam nhạt */
    text-decoration: none;
}

.ftp-tree-member .actions a:hover {
    color: #d35400; /* Màu cam đậm khi hover */
}

/* Đường kết nối từ cha mẹ xuống con cái */
.ftp-tree-member::after {
    content: '';
    position: absolute;
    bottom: -50px; /* Đường từ dưới ô thành viên xuống con cái */
    left: 50%;
    border-left: 2px solid #f1c40f; /* Đường kết nối vàng nhạt */
    height: 50px;
}

/* Đường kết nối từ đời trên xuống thành viên */
.ftp-tree-member::before {
    content: '';
    position: absolute;
    top: -50px; /* Đường từ đời trên xuống */
    left: 50%;
    border-left: 2px solid #f1c40f; /* Đường kết nối vàng nhạt */
    height: 50px;
}

.ftp-spouse-group {
    display: flex;
    align-items: center;
    margin-left: 20px; /* Khoảng cách giữa chồng và vợ */
    position: relative;
}

/* Đường nối ngang trên đầu giữa vợ và chồng với mũi tên hai chiều */
.ftp-spouse-group::before {
    content: '<';
    position: absolute;
    top: -20px; /* Đặt đường kẻ trên đầu */
    left: -10px; /* Mũi tên trái chỉ vào chồng */
    color: #f1c40f; /* Màu vàng nhạt */
    font-size: 16px;
    font-weight: bold;
}

.ftp-spouse-group::after {
    content: '>';
    position: absolute;
    top: -20px; /* Đặt đường kẻ trên đầu */
    right: -10px; /* Mũi tên phải chỉ vào vợ */
    color: #f1c40f; /* Màu vàng nhạt */
    font-size: 16px;
    font-weight: bold;
}

.ftp-spouse-group .spouse-connector {
    position: absolute;
    top: -20px; /* Đặt đường kẻ trên đầu */
    left: -10px;
    right: -10px;
    border-top: 2px solid #f1c40f; /* Đường ngang vàng nhạt */
}

.ftp-spouse-group .ftp-tree-member {
    margin: 0 10px;
}

.ftp-list-view table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.1);
}

.ftp-list-view th, .ftp-list-view td {
    border: 1px solid #f1c40f; /* Viền vàng nhạt */
    padding: 8px;
    text-align: left;
    color: #fff;
}

.ftp-list-view th {
    background: #e67e22; /* Màu cam nhạt */
}

.ftp-news-container, .ftp-media-container {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
}

.ftp-news-item, .ftp-media-item {
    margin-bottom: 20px;
}

.ftp-news-item img, .ftp-media-item img {
    max-width: 100%;
    height: auto;
}

/* Modal */
#ftp-member-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

#ftp-member-modal .modal-content {
    background: #fff;
    width: 500px;
    margin: 50px auto;
    padding: 20px;
    border-radius: 10px;
    position: relative;
}

#ftp-member-modal .modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-size: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .ftp-family-group {
        margin: 10px;
    }

    .ftp-tree-member {
        width: 100px;
    }

    .ftp-tree-member img {
        width: 50px;
        height: 50px;
    }

    .ftp-tree-member .name {
        font-size: 12px;
    }

    .ftp-tree-member .generation {
        font-size: 10px;
    }

    .ftp-spouse-group {
        margin-left: 10px;
    }

    #ftp-member-modal .modal-content {
        width: 90%;
    }
}