/* style.css */

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #52525B;
    /* zinc-600 */
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #71717A;
    /* zinc-500 */
}

/* CSS Tree visualization */
/* Based on CSS3 Tree structures approach */

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

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

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

/* We will use ::before and ::after to draw the connectors */

.tree li::before,
.tree li::after {
    content: '';
    position: absolute;
    top: 0;
    right: 50%;
    border-top: 1px solid #71717A;
    /* Tree line color */
    width: 50%;
    height: 20px;
}

.tree li::after {
    right: auto;
    left: 50%;
    border-left: 1px solid #71717A;
}

/* We need to remove left-right connectors from elements without any siblings */
.tree li:only-child::after,
.tree li:only-child::before {
    display: none;
}

/* Remove space from the top of single children */
.tree li:only-child {
    padding-top: 0;
}

/* Remove left connector from first child and right connector from last child */
.tree li:first-child::before,
.tree li:last-child::after {
    border: 0 none;
}

/* Adding back the vertical connector to the last nodes */
.tree li:last-child::before {
    border-right: 1px solid #71717A;
    border-radius: 0 5px 0 0;
}

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

/* Downward connectors from parents */
.tree ul ul::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    border-left: 1px solid #71717A;
    width: 0;
    height: 20px;
    transform: translateX(-50%);
}

.tree span.node {
    border: 1px solid #404040;
    padding: 10px 15px;
    text-decoration: none;
    font-family: 'Fira Code', monospace;
    font-weight: 600;
    font-size: 14px;
    display: inline-block;
    border-radius: 8px;
    transition: all 0.3s;
    background-color: #262626;
    /* match dark bgCard */
    color: #F5F5F5;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
}

/* Prime nodes are highlighted */
.tree span.node.prime {
    background-color: #6366F1;
    /* Primary color */
    color: white;
    border-color: #4F46E5;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

/* Light mode overrides for tree */
html:not(.dark) .tree span.node {
    background-color: #ffffff;
    border-color: #e5e7eb;
    color: #111827;
}

html:not(.dark) .tree span.node.prime {
    background-color: #6366F1;
    color: white;
}

html:not(.dark) .tree li::before,
html:not(.dark) .tree li::after,
html:not(.dark) .tree ul ul::before,
html:not(.dark) .tree li:last-child::before {
    border-color: #d1d5db;
}