﻿
/* =====================================
   BINARYPRO BINARY TREE
   ===================================== */

.tree-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 25px;
}

.tree-summary-card {
    padding: 22px;
    background: #ffffff;
    border: 1px solid #e9eaf2;
    border-radius: 14px;
}

    .tree-summary-card span {
        display: block;
        color: #858ba3;
        font-size: 13px;
        margin-bottom: 12px;
    }

    .tree-summary-card strong {
        color: #20243a;
        font-size: 27px;
        font-weight: 800;
    }

/* TREE PANEL */
.binary-tree-panel {
    background: #ffffff;
    border: 1px solid #e9eaf2;
    border-radius: 16px;
    overflow: hidden;
}

.tree-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 25px;
    border-bottom: 1px solid #e9eaf2;
}

    .tree-panel-header h2 {
        color: #20243a;
        font-size: 20px;
        margin-bottom: 7px;
    }

    .tree-panel-header p {
        color: #858ba3;
        font-size: 13px;
    }

    .tree-panel-header button {
        padding: 11px 17px;
        border: 1px solid #e1e3ee;
        border-radius: 9px;
        background: #ffffff;
        color: #5b4bdb;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
    }

        .tree-panel-header button:hover {
            background: #f3f1ff;
        }

/* TREE CANVAS */
.tree-scroll-area {
    width: 100%;
    overflow: auto;
    padding: 40px 25px 50px;
}

.binary-tree {
    min-width: 720px;
    max-width: 1000px;
    margin: 0 auto;
}

.tree-level {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.tree-level-one {
    position: relative;
    z-index: 2;
}

.tree-level-two {
    justify-content: space-around;
    gap: 80px;
}

.tree-level-three {
    justify-content: space-around;
    gap: 25px;
}

/* MEMBER NODE */
.tree-node {
    width: 190px;
    min-height: 190px;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #ffffff;
    border: 1px solid #e6e7f0;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(30, 35, 80, 0.05);
    position: relative;
    z-index: 2;
}

.root-node {
    border: 2px solid #5b4bdb;
    box-shadow: 0 10px 28px rgba(91, 75, 219, 0.12);
}

.tree-node-avatar {
    width: 48px;
    height: 48px;
    margin-bottom: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    background: #efedff;
    color: #5b4bdb;
    font-size: 19px;
    font-weight: 800;
}

.left-node .tree-node-avatar {
    background: #e8f4ff;
    color: #3288d8;
}

.right-node .tree-node-avatar {
    background: #f2eaff;
    color: #8958d6;
}

.tree-node strong {
    color: #20243a;
    font-size: 14px;
    margin-bottom: 8px;
    overflow-wrap: anywhere;
}

.tree-node small {
    color: #858ba3;
    font-size: 11px;
    margin-bottom: 12px;
}

.tree-node-status {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 7px;
    background: #e8f8f0;
    color: #159b68;
    font-size: 10px;
    font-weight: 700;
}

.empty-status {
    background: #f2f3f8;
    color: #858ba3;
}

/* CONNECTOR LINES */
.tree-connector {
    position: relative;
    height: 65px;
    display: flex;
    justify-content: center;
}

.root-connector span:first-child {
    position: absolute;
    top: 0;
    width: 2px;
    height: 32px;
    background: #d8d9e8;
}

.root-connector span:nth-child(2) {
    position: absolute;
    top: 32px;
    width: 50%;
    height: 2px;
    background: #d8d9e8;
}

.root-connector span:nth-child(3) {
    position: absolute;
    top: 32px;
    width: 2px;
    height: 33px;
    background: #d8d9e8;
}

/* CONNECTORS FOR CHILDREN */
.child-connector {
    height: 45px;
    margin: 0 12.5%;
}

    .child-connector span {
        position: absolute;
        top: 0;
        width: 2px;
        height: 22px;
        background: #d8d9e8;
    }

        .child-connector span:nth-child(1) {
            left: 12.5%;
        }

        .child-connector span:nth-child(2) {
            left: 37.5%;
        }

        .child-connector span:nth-child(3) {
            left: 62.5%;
        }

        .child-connector span:nth-child(4) {
            left: 87.5%;
        }

/* EMPTY NODES */
.empty-node {
    background: #fafaff;
    border: 1px dashed #d9dbea;
    box-shadow: none;
}

    .empty-node .tree-node-avatar {
        background: #f0f1f7;
        color: #a0a5b8;
        font-size: 24px;
    }

    .empty-node strong {
        color: #858ba3;
    }

/* LEGEND */
.tree-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 25px;
    padding: 20px;
    border-top: 1px solid #e9eaf2;
    color: #858ba3;
    font-size: 12px;
}

    .tree-legend span {
        display: flex;
        align-items: center;
        gap: 8px;
    }

.legend-dot {
    width: 9px;
    height: 9px;
    display: inline-block;
    border-radius: 50%;
}

.left-dot {
    background: #3288d8;
}

.right-dot {
    background: #8958d6;
}

.empty-dot {
    background: #bfc3d3;
}

/* RESPONSIVE */
@media (max-width: 700px) {
    .tree-summary {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .tree-panel-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 20px;
    }

    .tree-scroll-area {
        padding: 30px 15px;
    }

    .tree-legend {
        justify-content: flex-start;
        gap: 12px;
    }
}
