@font-face {
font-family: 'Manga Temple';
src: url('/assets/fonts/manga_temple/mangat.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}

@font-face {
font-family: 'JB';
src: url('/assets/fonts/JetBrainsMonoNerdFont-Regular.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}

:root{
--main-bg-color: #141221;
--main-color: #fd77d7;

--caret-color: #dde5ed;
--text-color: #dde5ed;


--sub-color: #676e8a;
--sub-alt-color: #1e1d2f;

--manga-font: 'Manga Temple', sans-serif;
--JB-font   : 'JB';
--glide: linear(0, 0.012 0.9%, 0.049 2%, 0.409 9.3%, 0.513 11.9%, 0.606 14.7%, 0.691 17.9%, 0.762 21.3%, 0.82 25%, 0.868 29.1%, 0.907 33.6%, 0.937 38.7%, 0.976 51.3%, 0.994 68.8%, 1)
}

/* Global Styles */
body {
background-color: var(--main-bg-color);
color: #e0e0e0;
font-family: var(--JB-font);
margin: 0 auto;
padding: 0;
max-width: 1200px;

display:flex;
justify-content: space-between;
align-items:flex-start;
align-content: center;

flex-direction: column;  
min-height: 0;
}

header{
position: sticky;
width: max-content;
/* height: 40px; */
background: inherit;
top: 0px;
z-index: 1000;
/* text-align: center; */

font-size: 1.5rem;
font-family: var(--manga-font);
color: var(--caret-color);
text-decoration: none;
font-weight: bold;
}

.sticky-title {
    position: sticky;
    top: 0;
    background-color: var(--main-bg-color);
    z-index: 100;
    padding-top: 2%;
    padding-bottom: 1%;
    }
  

/* Container for Sidebar and Main Content */
.container {
position: relative;
/* border: 2px solid red; */
display: flex;
flex-grow: 1;
justify-content: space-between;
align-items:normal;
align-content: center;

width: 1200px;
margin: 0 auto;
padding: 20px;
gap: 50px;
}

/* Shared Sidebar Styles */
.sidebar, .sub-sidebar {
font-family: var(--JB-font);
color: var(--caret-color);
width: 100px; /* Adjust width as needed */
position: sticky;
top: 150px; /* Adjust top position as needed */
align-self: flex-start;
text-align: left;
}

.sidebar h2, .sub-sidebar h2 {
margin-bottom: 10px;
color: #fff;
}

.sidebar ul, .sub-sidebar ul {
list-style: none;
padding: 0;
font-size: 1.2rem;
font-weight: 200;
}

.sidebar a, .sub-sidebar a {
color: #ffffff;
text-decoration: none;
display: block;
padding: 8px 0;
transition: color 0.3s ease;
}

.sidebar a:hover, .sub-sidebar a:hover {
color: #fff;
}

/* Base state for all links */
.sidebar li,
.sub-sidebar li {
transition: 
transform 0.3s var(--glide),
opacity 0.3s var(--glide);
}


.sidebar a.active,
.sub-sidebar a.active {
color: var(--main-color);
position: relative;
transform: scale(1.1);
}

.sidebar a.active::before,
.sub-sidebar a.active::before {
content: ">";
position: absolute;
left: -20px;
color: var(--main-color);
} 

.sidebar ul:has(.active) li:not(:has(.active)),
.sub-sidebar ul:has(.active) li:not(:has(.active)) {
opacity: 0.25;
transform: scale(0.8);
}

.sidebar ul:has(.active) li:not(:has(.active)):hover,
.sub-sidebar ul:has(.active) li:not(:has(.active)):hover {
opacity: 1;
transform: scale(1);
} 

@media (hover) and (prefers-reduced-motion: no-preference) {
.sidebar ul > li, .sub-sidebar ul > li {
    transform-origin: left center;
    transition: 
        transform .3s var(--glide),
        opacity .3s var(--glide);
}

.sidebar ul:hover > li:not(:hover), .sub-sidebar ul:hover > li:not(:hover) {
    opacity: .25;
    transform: scale(0.8);
}
}

@layer support.demo {
* {
    box-sizing: border-box;
    margin: 0;
}

html {
    block-size: 100%;
    color-scheme: dark light;
}

body {
    min-block-size: 100%;
    font-family: system-ui, sans-serif;
    display: grid;
    place-content: center;
}
}

/* Responsive Design */
@media (max-width: 768px) {
header{
    position: static;
}
.sticky-title{
    position: static;
}
.container {
    flex-direction: column;
}

.sidebar {
    width: 100%;
    position: static;
    top: auto;
    align-items: center;
}

.main-content {
    max-width: 100%;
}
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        width: 100%;
        padding: 10px;
        gap: 20px;
    }

    .sidebar, .sub-sidebar {
        width: 100%;
        position: static;
        top: auto;
        text-align: center;
    }

    .sidebar ul, .sub-sidebar ul {
        font-size: 1rem;
    }

    .sidebar h2, .sub-sidebar h2 {
        font-size: 1.5rem;
    }

    .main-content {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    header {
        font-size: 1.2rem;
    }

    .sidebar ul, .sub-sidebar ul {
        font-size: 0.9rem;
    }

    .sidebar h2, .sub-sidebar h2 {
        font-size: 1.3rem;
    }

    .container {
        padding: 5px;
        gap: 10px;
    }
}

footer {
align-self: center;
text-align: center;
margin-top: auto;
padding: 20px;
font-size: 0.9rem;
color: var(--footer-text);
}



/* /////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////
///////// CODE BLOCK CONTAINER
///////////////////////////////////////////////////////////// 
///////////////////////////////////////////////////////////// */

.code-container {
position: relative;
background: rgba(0, 0, 0, 0.8); 
border-radius: 12px;
padding: 16px;
overflow: hidden;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
margin: 20px 0;
border-left: 5px solid #ffffff; /* Accent border */
backdrop-filter: blur(10px); /* Glass effect */
transition: all 0.3s ease-in-out;
}

/* Code Styling */
.code-container pre {

white-space: pre;
word-break: normal;
text-align: left;
overflow-x: auto;

background: none;
color: var(--card-text, #333);
font-family: 'JetBrains Mono', monospace;
font-size: 0.95rem;
line-height: 1.7;
white-space: pre-wrap; /* Ensures wrapping on small screens */
overflow-x: auto;
padding-right: 50px; /* Space for copy button */
transition: all 0.3s ease-in-out;
}

.code-container pre code {
display: block;
/* margin: 0; */
padding: 10px;
}

/* Scrollbar for Code Blocks */
.code-container pre::-webkit-scrollbar {
width: 10px;
height: 10px;
}

.code-container pre::-webkit-scrollbar-thumb {
background: rgba(138, 43, 226, 0.8); /* Purple */
border-radius: 5px;
}

.code-container pre::-webkit-scrollbar-track {
background: rgba(72, 61, 139, 0.2);
}

/* Copy Button */
.copy-btn {
position: absolute;
top: 12px;
right: 12px;
background: var(--accent-color); /* Purple */
color: white;
border: none;
padding: 7px 14px;
font-size: 0.85rem;
cursor: pointer;
border-radius: 6px;
transition: all 0.3s ease;
}

.copy-btn:hover {
background: #6a1bbd;
}

.copy-btn:active {
background: #4e1289;
}

/* Copy Tooltip */
.copy-btn::after {
content: "Copy";
position: absolute;
bottom: -26px;
left: 50%;
transform: translateX(-50%);
background: rgba(0, 0, 0, 0.8);
color: white;
padding: 5px 10px;
font-size: 0.75rem;
border-radius: 5px;
opacity: 0;
transition: opacity 0.2s ease;
pointer-events: none;
}

.copy-btn:hover::after {
opacity: 1;
}

/* Show "Copied!" Message */
.copy-btn.copied::after {
content: "Copied!";
background: #28a745;
}