:root {
            --primary-color: #fca311;
            --bg-color: #14213d;
            --text-color: #ffffff;
            --line-color: rgba(255, 255, 255, 0.3);
            --card-bg: rgba(255, 255, 255, 0.05);
            --card-border: rgba(255, 255, 255, 0.1);
            --card-hover: rgba(255, 255, 255, 0.15);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Outfit', sans-serif;
        }

        body {
            background-color: var(--bg-color);
            color: var(--text-color);
            min-height: 100vh;
            overflow-x: auto;
            background-image: radial-gradient(circle at top right, #1f3460, #14213d);
        }

        header {
            text-align: center;
            padding: 40px 20px;
        }

        header h1 {
            font-size: 3rem;
            font-weight: 700;
            letter-spacing: 2px;
            background: linear-gradient(90deg, #fca311, #e5e5e5);
            background-clip: text;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            margin-bottom: 10px;
        }

        header p {
            font-size: 1.2rem;
            color: #a8b2c1;
            margin-bottom: 30px;
        }

        /* Search Bar Styles */
        .search-container {
            position: relative;
            max-width: 500px;
            margin: 0 auto 20px auto;
            z-index: 50;
        }

        #searchInput {
            width: 100%;
            padding: 15px 25px;
            border-radius: 50px;
            border: 2px solid rgba(255, 255, 255, 0.1);
            background: rgba(0, 0, 0, 0.4);
            color: #fff;
            font-size: 1rem;
            font-family: 'Outfit', sans-serif;
            outline: none;
            backdrop-filter: blur(10px);
            transition: all 0.3s;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        }

        #searchInput::placeholder {
            color: #a8b2c1;
        }

        #searchInput:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 20px rgba(252, 163, 17, 0.3);
            background: rgba(0, 0, 0, 0.6);
        }

        .search-results {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            margin-top: 10px;
            background: var(--bg-color);
            border: 1px solid rgba(252, 163, 17, 0.3);
            border-radius: 16px;
            max-height: 300px;
            overflow-y: auto;
            list-style: none;
            display: none;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
            padding: 10px 0;
        }

        .search-results::-webkit-scrollbar {
            width: 8px;
        }

        .search-results::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.2);
            border-radius: 10px;
        }

        .search-result-item {
            padding: 12px 25px;
            cursor: pointer;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            display: flex;
            flex-direction: column;
            transition: background 0.2s;
        }

        .search-result-item:last-child {
            border-bottom: none;
        }

        .search-result-item:hover {
            background: rgba(252, 163, 17, 0.15);
        }

        .search-name {
            font-weight: 600;
            color: #fff;
            font-size: 1.05rem;
        }

        .search-title {
            font-size: 0.85rem;
            color: var(--primary-color);
            margin-top: 3px;
        }

        /* Animasi Sorot Kartu */
        @keyframes highlightBlink {

            0%,
            100% {
                box-shadow: 0 0 0px var(--primary-color);
                transform: scale(1);
            }

            50% {
                box-shadow: 0 0 40px var(--primary-color);
                transform: scale(1.1);
                border-color: var(--primary-color);
                background: rgba(252, 163, 17, 0.2);
            }
        }

        .highlight-card {
            animation: highlightBlink 0.6s ease-in-out 4;
            z-index: 99 !important;
            border-color: var(--primary-color) !important;
        }

        /* Tree Structure using standard ul li setup */
        .tree-container {
            display: flex;
            justify-content: center;
            min-width: 100%;
            height: 70vh;
            border-radius: 12px;
            background: rgba(0, 0, 0, 0.2);
            box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
            overflow: hidden;
            cursor: grab;
            position: relative;
            /* Kunci utama: matikan semua gesture bawaan browser di dalam area ini */
            touch-action: none;
            -webkit-user-select: none;
            user-select: none;
        }

        .tree-container:active {
            cursor: grabbing;
        }

        #zoom-container {
            transform-origin: 0 0;
            will-change: transform;
            padding: 50px 100px;
            display: inline-block;
        }

        .tree-node-wrapper {
            position: relative;
            display: inline-flex;
            flex-direction: column;
            align-items: center;
            z-index: 2;
        }

        .toggle-btn {
            width: 24px;
            height: 24px;
            background: var(--primary-color);
            color: var(--bg-color);
            border-radius: 50%;
            display: flex;
            justify-content: center;
            align-items: center;
            font-weight: bold;
            font-size: 18px;
            cursor: pointer;
            position: absolute;
            bottom: -12px;
            z-index: 10;
            border: 2px solid var(--bg-color);
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
            transition: all 0.3s ease;
            user-select: none;
        }

        .toggle-btn:hover {
            transform: scale(1.1);
            background: #ffb703;
        }

        .tree ul.collapsed {
            display: none;
        }

        .toggle-btn.collapsed {
            background: #e5e5e5;
            color: #14213d;
        }

        .tree * {
            margin: 0;
            padding: 0;
        }

        .tree ul {
            padding-top: 20px;
            position: relative;
            transition: all 0.5s;
            display: flex;
            justify-content: center;
        }

        .tree li {
            float: left;
            text-align: center;
            list-style-type: none;
            position: relative;
            padding: 20px 15px 0 15px;
            transition: all 0.5s;
        }

        /* Lines */
        .tree li::before,
        .tree li::after {
            content: '';
            position: absolute;
            top: 0;
            right: 50%;
            border-top: 2px solid var(--line-color);
            width: 50%;
            height: 20px;
        }

        .tree li::after {
            right: auto;
            left: 50%;
            border-left: 2px solid var(--line-color);
        }

        .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 li:last-child::before {
            border-right: 2px solid var(--line-color);
            border-radius: 0 5px 0 0;
        }

        .tree li:first-child::after {
            border-radius: 5px 0 0 0;
        }

        .tree ul ul::before {
            content: '';
            position: absolute;
            top: 0;
            left: 50%;
            border-left: 2px solid var(--line-color);
            width: 0;
            height: 20px;
            transform: translateX(-50%);
        }

        /* Tree Cards */
        .tree-card {
            text-decoration: none;
            color: var(--text-color);
            display: inline-flex;
            flex-direction: column;
            align-items: center;
            background: var(--card-bg);
            border: 1px solid var(--card-border);
            border-radius: 12px;
            padding: 15px;
            min-width: 140px;
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            transition: all 0.3s ease;
            cursor: pointer;
            box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
        }



        .tree-card:hover {
            background: var(--card-hover);
            transform: translateY(-5px) scale(1.05);
            border-color: var(--primary-color);
            box-shadow: 0 10px 30px rgba(252, 163, 17, 0.2);
            z-index: 10;
        }

        .avatar {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            object-fit: cover;
            border: 2px solid var(--primary-color);
            margin-bottom: 10px;
            box-shadow: 0 0 15px rgba(252, 163, 17, 0.3);
        }

        .name {
            font-weight: 600;
            font-size: 1.1rem;
            margin-bottom: 5px;
        }

        .title {
            font-size: 0.85rem;
            color: #a8b2c1;
            font-weight: 300;
        }

        /* Hover effects for lines */
        .tree li .tree-node-wrapper:hover+ul li::after,
        .tree li .tree-node-wrapper:hover+ul li::before,
        .tree li .tree-node-wrapper:hover+ul::before,
        .tree li .tree-node-wrapper:hover+ul ul::before {
            border-color: var(--primary-color) !important;
        }

        /* Action Buttons (Bawah Kanan) */
        .action-buttons {
            position: absolute;
            bottom: 15px;
            right: 15px;
            display: flex;
            gap: 10px;
            z-index: 100;
            flex-wrap: wrap;
            justify-content: flex-end;
        }

        .action-btn {
            background: rgba(252, 163, 17, 0.85);
            color: #14213d;
            border: none;
            border-radius: 50px;
            padding: 8px 16px;
            font-family: 'Outfit', sans-serif;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            backdrop-filter: blur(5px);
            box-shadow: 0 4px 15px rgba(252, 163, 17, 0.4);
            transition: all 0.25s ease;
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .action-btn:hover {
            background: #ffb703;
            transform: scale(1.05);
            box-shadow: 0 6px 20px rgba(252, 163, 17, 0.6);
        }

        .action-btn:active {
            transform: scale(0.97);
        }

        /* Mobile Optimization */
        @media (max-width: 768px) {
            .tree-card {
                padding: 10px;
                min-width: 100px;
            }

            .avatar {
                width: 45px;
                height: 45px;
            }

            .name {
                font-size: 0.9rem;
            }

            .title {
                font-size: 0.75rem;
            }

            .toggle-btn {
                width: 22px;
                height: 22px;
                font-size: 14px;
                bottom: -11px;
            }

            main {
                padding: 0 !important;
            }

            .tree-container {
                border-radius: 0;
                height: 75vh;
            }

            header {
                padding: 20px 15px;
            }

            header h1 {
                font-size: 1.6rem;
                letter-spacing: 1px;
            }

            header p {
                font-size: 0.95rem;
            }
        }

        /* Modal styling */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(5px);
            display: flex;
            justify-content: center;
            align-items: center;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
            z-index: 1000;
        }

        .modal-overlay.active {
            opacity: 1;
            visibility: visible;
        }

        .modal-content {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 20px;
            padding: 40px;
            width: 90%;
            max-width: 400px;
            position: relative;
            transform: translateY(20px);
            transition: all 0.3s ease;
            text-align: center;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(20px);
            /* Kaca penuh */
        }

        .modal-overlay.active .modal-content {
            transform: translateY(0);
        }

        .close-btn {
            position: absolute;
            top: 15px;
            right: 20px;
            background: transparent;
            border: none;
            color: white;
            font-size: 1.5rem;
            cursor: pointer;
            transition: color 0.3s;
        }

        .close-btn:hover {
            color: var(--primary-color);
        }

        .modal-body img {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            border: 3px solid var(--primary-color);
            margin-bottom: 20px;
        }

        .modal-body h2 {
            font-size: 1.8rem;
            margin-bottom: 5px;
        }

        .modal-body h4 {
            font-size: 1.1rem;
            color: var(--primary-color);
            margin-bottom: 15px;
            font-weight: 400;
        }

        .modal-body p {
            color: #a8b2c1;
            line-height: 1.6;
            font-size: 0.95rem;
        }

/* ==================================
   LOGIN SCREEN STYLES
================================== */
#login-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at top right, #1f3460, #14213d);
    display: flex; justify-content: center; align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-in-out;
}

.login-box {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px; width: 90%; max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    transform: translateY(20px);
    transition: transform 0.1s ease-in-out; 
}

.login-box input {
    width: 100%; padding: 15px 25px; border-radius: 50px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.4); color: #fff;
    font-size: 1rem; font-family: 'Outfit', sans-serif;
    outline: none; margin-bottom: 20px; text-align: center;
    transition: all 0.3s;
}

.login-box input:focus {
    border-color: #fca311; box-shadow: 0 0 20px rgba(252, 163, 17, 0.3);
}

.login-box button {
    background: rgba(252, 163, 17, 0.85); color: #14213d;
    border: none; border-radius: 50px; padding: 12px 30px;
    font-size: 1.1rem; font-weight: 700; font-family: 'Outfit', sans-serif;
    cursor: pointer; width: 100%; transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(252, 163, 17, 0.4);
}

.login-box button:hover {
    background: #ffb703; transform: scale(1.05); box-shadow: 0 6px 20px rgba(252, 163, 17, 0.6);
}
