@import url('https://fonts.googleapis.com/css2?family=Science+Gothic:slnt,wdth,wght,CTRS@-2,100,350,17&display=swap&family=Geom:wght@100;300;600&display=swap');

:root {
    /* === THEME DEFAULTS === */
    --first-color-hue: 35;
    --first-color: hsl(var(--first-color-hue), 100%, 83%);
    --title-color: #ffffff;
    --text-color: #e0e0e0;
    --text-color-light: #a0a0a0;
    --body-color: #0a0a0a;

    --glass-bg: rgba(15, 15, 15, 0.6);
    --glass-border: 1px solid rgba(255, 224, 166, 0.15);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --backdrop-blur: blur(10px);

    --body-font: 'Science Gothic', sans-serif;
    --content-font: 'Geom', sans-serif;
    --heading-font: var(--body-font);

    --normal-font-size: 1rem;
    --h1-font-size: 2.5rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--body-color);
    color: var(--text-color);
    font-family: var(--body-font);
    font-size: var(--normal-font-size);
    overflow: hidden;
}

/* THEMES */
body.theme-cosmic {
    background-image: linear-gradient(135deg, #232526 0%, #414345 50%, #5c2563 100%);
    --first-color-hue: 280;
    --first-color: hsl(280, 69%, 61%);
    --glass-bg: rgba(40, 40, 40, 0.25);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
}

body.theme-cyberpunk {
    background-image: linear-gradient(180deg, #35373B, #3a2d48, #8A2BE2);
    --first-color-hue: 277;
    --first-color: hsl(277, 69%, 61%);
    --glass-bg: rgba(40, 40, 40, 0.4);
}

body.theme-royal {
    background-image: linear-gradient(270deg, #35373B, #48392d, #DAA520 100%);
    --first-color-hue: 45;
    --first-color: hsl(45, 69%, 61%);
    --glass-bg: rgba(20, 20, 20, 0.6);
}

body.theme-metal {
    background-image: linear-gradient(153deg, #445f7a 0%, #c5e4f992 100%);
    --first-color-hue: white;
    --first-color: hsl(0, 0%, 100%);
    --glass-bg: rgba(40, 50, 60, 0.4); 
}

#canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.6;
}

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

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--first-color);
}

.hidden {
    display: none !important;
}

.highlight {
    color: var(--first-color);
}

/* LANDING */
.landing-container {
    margin: 0 auto;
    padding: 4rem 2rem;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.8s ease-out;
    overflow-y: auto;
}

.landing-header {
    text-align: center;
    margin-bottom: 3rem;
}

.landing-header h1 {
    font-family: var(--heading-font);
    font-size: 3.5rem;
    color: var(--title-color);
    margin-bottom: 1rem;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    width: 100%;
}

.project-card {
    background: var(--glass-bg);
    border: var(--glass-border);
    border-radius: 1rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
    border-color: var(--first-color);
    scale: .95;
}

.card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-content {
    padding: 1.5rem;
}

.card-content h3 {
    font-family: var(--heading-font);
    color: var(--first-color);
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.card-content p {
    font-family: var(--content-font);
    color: var(--text-color-light);
    font-size: 0.95rem;
}

/* DOCS INTERFACE */
.docs-wrapper {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.glass-panel {
    background: var(--glass-bg);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    backdrop-filter: var(--backdrop-blur);
}

.header-bar {
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    z-index: 100;
    margin: 1rem 1rem 0 1rem;
    border-radius: 12px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--title-color);
    letter-spacing: 1px;
}

.icon-btn, #user{
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--first-color);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    text-decoration: none;
}

.icon-btn:hover, #user:hover{
    background: var(--first-color);
    color: #000;
    scale: 1.05;
}

.project-select-wrapper {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(0, 0, 0, 0.4);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--first-color);
}

.project-select-wrapper i {
    color: var(--first-color);
    font-size: 1.2rem;
}

select {
    background: transparent;
    border: none;
    color: var(--first-color);
    font-family: var(--content-font);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    outline: none;
    text-transform: uppercase;
    max-width: max-content;
}

select option {
    background: #000;
    color: var(--first-color);
}

.theme-toggle {
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    transition: 0.3s;
}

.theme-toggle:hover {
    color: var(--first-color);
    transform: rotate(135deg) scale(1.5);
}

/* GRID & SIDEBAR */
.main-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1rem;
    padding: 1rem;
    height: calc(100vh - 80px);
    overflow: hidden;
}

.sidebar {
    border-radius: 12px;
    padding: 1.5rem;
    width: 19rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-color-light);
    letter-spacing: 1.5px;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.search-container {
    position: relative;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.search-container i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--first-color);
    font-size: 1.2rem;
}

.search-container input {
    width: 100%;
    padding: 10px 10px 10px 40px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-color);
    font-family: var(--content-font);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    outline: none;
}

.search-container input:focus {
    border-color: var(--first-color);
    background: rgba(0, 0, 0, 0.5);
}

/* TREE VIEW CSS */
#section-list {
    list-style: none;
}

#section-list li {
    padding: 4px 6px;
    margin-bottom: 2px;
}

/* The clickable header for any item */
.sidebar-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-color);
    font-size: 0.95rem;
}

.sidebar-item-header:hover {
    background: rgba(255, 255, 255, 0.05);
    font-size: 1.025rem;
}

/* Active State (Applies to the LI itself) */
li.active>.sidebar-item-header {
    color: hsl(var(--first-color-hue), 100%, 83%);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 2px;
    padding: 9px 6px;
    box-shadow: 0 0 15px var(--glass-shadow);
}

/* Arrow */
.arrow-icon {
    font-size: 1.5rem;
    transition: transform 0.2s ease;
    scale: 1.6;
    border-radius: 50%;
}

.arrow-icon:hover {
    /* background: rgba(0, 0, 0, 0.3); */
    color: #fff;
}

li.open>.sidebar-item-header .arrow-icon {
    transform: rotate(90deg);
}

/* Sublists (Recursive) */
.sidebar-sublist {
    list-style: none;
    padding-left: 0;
    margin-top: 2px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* If open, give large height to allow content. Nested opens inside this allowance. */
li.open>.sidebar-sublist {
    max-height: 2000px;
}

/* Sublist Items - Indentation logic via nesting */
.sidebar-sublist li {
    margin-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-sublist li:hover {
    border-left-color: var(--first-color);
}

.sidebar-sublist li.sub-active {
    border-left-color: #000;
    color: #000;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.1);
}

/* CONTENT */
.content-area {
    border-radius: 12px;
    padding: 3rem;
    overflow-y: auto;
    position: relative;
    display: flow-root;
}

.doc-title {
    font-size: 2.8rem;
    margin-bottom: 2rem;
    color: var(--first-color);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--first-color);
    font-size: 1.6rem;
}

.subsection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.subsection-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.subsection-card:hover {
    border-color: var(--first-color);
    transform: translateY(-3px);
    scale: .95;
}

.subsection-card i {
    font-size: 1.5rem;
    color: var(--first-color);
    background: rgba(255, 255, 255, 0.05);
    padding: 8px;
    border-radius: 50%;
}

.text-block {
    font-family: var(--content-font);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 300;
}

.text-block b,
b {
    font-weight: 600;
    letter-spacing: 1px;
    color: hsl(var(--first-color-hue), 100%, 83%);
    text-decoration: underline solid .5px;
    text-underline-offset: 5px;
}

.text-block ul,
ul {
    padding-left: 20px;
    margin: 10px 0;
}

.text-block li,
li {
    list-style-type: square;
}

.note-block,
.tip-block {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.note-block {
    background: rgba(41, 121, 255, 0.1);
    border-left: 4px solid #2979ff;
}

.tip-block {
    background: rgba(0, 230, 118, 0.1);
    border-left: 4px solid #00e676;
}

.note-block i,
.tip-block i {
    color: hsl(var(--first-color-hue), 100%, 50%);
}

.code-block {
    background: #111;
    color: #00e676;
    padding: 1rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.img-wrap {
    margin: 2rem 0;
    text-align: center;
    width: 100%;
    display: block;
    overflow: hidden;
}

.img-wrap img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: opacity 0.5s ease-in-out;
}

img.lazy {
    opacity: 0;
    filter: blur(10px);
    min-height: 200px;
}

img.loaded {
    opacity: 1;
    filter: blur(0);
}

.caption {
    display: block;
    font-size: 0.85rem;
    color: var(--text-color-light);
    margin-top: 0.5rem;
    font-style: italic;
}

.img-wrap.full {
    width: 100%;
    clear: both;
}

.img-wrap.left {
    float: left;
    width: 45%;
    margin-right: 2rem;
    margin-bottom: 1rem;
}

.img-wrap.right {
    float: right;
    width: 45%;
    margin-left: 2rem;
    margin-bottom: 1rem;
}

/* Roadmap */
.roadmap-container {
    position: relative;
    padding: 20px 0;
    margin: 2rem 0;
    border-left: 3px solid rgba(255, 255, 255, 0.1);
    margin-left: 20px;
}

.roadmap-item {
    position: relative;
    margin-bottom: 1rem;
}

.roadmap-item::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 20px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--body-color);
    border: 3px solid var(--status-color);
    box-shadow: 0 0 10px var(--status-color);
    z-index: 2;
    transition: all 0.3s ease;
}

.roadmap-item:hover::before {
    transform: scale(1.25);
    background: var(--status-color);
}

.roadmap-content {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    position: relative;
    backdrop-filter: blur(5px);
    transition: 0.3s;
    border-left: 4px solid var(--status-color);
}

.roadmap-header-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.rm-version {
    font-family: var(--heading-font);
    font-size: 1.2rem;
    color: var(--status-color);
    font-weight: bold;
    margin-right: 15px;
}

.rm-date {
    font-family: var(--content-font);
    font-size: 0.85rem;
    color: var(--text-color-light);
    background: rgba(0, 0, 0, 0.3);
    padding: 3px 8px;
    border-radius: 20px;
}

.roadmap-details {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.roadmap-item.expanded .roadmap-details {
    max-height: 500px;
    opacity: 1;
}

.roadmap-item.expanded .rm-toggle-icon {
    transform: rotate(180deg);
    color: var(--first-color);
}

.rm-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.rm-features li::before {
    content: '•';
    color: var(--status-color);
    font-size: 1.2rem;
}

.status-completed {
    --status-color: #15ff00;
}

.status-in-progress {
    --status-color: #005eff;
}

.status-planned {
    --status-color: #ffea00;
}

.page-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    gap: 1rem;
    clear: both;
    width: 100%;
    position: relative;
    z-index: 10;
}

.nav-btn, #link{
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0rem 1.5rem;
    height: 5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--heading-font);
    font-size: 1rem;
    text-align: left;
    max-width: 45%;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--first-color);
    transform: translateY(-2px);
    scale: .9;
}

#link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--first-color);
    transform: translateY(-2px);
    scale: .9;
}


.nav-btn i {
    font-size: 1.5rem;
    color: var(--first-color);
}

.nav-label {
    font-size: 0.8rem;
    color: var(--text-color-light);
    display: block;
    margin-bottom: 2px;
}

.nav-title {
    color: var(--first-color);
    font-weight: bold;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-btn.next {
    margin-left: auto;
    text-align: right;
    flex-direction: row-reverse;
}

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

.lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.lightbox.active img {
    transform: scale(1);
}

#lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    user-select: none;
}

#lightbox-close:hover {
    color: var(--first-color);
    transform: scale(1.1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* MOBILE */
@media screen and (max-width: 968px) {
    .main-grid {
        grid-template-columns: 1fr;
        height: auto;
        overflow: auto;
        padding: 0.5rem;
    }

    .logo {
        display: none;
    }

    .sidebar {
        height: 200px;
        margin-bottom: 1rem;
        border: 1px solid var(--first-color);
        width: auto;
    }

    .sidebar-header {
        margin-bottom: 0;
    }

    .search-container input {
        height: 25px;
        width: 100%;
    }

    .content-area {
        height: auto;
        padding: 1.5rem;
        overflow: auto;
        margin-bottom: 3rem;
    }

    .project-grid {
        margin-top: 25rem;
    }

    .project-card {
        height: 175px;
    }

    .doc-title {
        font-size: medium;
    }

    .header-bar {
        padding: 0 1rem;
        height: 45px;
        gap: 10px;
        justify-content: center;
        padding-top: 5px;
        padding-bottom: 5px;
    }

    .img-wrap.full, .img-wrap.left, .img-wrap.right {
    width: 100%;
    clear: both;
    }

    .logo-area {
        margin-bottom: 5px;
        gap: 25px;
    }

    .icon-btn #user{
        height: 64%;
        width: 64%;
    }

    .project-select-wrapper {
        width: 50%;
        justify-content: center;
        height: 25px;
    }

    select {
        max-width: 100%;
    }

    .page-nav {
        flex-direction: column;
    }

    .search-container {
        margin-bottom: 0;
        padding-bottom: .25rem;
    }

    .nav-btn {
        width: 100%;
        max-width: 100%;
        scale: .9;
        justify-content: center;
        text-align: center;
    }

    .nav-btn:hover {
        width: 100%;
        max-width: 100%;
        scale: .75;
        justify-content: center;
        text-align: center;
    }

    .nav-btn.next {
        margin-left: 0;
        text-align: center;
    }

    .landing-header h1 {
        font-size: 2.5rem;
    }
}