/* #region Variables and Fonts */
:root {
    /* Colors */
    --blue-base: #182339;
    --menu-blue: #20293d;
    --menu-blue-2: #1b2333;
    --blue-darkest: #0e1624;
    --menu-gray-text: #6a7079;

    /* UI Elements */
    --ul-background: #ffffff0c;
    --menu-transparency: #ffffff14;

    /* Node Colors */
    --green-default: #0b7b54;
    --red-default: #753738;
    --green-hover: #079757;
    --red-hover: #b62a11;
    --green-child: var(--green-default);
    --red-child: var(--red-default);
    --green-opened: var(--green-default);
    --red-opened: var(--red-default);
    --green-opened-text: #dff3ea;
    --red-opened-text: #fde5e5;
    --green-bubble-indicator: #0da36f;
    --red-bubble-indicator: #c73e24;

    /* Widths */


    /* Transitions */
    --transition-colorGrow-duration-hover: 0.2s;
    --transition-colorRecede-duration: 0.5s;
    --transition-border-duration: 0.05s;
    /* Make border transition faster */
    --transition-duration-default: 0.3s;
    --bezier-curve: cubic-bezier(0.165, 0.84, 0.44, 1);
    /* Common bezier curve for consistency */

    /* Smooth scrolling */
    --scroll-behavior: smooth;
    --scroll-duration: 0.8s;

    /* Typography */
    font-size: 62.5%;
    font-family: 'Fut';

    /* Tree View Lines */
    --tree-line-color: rgba(255, 255, 255, 0.15);
    --tree-line-width: 1px;
    --tree-line-style: solid;

    /* Animation effects */
    --highlight-duration: 1.2s;
    --highlight-scale: 1.01;
    --highlight-shadow-color: rgba(255, 255, 255, 0.15);
    --highlight-glow-color: rgba(86, 192, 128, 0.2);

    /* Section animation effects */
    --section-animation-duration: 1s;
    --section-scale-amount: 1.02;
    --section-glow-color: rgba(86, 192, 128, 0.25);
    --section-red-glow-color: rgba(205, 83, 52, 0.25);
}

@font-face {
    font-display: swap;
    font-family: 'Fut';
    font-style: normal;
    font-weight: 400;
    src: local('Fut'), local('Fut'),
        url(/fonts/fut.woff) format('woff');
}

@font-face {
    font-display: swap;
    font-family: 'Fut-cond';
    font-style: normal;
    font-weight: 400;
    src: local('fut-condensed'), local('fut-condensed'),
        url(/fonts/fut-condensed.woff2) format('woff2');
}

/* #endregion Variables and Fonts */

/* #region Basic Reset */
html {
    font-family: sans-serif;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

*,
*:before,
*:after,
:before,
:after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-size: 1.6rem;
    line-height: 1.43;
    color: #333;
}

p {
    margin: 0 0 10px;
}

a {
    background-color: transparent;
    color: #337ab7;
    text-decoration: none;
    position: relative;
}

a:hover,
a:focus {
    color: #23527c;
    text-decoration: underline;
}

a:active {
    outline: 0;
}

b,
strong {
    font-weight: 700;
}

sub,
sup {
    position: relative;
    font-size: 75%;
    line-height: 0;
    vertical-align: baseline;
}

sup {
    top: -0.5em;
}

img {
    border: 0;
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

table {
    border-spacing: 0;
    border-collapse: collapse;
    background-color: transparent;
}

td,
th {
    padding: 0;
}

input,
button,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

hr {
    margin-top: 20px;
    margin-bottom: 20px;
    border: 0;
    border-top: 1px solid #eee;
}

h1, h2, h3, .h1, .h2, .h3 {
    font-family: inherit;
    font-weight: 500;
    line-height: 1.1;
    color: inherit;
    margin: 0;
    margin-block-start: 0;
    -webkit-margin-before: 0;
}

h1, .h1 {
    font-size: 36px;
}

h2, .h2 {
    font-size: 30px;
}

h3, .h3 {
    font-size: 24px;
}

ul, ol {
    margin-top: 0;
    margin-bottom: 10px;
}

blockquote {
    padding: 10px 20px;
    margin: 0 0 20px;
}

blockquote p:last-child,
blockquote ul:last-child,
blockquote ol:last-child {
    margin-bottom: 0;
}

label {
    display: inline-block;
    max-width: 100%;
    margin-bottom: 5px;
    font-weight: 700;
}

.form-control {
    width: 100%;
    height: 34px;
    padding: 6px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
    transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
}

.form-control::-webkit-input-placeholder {
    color: #999;
}

n1:before {
    content: '1.';
}

/* #endregion Basic Reset */

/* #region Layout - Site & Pane Wrappers */
#site-wrapper {
    height: 100%;
    width: 100vw;
    overflow-y: visible;
    overflow-x: hidden;
    padding-left: 0;
    position: fixed;
    transition: all 0.5s ease;
    background: var(--blue-base);
    /* Ensure scroll behavior is consistent */
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

#site-wrapper.untoggled #left-pane {
    width: clamp(320px, 100vw, 350px);
}

#site-wrapper.untoggled #right-pane {
    overflow-y: visible;
    position: absolute;
    margin-right: -350px;
}

#left-pane {
    z-index: 900;
    position: fixed;
    left: 350px;
    width: 0;
    height: 100%;
    margin-left: -350px;
    overflow-x: hidden;
    overflow-y: auto;
    background: #0f1624;
    transition: all 0.5s ease;
    padding-bottom: 60px;
    -ms-overflow-style: none;
    scrollbar-width: none !important;
}

#right-pane {
    height: 100%;
    width: 100%;
}

#right-pane.arguments-pages {
    padding: 0 calc(1vw);
    max-width: 1024px;
}

.content {
    display: block;
    overflow: hidden;
    width: auto;
}

.sidebar {
    display: block;
    float: left;
    font-size: 1.9rem;
    padding-bottom: 200px;
}

.sidebar-nav {
    position: absolute;
    top: 0;
    width: clamp(320px, 100vw, 350px);
    margin: 0;
    list-style: none;
    padding-bottom: 200px;
    direction: ltr;
}

/* #endregion Layout */

/* #region Scrollbars */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    box-shadow: inset 0 0 5px grey;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #0f1624;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #56c080;
}

/* Scrollbar styling for WebKit browsers */
#left-pane::-webkit-scrollbar {
    width: 2px;
    background-color: #182339;
}

#left-pane::-webkit-scrollbar-thumb {
    background-color: #343a49;
    border-radius: 2px;
}

#left-pane::-webkit-scrollbar-track {
    background-color: #182339;
}

/* Scrollbar styling for Firefox */
#left-pane {
    scrollbar-width: thin;
    scrollbar-color: #343a49 #182339;
}

/* #endregion Scrollbars */

/* #region Header and Navigation */
.searchbar-toggle-container {
    background-image: linear-gradient(120deg, #0F1624 0%, rgba(15, 22, 36, 0) 90%);
    width: clamp(320px, 100vw, 350px);
    display: flex;
    position: fixed;
    direction: ltr;
    z-index: 1000;
    left: 0;
    top: 0;
}

.search-form {
    margin: 7px 14px;
}

.search-form input {
    background-color: #2f3a52;
    color: white;
    border: 1px solid #10121b;
    font-size: 1.6rem;
    width: calc(215px + 2vw);
    height: 31px;
    padding: 0 10px;
}

.toggle {
    font-family: Fut-cond, Arial, sans-serif;
    font-size: 1.6rem;
    line-height: 1.43;
    color: #333;
    box-sizing: border-box;
    max-width: 100%;
    margin-bottom: 5px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    position: static;
    z-index: 1000;
    top: 0;
    left: 170px;
    height: 40px;
    padding: 7px;
}

.toggle-checkbox {
    position: absolute;
    visibility: hidden;
}

.toggle-switch {
    font-family: Fut-cond, Arial, sans-serif;
    font-size: 1.6rem;
    line-height: 3rem;
    color: #333;
    font-weight: 700;
    cursor: pointer;
    box-sizing: border-box;
    display: flex;
    border-radius: 16px;
    width: 63px;
    height: 32px;
    position: relative;
    vertical-align: middle;
    transition: background 0.25s;
    background-color: #ccc;
}

.toggle-checkbox:checked+.toggle-switch {
    background-color: #56c080;
}

.toggle-checkbox:checked+.toggle-switch:before {
    left: 35px;
}

.toggle-switch:before {
    content: '';
    display: block;
    background: linear-gradient(to bottom, #fff 0%, #eee 100%);
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgb(0 0 0 / 25%);
    width: 24px;
    height: 24px;
    position: absolute;
    top: 4px;
    left: 4px;
    transition: left 0.25s;
}

.toggle-checkbox:checked+.toggle-switch .lined-hamburger {
    left: 6px;
}

.lined-hamburger {
    background: #000;
    box-shadow: 0 -6px #000, 0 6px #000;
    height: 3px;
    margin-left: 5px;
    width: 19px;
    left: 29px;
    transition: left 0.25s;
    position: absolute;
    top: 50%;
    margin-top: -1.5px;
}

/* #endregion Header and Navigation */

/* #region Logo/Brand */
.sidebar-nav>.sidebar-brand {
    height: 65px;
    font-size: 1.8rem;
    line-height: 60px;
}

.sidebar-nav>.sidebar-brand a {
    color: #999999;
}

.sidebar-nav>.sidebar-brand a:hover {
    color: #fff;
    background: none;
}

a.brand {
    color: #ffffff;
    font-size: 1.6em;
    margin: 45px 0px 0px auto;
    display: block;
    background: #0f1624;
    border-radius: 0 147px 0 0;
}

a.brand object {
    pointer-events: none;
    width: 60%;
    margin: 14px 0 9px 53px;
    opacity: 80%;
}

a.brand object:hover {
    opacity: 100% !important;
}

/* #endregion Logo/Brand */

/* #region Menu Structure */
.menu {
    font-size: 2.0rem;
    position: relative;
    padding-right: 0px;
    background-image: linear-gradient(to bottom, #0f1624 0, var(--menu-blue) 10%);
}

.menu::after {
    content: "";
    height: 60px;
    width: 345px;
    left: 5px;
    position: absolute;
    background-image: linear-gradient(to bottom, var(--menu-blue) 0, #18233900 100%);
}

ul.nav li {
    display: table-cell;
}

ul.nav li:first-child a {
    margin: 5px;
}

ul.nav li:nth-child(2) a {
    margin-left: 5px;
    margin-right: 5px;
}

ul.nav li a:hover {
    background-color: #282a2a;
}

.sidebar-nav ul {
    font-size: clamp(13px, 5.4vw, .96em);
    padding: 0 0 0 32px;
    font-family: fut-cond, arial;
    list-style: none;
    margin-bottom: 0;
    margin-left: 0px;
    margin-right: 1px;
    border-right: #5d6577bf 2px solid;
    position: relative;
    /* Required for absolute positioning of pseudo-elements */
}

.sidebar-nav ul>li {
    color: #ccc;
}

.sidebar-nav ul li {
    display: block;
    position: relative;
}

/* Vertical lines for parent nodes with children */
.sidebar-nav li:has(> ul) {
    position: relative;
}

.sidebar-nav li:has(> ul)::before {
    content: '';
    position: absolute;
    left: -19px;
    top: 22px;
    /* Start below the current node */
    bottom: 15px;
    width: var(--tree-line-width);
    background-color: var(--tree-line-color);
    z-index: 4;
    /* Make it appear above tails but below toggle buttons */
}

/* Horizontal connector lines for all nodes */
.sidebar-nav ul ul li::after {
    content: '';
    position: absolute;
    left: -32px;
    /* Position to start at the vertical line */
    top: 16px;
    /* Center on the node */
    width: 26px;
    /* Length of connector */
    height: var(--tree-line-width);
    background-color: var(--tree-line-color);
    z-index: 4;
    /* Same z-index as vertical lines */
}

/* Hide vertical line extension for the last child */
.sidebar-nav li:last-child::before {
    height: 22px;
    /* Only extend as far as needed to meet the horizontal line */
}

/* Override the height for special cases */
.sidebar-nav li:last-child:has(> ul)::before {
    height: auto;
    /* Let it extend fully for parents */
}

.sidebar-nav ul li {
    display: block;
}

.sidebar-nav li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.sidebar-nav li>ul {
    padding-left: 15px;
}

.sidebar-nav ul a {
    display: block;
    padding: 2px 10px 2px 0px;
    color: white;
    margin-right: 0px;
}

.sidebar-nav ul a:hover,
.sidebar-nav ul a:focus {
    color: #fff;
    text-decoration: none;
}

.sidebar-nav ul a:active {
    color: #d8d8d8;
    text-decoration: none;
}

.sidebar-nav ul ul a,
.sidebar-nav ul ul a:hover,
.sidebar-nav ul ul a:focus,
.sidebar-nav ul ul a:active {
    background-color: var(--ul-background);
}

.sidebar-nav a,
.sidebar-nav a:hover,
.sidebar-nav a:focus,
.sidebar-nav a:active {
    outline: none;
}

/* #endregion Menu Structure */

/* #region Node Styling */
.menu a.gr, .menu a.rd {
    min-height: 30px;
    width: 100%;
    display: block;
    border-radius: 9px 0 0 9px;
    /* Separate transition properties for more control */
    transition:
        background-position var(--transition-colorRecede-duration) var(--bezier-curve),
        border-left-color var(--transition-border-duration) var(--bezier-curve);
    transform-origin: left center;
    padding-left: 7px;
}

/* Green nodes */
.menu a.gr {
    border-left: 4px solid var(--green-default);
    background: linear-gradient(to right, var(--green-default) 34%, var(--menu-blue) 40%);
    background-size: 300% 100%;
    background-position: 50% 0%;
    background-repeat: no-repeat;
}

/* Red nodes */
.menu a.rd {
    border-left: 4px solid var(--red-default);
    background: linear-gradient(to right, var(--red-default) 34%, var(--menu-blue) 40%);
    background-size: 300% 100%;
    background-position: 50% 0%;
    background-repeat: no-repeat;
}

/* Node tails */
.menu a.gr:before, .menu a.rd:before {
    content: '';
    position: absolute;
    z-index: 2;
    bottom: -2px;
    left: -17px;
    height: 22px;
    border-left: 21px solid;
    border-bottom-right-radius: 16px 14px;
    transform: translate(0, -2px);
}

.menu a.gr:before {
    border-left-color: var(--green-default);
    /* Use the same timing function for the tail */
    transition: border-left-color var(--transition-border-duration) var(--bezier-curve);
}

.menu a.rd:before {
    border-left-color: var(--red-default);
    /* Use the same timing function for the tail */
    transition: border-left-color var(--transition-border-duration) var(--bezier-curve);
}

.menu a.gr:after, .menu a.rd:after {
    content: '';
    position: absolute;
    z-index: 3;
    bottom: -2px;
    left: 4px;
    width: 22px;
    height: 23px;
    background: var(--menu-blue);
    border-bottom-right-radius: 11px;
    transform: translate(-30px, -2px);
}

/* Node hover states - Enhanced gradient effect */
.menu a.gr:hover {
    border-left-color: var(--green-hover);
    color: var(--green-opened-text);
    background: linear-gradient(to right, var(--green-hover) 34%, var(--menu-blue) 40%);
    background-size: 300% 100%;
    background-position: 20% 0%;
    /* Fine-tune the transition timing */
    transition:
        background-position var(--transition-colorGrow-duration-hover) var(--bezier-curve),
        border-left-color var(--transition-border-duration) var(--bezier-curve),
        transform var(--transition-colorGrow-duration-hover) var(--bezier-curve),
        box-shadow var(--transition-colorGrow-duration-hover) var(--bezier-curve);
    text-shadow: 0 0 1px rgba(223, 243, 234, 0.5);
    transform: translateX(2px) scale(1.01);
    box-shadow: -2px 0px 8px rgba(7, 151, 87, 0.15);
}

.menu a.rd:hover {
    border-left-color: var(--red-hover);
    color: var(--red-opened-text);
    background: linear-gradient(to right, var(--red-hover) 34%, var(--menu-blue) 40%);
    background-size: 300% 100%;
    background-position: 20% 0%;
    /* Fine-tune the transition timing */
    transition:
        background-position var(--transition-colorGrow-duration-hover) var(--bezier-curve),
        border-left-color var(--transition-border-duration) var(--bezier-curve),
        transform var(--transition-colorGrow-duration-hover) var(--bezier-curve),
        box-shadow var(--transition-colorGrow-duration-hover) var(--bezier-curve);
    text-shadow: 0 0 1px rgba(253, 229, 229, 0.5);
    transform: translateX(2px) scale(1.01);
    box-shadow: -2px 0px 8px rgba(182, 42, 17, 0.15);
}

.menu a.gr:hover::before {
    border-left-color: var(--green-hover);
}

.menu a.rd:hover::before {
    border-left-color: var(--red-hover);
}

/* Plus-Minus toggle buttons */
.sidebar-nav .toggle-button {
    background-color: #f0f0f0;
    border: black 1px solid;
    border-radius: 2px;
    opacity: 70%;
    color: #333;
    font-size: clamp(13px, 5.4vw, .96em);
    width: 20px;
    height: 20px;
    min-height: 20px;
    /* Ensure consistent height regardless of node height */
    max-height: 20px;
    /* Prevent growing */
    text-align: center;
    cursor: pointer;
    padding-bottom: 4px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    vertical-align: middle;
    position: absolute;
    left: -30px;
    top: 7px;
    z-index: 105 !important;
    /* Increase z-index to rise above the tail */
    background-clip: padding-box;
}

/* Text positioning within nodes */
.menu li>a>span {
    position: relative;
    z-index: 10;
    padding-left: 2px;
    display: inline-block;
    /* Ensure consistent text alignment */
    vertical-align: middle;
}

/* #endregion Node Styling */

/* #region Special Node States */
/* Active nodes */
.sidebar-nav ul a.active {
    color: #fff;
    text-decoration: none;
    font-style: normal;
    opacity: 1;
}

.sidebar-nav ul a.active:active {
    text-decoration: none;
}

.sidebar-nav ul a.active:focus {
    color: #fff;
    text-decoration: none;
    background-color: #ffffff08;
}

.sidebar-nav ul a.active:hover {
    color: #fff;
    text-decoration: none;
}

/* Large nodes */
.menu .large {
    color: #d5ddee;
    font-style: normal;
    padding-left: 5px;
    margin-top: 30px;
    font-size: clamp(19px, 6vw, 2.1rem);
    background: var(--menu-transparency);
    line-height: 4rem !important;
}

/* Current item */
li.currentItem {
    width: 103%;
}

li.currentItem>ul li a {
    color: #ffffff !important;
    opacity: 1;
    border-right: #b1bfdd 2px solid !important;
    width: 98% !important;
}

.currentItem>ul li a {
    font-style: normal;
}

.currentItem>a span {
    text-decoration: underline;
}

.currentItem>ul li a.gr {
    border-color: var(--green-child);
}

.currentItem>ul li a.rd {
    border-color: var(--red-child);
}

.currentItem>ul li a.gr::before {
    border-color: var(--green-child);
}

.currentItem>ul li a.rd::before {
    border-color: var(--red-child);
}

/* Page nodes */
li.pageNode>ul li a {
    color: #ffffff !important;
    opacity: 1;
    border-right: #b1bfdd 2px solid !important;
}

.inv a {
    opacity: 0.35;
}

/* Highlighted nodes */
li.navHighlightedParent {
    /* Add a subtle indication for the parent */
    background-color: rgba(255, 255, 255, 0.03);
}

li.navHighlightedParent li a {
    left: 1rem;
}

/* Add proper styling for navHighlighted class with increased specificity */
.menu a.gr.navHighlighted {
    border-left-color: var(--green-bubble-indicator) !important;
    background: linear-gradient(to right, var(--green-bubble-indicator) 34%, var(--menu-blue) 40%) !important;
    background-size: 300% 100% !important;
    background-position: 20% 0% !important;
    color: var(--green-opened-text);
    text-shadow: 0 0 1px rgba(223, 243, 234, 0.5);
    transform: translateX(1px) scale(1.01);
    box-shadow: -1px 0px 6px rgba(7, 151, 87, 0.15);
}

/* Ensure the tail syncs with gradient for green nodes with higher specificity */
.sidebar-nav .menu a.gr.navHighlighted::before {
    border-left-color: var(--green-bubble-indicator) !important;
    transition: none !important;
    /* Force immediate color change during scrolling */
}

.menu a.rd.navHighlighted {
    border-left-color: var(--red-bubble-indicator) !important;
    background: linear-gradient(to right, var(--red-bubble-indicator) 34%, var(--menu-blue) 40%) !important;
    background-size: 300% 100% !important;
    background-position: 20% 0% !important;
    color: var(--red-opened-text);
    text-shadow: 0 0 1px rgba(253, 229, 229, 0.5);
    transform: translateX(1px) scale(1.01);
    box-shadow: -1px 0px 6px rgba(182, 42, 17, 0.15);
}

/* Match the specificity for red nodes too */
.sidebar-nav .menu a.rd.navHighlighted::before {
    border-left-color: var(--red-bubble-indicator) !important;
    transition: none !important;
    /* Force immediate color change during scrolling */
}

/* #endregion Special Node States */

/* #region Pin Icons */
.pin {
    display: none;
    position: absolute;
    top: 4px;
    left: 3px;
    padding: 0;
}

.pina>span::before,
.pinb>span::before,
.pinc>span::before,
.pind>span::before,
.pine>span::before,
.pinf>span::before {
    display: none;
    position: absolute;
    top: 4px;
    left: 3px;
    padding: 0;
}

.pina>span::before {
    content: url(../images/pin-a.svg);
}

.pinb>span::before {
    content: url(../images/pin-b.svg);
}

.pinc>span::before {
    content: url(../images/pin-c.svg);
}

.pind>span::before {
    content: url(../images/pin-d.svg);
}

.pine>span::before {
    content: url(../images/pin-e.svg);
}

.pinf>span::before {
    content: url(../images/pin-f.svg);
}
