﻿

.tree-page-container {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: #334155;
    width: 100%;
    box-sizing: border-box;
}

/* Page Header */
.tree-page-header {
    margin-bottom: 28px;
}

.tree-page-title {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.02em;
}

.tree-page-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 0;
    font-weight: 500;
}

/* Search & Filter Control */
.tree-search-card {
    background: #181818;
    border: 1px solid #5d5d5d;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 28px;
    box-shadow: 0 4px 20px -2px rgba(148, 163, 184, 0.06);
}

.tree-search-flex {
    display: flex;
    gap: 12px;
    align-items: center;
    max-width: 500px;
}

.tree-search-input {
    background-color: unset;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 13px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    outline: none;
    transition: all 0.25s ease;
    width: 100%;
    box-sizing: border-box;
}

    .tree-search-input:focus {
        border-color: #0284c7;
        background-color: #ffffff;
        box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.08);
    }

.tree-search-btn {
    background-color: #4318FF;
    color: #000000;
    font-weight: 700;
    font-size: 13px;
    border: none;
    border-radius: 8px;
    padding: 13px 22px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: radial-gradient(ellipse farthest-corner at right bottom,#fedb37 0%,#fdb931 8%,#9f7928 30%,#8a6e2f 40%,transparent 80%),radial-gradient(ellipse farthest-corner at left top,#fff,#ffffac 8%,#d1b464 25%,#5d4a1f 62.5% 100%);
}
 

/* Scrollable Viewport System */
.tree-viewport-card {
    background: #181818;
    border: 1px solid #5d5d5d;
    border-radius: 8px;
    box-shadow: 0 4px 20px -2px rgba(148, 163, 184, 0.06);
    min-height: 550px;
    position: relative;
    overflow: hidden;
}

.tree-viewport {
    width: 100%;
    overflow: auto;
    padding: 50px 30px;
    box-sizing: border-box;
    cursor: grab;
    user-select: none;
    -webkit-overflow-scrolling: touch;
    will-change: scroll-position;
    transform: translate3d(0, 0, 0);
}

    .tree-viewport:active {
        cursor: grabbing;
    }

/* Prevent dynamic branches from squishing */
.tree-scroll-wrapper {
    display: inline-block;
    min-width: 100%;
    text-align: center;
    vertical-align: top;
}

.tree-container {
    display: inline-block;
    margin: 0 auto;
    text-align: center;
    padding: 10px;
}

/* Genealogy Tree Connectors */
.genealogy-tree, .genealogy-tree ul, .genealogy-tree li {
    list-style-type: none;
    margin: 0;
    padding: 0;
    position: relative;
}

.genealogy-tree {
    display: inline-block;
}

    .genealogy-tree ul {
        display: flex;
        justify-content: center;
        align-items: flex-start;
        padding-top: 30px;
        position: relative;
        transition: all 0.4s ease;
        width: max-content;
        margin: 0 auto;
    }

    .genealogy-tree li {
        text-align: center;
        position: relative;
        padding: 30px 15px 0 15px;
        transition: all 0.4s ease;
    }

        /* Connector Logic Rules */
        .genealogy-tree li::before, .genealogy-tree li::after {
            content: '';
            position: absolute;
            top: 0;
            right: 50%;
            border-top: 2px solid #cbd5e1;
            width: 50%;
            height: 30px;
            z-index: 1;
        }

        .genealogy-tree li::after {
            right: auto;
            left: 50%;
            border-left: 2px solid #cbd5e1;
        }

        .genealogy-tree li:only-child::after, .genealogy-tree li:only-child::before {
            display: none;
        }

        .genealogy-tree li:only-child {
            padding-top: 0;
        }

        .genealogy-tree li:first-child::before, .genealogy-tree li:last-child::after {
            border: 0 none;
        }

        .genealogy-tree li:last-child::before {
            border-right: 2px solid #cbd5e1;
            border-radius: 0 5px 0 0;
        }

        .genealogy-tree li:first-child::after {
            border-radius: 5px 0 0 0;
        }

    .genealogy-tree ul ul::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        border-left: 2px solid #cbd5e1;
        width: 0;
        height: 30px;
        transform: translateX(-50%);
        z-index: 1;
    }

/* Node Card Customization */
.tree-node-wrapper {
    display: inline-block;
    position: relative;
    background: #000000 !important;
    border: 2.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 140px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    z-index: 10;
}

    .tree-node-wrapper:hover {
        transform: translateY(-5px);
        box-shadow: 0 12px 20px rgba(0, 0, 0, 0.08);
    }

.tree-node-active {
    border-color: #10b981;
}

    .tree-node-active:hover {
        border-color: #059669;
        box-shadow: 0 10px 15px rgba(16, 185, 129, 0.15);
    }

.tree-node-inactive {
    border-color: #f43f5e;
}

    .tree-node-inactive:hover {
        border-color: #e11d48;
        box-shadow: 0 10px 15px rgba(244, 63, 94, 0.15);
    }

.tree-avatar-container {
    position: relative;
    width: 55px;
    height: 55px;
    margin: 0 auto 10px auto;
}

.tree-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffffff;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    background-color: #f8fafc;
}

.tree-status-dot {
    position: absolute;
    bottom: 3px;
    right: 3px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 2.5px solid #ffffff;
}

.dot-active {
    background-color: #10b981;
}

.dot-inactive {
    background-color: #f43f5e;
}

.tree-user-id {
    font-weight: 800;
    color: #f4b64f !important;
    font-size: 13px;
    margin-bottom: 2px;
    letter-spacing: -0.01em;
}

.tree-user-name {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    margin: 0 auto;
}

.tree-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #000000;
    color: #f4b64f;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    margin-top: 8px;
    border: 2px solid #e2e8f0;
}

.node-searched-glow {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 5px rgba(2, 132, 199, 0.3) !important;
    animation: pulseSearch 1.2s infinite;
}

@keyframes pulseSearch {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.06);
    }

    100% {
        transform: scale(1);
    }
}

/* Tooltip */
/* --- Desktop Tooltip Standard Style --- */
.node-tooltip-card {
    display: none;
    position: absolute;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.15);
    width: 300px;
    text-align: left;
    z-index: 9999;
    box-sizing: border-box;
}

/* Close button on Tooltip (Hidden on Desktop, Visible on Mobile) */
.tooltip-close-btn {
    display: none;
    position: absolute;
    top: 14px;
    right: 14px;
    background: #f1f5f9;
    border: none;
    color: #64748b;
    font-size: 18px;
    font-weight: bold;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

    .tooltip-close-btn:hover {
        background: #e2e8f0;
        color: #0f172a;
    }

/* --- Mobile Responsive Fixes (768px or below) --- */
@media (max-width: 768px) {
    .node-tooltip-card {
        display: block; /* Display block allows transitions to trigger */
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        top: auto !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 24px 24px 0 0 !important; /* Rounded corners only at the top */
        border: 1px solid #e2e8f0;
        border-bottom: none;
        box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.15);
        padding: 24px 20px;
        /* Smooth Slide-up transition */
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 99999;
        background: #ffffff;
    }

        /* Active State for Mobile Slide-up */
        .node-tooltip-card.show-mobile {
            transform: translateY(0) !important;
        }

    /* Show close button in Mobile View */
    .tooltip-close-btn {
        display: inline-flex;
    }
}

.tip-header {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.tip-title {
    font-weight: 800;
    font-size: 14px;
    color: #bac0cd;
}

.tip-sub {
    font-size: 11px;
    color: #f8f9fa;
    font-weight: 500;
    margin-top: 1px;
}

.tip-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.tip-item {
    display: flex;
    flex-direction: column;
}

.tip-label {
    font-size: 9px;
    color: #bac0cd;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 1px;
}

.tip-value {
    font-size: 11px;
    color: #f8f9fa;
    font-weight: 700;
}

/* Mobile Scaling Responsive Media */
@media (max-width: 768px) {
    .tree-search-flex {
        flex-direction: column;
        align-items: stretch;
        max-width: 100%;
    }

    .tree-search-btn {
        width: 100%;
        justify-content: center;
    }

    .tree-viewport {
        padding: 30px 10px;
    }

    .genealogy-tree ul {
        padding-top: 24px;
    }

    .genealogy-tree li {
        padding: 24px 8px 0 8px;
    }

    .tree-node-wrapper {
        min-width: 120px;
        padding: 10px;
    }

    .tree-avatar-container {
        width: 46px;
        height: 46px;
    }

    .tree-user-id {
        font-size: 11px;
    }

    .tree-user-name {
        font-size: 9px;
        max-width: 90px;
    }

    .tree-count-badge {
        font-size: 9px;
        padding: 2px 6px;
    }

    .genealogy-tree ul ul::before,
    .genealogy-tree li::before,
    .genealogy-tree li::after {
        height: 24px;
    }
}

/* --- Desktop Tooltip Standard Style --- */
.node-tooltip-card {
    display: none;
    position: absolute;
    background: #000000;
    border: 2px solid #eeb24e;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.15);
    width: 300px;
    text-align: left;
    z-index: 9999;
    box-sizing: border-box;
}


/* Header */
.custom-header {
    background: #000;
    border-bottom: 1px solid #151515;
    position: sticky;
    top: 0;
    z-index: 998;
}

.top-heading {
    font-size: clamp(0.75rem, 1vw, 0.95rem);
    line-height: 1.6;
    font-weight: 400;
    color: rgb(176, 176, 176);
}

.header-btn {
    font-size: 12px;
    background-color: unset;
    border: none;
    color: #ffffff;
    padding: 6px 9px;
    border-radius: 5px;
}

    .header-btn:hover {
        background-color: rgba(212, 175, 55, 0.08);
    }

.avtar-icon {
    background-color: unset;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 40px;
    width: 40px;
    border-radius: 30px;
    cursor: pointer;
}

    .avtar-icon :hover {
        background-color: #d4a85f1a;
        display: flex;
        justify-content: center;
        align-items: center;
        height: 40px;
        width: 40px;
        border-radius: 30px;
    }


