/* Visual Effects and CSS code managed by human helloworld07080910@gmail.com */
/* CSS written by NightCat tirednightcat@gmail.com */

:root {
    --bg-color: #2a2a2a;
    --text-color: white;
    --h2-color: #4e86ef;
    --sidebar-bg: #1a1a1a;
    --hover-bg: #3a3a3a;
    --active-bg: #4a4a4a;
}

.content {
    margin-left: 300px; /* Match sidebar width exactly */
    padding: 40px;
    width: calc(100% - 300px);
    transition: 
    margin-left 0.3s ease, 
    width 0.3s ease; /* Add width transition */
}

.content[move-left="yes"] {
    margin-left: 0;
    width: calc(100% - 0px); /* More precise calculation */
}

body[data-theme="light"] {
    /* --bg-color: #ffffe0; */
    /* --bg-color: #dcf9f1; */
    --bg-color: #dcf9f4;
    --text-color: #000000;
    --h2-color: #095cf4;
    --sidebar-bg: #cfd8ff;
    --hover-bg: #e0e0e0;
    --active-bg: #d0d0d0;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    font-family: 'Cascadia Code', monospace;
    color: var(--text-color);
    display: flex;
    transition: background-color 0.3s, color 0.3s;
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    background-color: var(--active-bg);
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.2em;
    z-index: 1000;
}

.theme-toggle:hover {
    background-color: var(--hover-bg);
}

.sidebar-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    background-color: var(--active-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: left 0.3s ease;
    font-size: 0.7em;
    z-index: 1001;
    height: 25px;
}

.sidebar-toggle:hover {
    background-color: var(--hover-bg);
}

.sidebar {
    height: 100vh;
    background-color: var(--sidebar-bg);
    padding: 20px;
    overflow-x: hidden;
    overflow-y: auto;
    position: fixed;
    width: 300px;
    transition: transform 0.3s ease;
    box-sizing: border-box;
    top: 0;
    left: 0;
}

.sidebar[collapsed='yes'] {
    transform: translateX(-100%);
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.sidebar li {
    margin-bottom: 15px;
}

.sidebar-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.sidebar-title {
    color:var(--text-color);
}

.checkbox-container {
    display: inline-flex;
    vertical-align: middle;
    position: relative;
    cursor: pointer;
    margin-left: 4px;
    margin-top: 4px;
}

.sidebar > .sidebar-inner {
    padding-bottom: 20px; 
}

.sidebar-inner {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    display: block;
    position: relative;
    height: 16px;
    width: 16px;
    background-color: #808080;
    border: 2px solid #767676; 
    border-radius: 3px;
    transition: all 0.2s;
}

span.checkmark {
    display: inline-block;
    height: 16px;
    width: 16px;
}

.checkbox-container:hover input ~ .checkmark,
.checkbox-container input:checked ~ .checkmark {
    width: 16px;
    height: 16px; 
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;  
    top: 2px;   
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
    display: inline-block;
}

.sidebar[collapsed = 'yes'] {
    transition: transform 0.3s ease;
    transform: translateX(-100%);
}

.sidebar a {
    color: var(--text-color);
    text-decoration: none;
    padding: 10px;
    display: inline-block;
    border-radius: 5px;
    transition: background-color 0.3s;
    flex-grow: 1;
}

.sidebar a:hover {
    background-color: #767676;
}

.sidebar a.active {
    background-color: #9c9c9c;
    font-weight: bold;
}

.content {
    margin-left: 20px;
    padding: 40px;
    width: calc(100% - 290px);
}

.content[move-left="yes"] {
    margin-left: 20px;
    width : 100%;
}

.content-item {
    display: none;
}


.content-item.active {
    display: block;
}

.content-item > ul {
    margin-bottom: 40px;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
}

h2 {
    color: var(--h2-color);
}

p {
    font-size: 1.2em;
    line-height: 1.6;
}

a {
    font-size: 20px;
    line-height: 1.6;
    color: rgba(99, 99, 255, 0.885);
    display: block; 
    margin-top: 10px; 
    margin-bottom: 20px; 
    width: fit-content;
}

.sidebar li > small {
    margin-top: 4px;
    margin-right: 8px;
    display: inline-block;
    vertical-align: middle;
}

li{
    margin-bottom: 20px
}

.unit-header {
    cursor: pointer;
    padding: 10px;
    background-color: #5a5a5a7e;
    border-radius: 5px;
    margin-bottom: 5px;
    font-weight: bold;
    transition: background-color 0.2s ease;
    overflow: hidden;
    margin-bottom: 0;
}

.unit-header:hover {
    background-color: #7676767e;
}

.unit-header::before {
    content: '▼';
    display: inline-block;
    transition: transform 0.3s ease;
    transform-origin: center;
    margin-right: 8px;
    width: 15px;
    max-height: 1000px;
}

.unit-header.collapsed::before {
    transform: rotate(-90deg);
}

.unit-content {
    margin-left: 20px;
    padding-left: 10px;
    overflow: hidden;
    transition: 
        max-height 0.3s ease-in-out,
        opacity 0.2s ease-in-out;
    max-height: 100vh;
    opacity: 1;
    border-left: 2px solid var(--hover-bg);
}

.collapsed + .unit-content {
    max-height: 0;
    opacity: 0;
}

