/*==================
VARS
===================*/

:root {
    --color-bg: #000;
    --color-txt: #fff;

    --color-sidebar: rgb(58, 58, 58);
    --color-sidebar-shadow-1: rgba(64, 64, 64, 0.6);
    --color-sidebar-shadow-2: rgb(46, 46, 46);

    --color-cyan: #00ffff;
    --color-orange: #ff6d1f;
    --color-yellow: #fbff1f;
    --color-owner: rgb(255, 85, 0);

    --color-tree-line: rgba(255, 255, 255, 0.2);
    --color-hover: rgba(255, 255, 255, 0.08);
    --color-vignette: rgba(0, 0, 0, 0.6);
    --crt-scanline-alpha: 0.15;
    --crt-noise-opacity: 0.05;
    --crt-vignette-opacity: 0.6;
    --crt-flicker-animation: flicker 1s infinite;
    --text-glow-alpha: 0.5;

    --glow-white:
        0 0 10px rgba(255,255,255,var(--text-glow-alpha)),
        0 0 40px rgba(255,255,255,var(--text-glow-alpha));
    
    --glow-cyan:
        0 0 5px rgba(0,255,255,var(--text-glow-alpha)),
        0 0 15px rgba(0,255,255,var(--text-glow-alpha)),
        0 0 40px rgba(0,255,255,var(--text-glow-alpha)),
        0 0 80px rgba(0,255,255,var(--text-glow-alpha));

    --glow-orange:
        0 0 2px rgba(255,109,31,var(--text-glow-alpha)),
        0 0 5px rgba(255,109,31,var(--text-glow-alpha)),
        0 0 10px rgba(255,109,31,var(--text-glow-alpha)),
        0 0 40px rgba(255,109,31,var(--text-glow-alpha));
    --glow-warning:
        0 0 2px rgba(251,255,31,var(--text-glow-alpha)),
        0 0 5px rgba(255,109,31,var(--text-glow-alpha)),
        0 0 10px rgba(255,109,31,var(--text-glow-alpha)),
        0 0 40px rgba(255,109,31,var(--text-glow-alpha));
    --glow-owner:
        0 0 2px rgba(255,85,0,var(--text-glow-alpha)),
        0 0 5px rgba(255,85,0,var(--text-glow-alpha)),
        0 0 10px rgba(255,85,0,var(--text-glow-alpha));

}

/*==================
BASE
===================*/

html, body {
    font-family: "Fira Code", monospace;

    margin: 0;
    padding: 0;

    min-height: 100vh;
    background: var(--color-bg);
    color: var(--color-txt);
}

body {
    display: flex;
    overflow: hidden;
}

p, pre {
    margin: 0;
}

a {
    color: var(--color-orange);
    text-decoration: none;
}

/*==================
LAYOUT PRINCIPAL
===================*/

.lateralBar {
    order: -1;
    width: 290px;
    min-width: 290px;

    height: 100vh;
    overflow-y: auto;

    padding: 58px 14px 24px;

    background:
        linear-gradient(145deg, rgba(0, 255, 255, 0.08), transparent 34%),
        var(--color-sidebar);

    box-sizing: border-box;

    border-right: 1px solid #555;
    box-shadow:
        inset -10px 0 24px rgba(0, 0, 0, 0.42),
        inset 0 10px 20px 0 var(--color-sidebar-shadow-1);
    position: relative;
}

.lateralBar::before {
    content: "EXPLORER";
    position: absolute;
    top: 17px;
    left: 18px;
    color: var(--color-cyan);
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 0.16em;
    text-shadow: var(--glow-cyan);
}

.lateralBar::after {
    content: "zith-lang / docs";
    position: absolute;
    top: 35px;
    left: 18px;
    color: #aaaaaa;
    font-size: 11px;
    letter-spacing: 0.04em;
}

.main {
    flex: 1;

    display: flex;
    flex-direction: column;

    height: 100vh;
    overflow: hidden;
}

.top {
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
}

.filebar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #444;
    border-left: 4px solid var(--color-orange);
    font-family: "Fira Code", monospace;
    font-size: 16px;
    color: #aaa;
    align-self: flex-start;
    min-width: 200px;
}
.filebar-icon {
    color: var(--color-orange);
    font-weight: bold;
    font-size: 18px;
}
.filebar-path {
    color: var(--color-cyan);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.helios-cta {
    align-self: flex-start;
    padding: 10px 16px;
    border: 1px solid var(--color-orange);
    background: rgba(0, 0, 0, 0.6);
    color: var(--color-orange);
    font-family: "Fira Code", monospace;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    text-shadow: var(--glow-orange);
    transition: 0.15s;
}

.helios-cta:hover,
.helios-cta:focus-visible {
    background: var(--color-orange);
    color: var(--color-bg);
    text-shadow: none;
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 rgba(255, 109, 31, 0.4);
}

.bottom {
    flex: 1;
    overflow: auto;
    padding: 20px;
    padding-top: 0;
    padding-bottom: 40px;
}

.info {
    padding: 48px;
    font-size: 18px;
    box-sizing: border-box;
}

/*==================
COMPONENTS
===================*/

.logo {
    font-size: 12px;
    line-height: 1;

    color: var(--color-cyan);

    overflow-x: auto;
    white-space: pre;

    max-width: 100%;
}

.lastUpdated,
.versionAdded,
.lastUpdate,
.outdated {
    color: var(--color-yellow);
}

.owner {
    color: var(--color-owner);
}

/*=================
TREE
==================*/

.lateralBar ul {
    list-style: none;
    margin: 0;
    padding-left: 16px;
    position: relative;
}

.lateralBar li {
    position: relative;
    padding: 3px 0 3px 13px;
}

.lateralBar ul::before {
    content: "";

    position: absolute;
    top: 0;
    bottom: 0;
    left: 6px;

    width: 1px;

    background: rgba(0, 255, 255, 0.22);
}

.lateralBar li::before {
    content: "";

    position: absolute;
    top: 14px;
    left: 6px;

    width: 10px;
    height: 1px;

    background: rgba(0, 255, 255, 0.22);
}

.lateralBar > ul::before,
.lateralBar > ul > li::before {
    display: none;
}

.lateralBar a {
    text-decoration: none;
    color: #e0e0e0;

    padding: 5px 8px;
    border-left: 2px solid transparent;
    border-radius: 0 4px 4px 0;

    display: inline-block;

    transition: 0.15s;
}

.lateralBar a:hover {
    color: var(--color-cyan);
    border-left-color: var(--color-orange);
    background: rgba(0, 255, 255, 0.1);
    text-shadow: var(--glow-cyan);
}

.lateralBar a.is-active {
    color: var(--color-bg);
    background: linear-gradient(90deg, var(--color-orange), #ff9a57);
    border-left-color: #fff2cf;
    text-shadow: none;
    box-shadow: 0 0 18px rgba(255, 109, 31, 0.25);
}

/*==================
GEAR / SETTINGS
==================*/

.gear {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 99998;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #222;
    border-radius: 6px;
}
.gear img {
    height: 24px;
    filter: drop-shadow(0 0px 4px rgba(0,0,0,0.6));
    transition: transform 0.2s;
}
.gear:hover img {
    transform: rotate(30deg);
}

.settings-group {
    margin-bottom: 16px;
}
.settings-group:last-child {
    margin-bottom: 0;
}
.settings-group h2 {
    color: var(--color-orange);
}
.settings-options {
    display: flex;
    gap: 8px;
    margin: 16px 0;
}
.settings-options button {
    flex: 1;
    padding: 8px;
    background: var(--color-bg);
    color: var(--color-txt);
    border: 2px solid #000;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
}
.settings-options button:hover {
    background: var(--color-hover);
}
.settings-options button.active {
    background: var(--color-orange);
    color: var(--color-bg);
}
.settings-status {
    color: var(--color-txt);
    font-size: 12px;
    margin-top: 8px;
}

.window#settings {
    width: min(400px, 80vw);
    position: fixed;
    top: 60px;
    right: 60px;
    z-index: 100000;
    will-change: transform;
    border: 2px solid #000;
    background-color: #333;
    box-shadow: 6px 6px 10px #000;
    display: flex;
    flex-direction: column;
}
.window#settings .titlebar {
    height: 32px;
    background-color: #0000ff;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    cursor: move;
    touch-action: none;
    user-select: none;
}
.window#settings .buttons {
    display: flex;
    gap: 4px;
}
.window#settings .buttons button {
    width: 24px;
    height: 24px;
    border: none;
    background-color: #dcdcdc;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
}
.window#settings .content {
    flex: 1;
    overflow: auto;
    padding: 16px;
}
.window#settings.hidden {
    display: none;
}

/*==================
CALLOUT BOXES
==================*/

.callout {
    border-left: 4px solid;
    padding: 12px 16px;
    margin: 16px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}
.callout p {
    margin: 4px 0;
}
.callout p:first-child {
    margin-top: 0;
}
.callout p:last-child {
    margin-bottom: 0;
}
.callout strong {
    font-weight: bold;
}
.callout-warning {
    border-color: var(--color-orange);
    text-shadow: var(--glow-warning);
}
.callout-caution {
    border-color: var(--color-yellow);
    text-shadow: var(--glow-warning);
}
.callout-info {
    border-color: var(--color-cyan);
    text-shadow: var(--glow-cyan);
}
.callout-tip {
    border-color: #00ff88;
    text-shadow:
        0 0 5px rgba(0,255,136,var(--text-glow-alpha)),
        0 0 15px rgba(0,255,136,var(--text-glow-alpha));
}
.callout-danger {
    border-color: #ff3333;
    text-shadow:
        0 0 5px rgba(255,51,51,var(--text-glow-alpha)),
        0 0 15px rgba(255,51,51,var(--text-glow-alpha));
}

/*==================
EFEITOS
==================*/

.main {
    font-family: 'VT323';
    
    text-shadow: var(--glow-white);
}

.main .logo {
    text-shadow: var(--glow-cyan);
}

.main a {
    text-shadow: var(--glow-orange);
}

.main h1 {
    color: #FAF3E1;
    margin: 0 0 8px 0;
}
.main h2 {
    color: #FAF3E1;
    margin: 24px 0 8px 0;
}
.main h3 {
    color: #FAF3E1;
    margin: 20px 0 8px 0;
}
.main h4, .main h5, .main h6 {
    color: #FAF3E1;
    margin: 16px 0 6px 0;
}
.main p {
    margin: 8px 0;
    line-height: 1.5;
    color: #e0e0e0;
}

.doc-shell {
    width: min(980px, 100%);
}

.doc-page-header {
    margin-bottom: 18px;
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-left: 4px solid var(--color-cyan);
    background:
        linear-gradient(90deg, rgba(0, 255, 255, 0.08), transparent 45%),
        rgba(255, 255, 255, 0.03);
}

.doc-kicker,
.doc-breadcrumb {
    margin: 0;
}

.doc-kicker {
    color: var(--color-orange);
    font-size: 0.9em;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.doc-breadcrumb {
    color: var(--color-cyan);
    font-size: 1.05em;
}
.main ul, .main ol {
    margin: 8px 0;
    padding-left: 28px;
    color: #e0e0e0;
}
.main li {
    margin: 4px 0;
}
.main table {
    border-collapse: collapse;
    margin: 12px 0;
    width: 100%;
    color: #e0e0e0;
}
.main th, .main td {
    border: 1px solid #555;
    padding: 8px 12px;
    text-align: left;
}
.main th {
    background: rgba(255,255,255,0.08);
    color: #FAF3E1;
}
.main td {
    background: rgba(0,0,0,0.2);
}
.main pre {
    margin: 12px 0;
    padding: 12px 16px;
    background: rgba(0,0,0,0.4);
    border: 1px solid #444;
    border-radius: 4px;
    overflow-x: auto;
}
.main code {
    font-family: "Fira Code", monospace;
    font-size: 0.9em;
    color: #f8f8f2;
    background: rgba(255,255,255,0.08);
    padding: 1px 5px;
    border-radius: 3px;
}
.main pre code {
    background: none;
    padding: 0;
    border: none;
    font-size: 0.85em;
    line-height: 1.5;
}
.main hr {
    border: none;
    border-top: 1px solid #555;
    margin: 24px 0;
}
.main blockquote {
    margin: 12px 0;
    padding: 8px 16px;
    border-left: 4px solid #888;
    background: rgba(255,255,255,0.03);
    color: #ccc;
}
.main img {
    max-width: 100%;
}

.doc-page-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 28px;
}

.doc-nav-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 84px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #f3eee3;
    text-decoration: none;
    transition: transform 0.15s, border-color 0.15s, background 0.15s;
}

.doc-nav-link:hover,
.doc-nav-link:focus-visible {
    transform: translate(-2px, -2px);
    border-color: var(--color-orange);
    background: rgba(255, 109, 31, 0.1);
}

.doc-nav-link-next {
    text-align: right;
    align-items: flex-end;
}

.doc-nav-label {
    color: var(--color-cyan);
    font-size: 0.85em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lastUpdated,
.versionAdded,
.lastUpdate,
.outdated {
    text-shadow: var(--glow-warning);
}

.owner{
    text-shadow: var(--glow-owner);
}


.crt-overlay {
    position: fixed;
    inset: 0;

    pointer-events: none;
    z-index: 99999;

    will-change: opacity;
    animation: var(--crt-flicker-animation, flicker 1s infinite);

    background:
        repeating-linear-gradient(
            to bottom,
            rgba(0,0,0,var(--crt-scanline-alpha, 0.15)),
            rgba(0,0,0,var(--crt-scanline-alpha, 0.15)) 1px,
            transparent 1px,
            transparent 3px
        );

    opacity: 0.85;
}

.crt-overlay::before {
    content: "";
    position: absolute;
    inset: 0;

    background: radial-gradient(
        ellipse at center,
        transparent 40%,
        rgba(0,0,0,var(--crt-vignette-opacity, 0.6)) 100%
    );
}

.crt-overlay::after {
    content: "";
    position: absolute;
    inset: 0;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='1' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");

    opacity: var(--crt-noise-opacity, 0.05);
    animation: noise 2s infinite;
    background-size: 100px 100px;
}

/*==================
ANIMAÇÕES
===================*/

@keyframes noise {
    0% { transform: translate(0,0); }
    10% { transform: translate(-1px,1px); }
    20% { transform: translate(1px,-1px); }
    30% { transform: translate(-1px,-1px); }
    40% { transform: translate(1px,1px); }
    50% { transform: translate(0,0); }
}

@keyframes flicker {
    0% { opacity: 0.65; }
    50% { opacity: 0.7; }
    100% { opacity: 0.65; }
}

@keyframes flicker-low {
    0% { opacity: 0.65; }
    50% { opacity: 0.7; }
    100% { opacity: 0.65; }
}

@keyframes flicker-high {
    0% { opacity: 0.9; }
    50% { opacity: 1; }
    100% { opacity: 0.9; }
}


/*==================
MOBILE
===================*/

@media (max-width: 1080px) {

    body {
        flex-direction: column;
        height: 100dvh;
        overflow: hidden;
        font-size: 34px;
    }

    .lateralBar {
        order: -1;
        width: 100%;

        max-height: 30vh;

        padding: 58px 14px 18px;

        overflow-y: auto;
        flex-shrink: 0;
    }

    .main {
        flex: 1;
        min-height: 0;
        height: auto;
        overflow-y: auto;
    }

    .top {
        flex-shrink: 0;
        padding: 10px;
    }

    .bottom{
        flex-shrink: 0;
        flex: 1;
    }

    .info {
        padding: 20px;
        font-size: 32px;
    }

    .logo {
        font-size: 14px;
    }

    .doc-page-nav {
        grid-template-columns: 1fr;
    }

    .doc-nav-link-next {
        text-align: left;
        align-items: flex-start;
    }

    .gear {
        width: 75px;
        height: 75px;
    }
    .gear img {
        height: 50px;
    }
}

/*==================
SCROLLBAR
===================*/

* {
    scrollbar-width: thin;
    scrollbar-color: #00ffff rgba(255, 255, 255, 0.05);
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

*::-webkit-scrollbar-thumb {
    background: #00ffff;
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:active {
    background-color: #ff6d1f;
}
