* {
    box-sizing: border-box;
}

::-moz-selection { 
  color: #041421;
  background: #d0d6d6;
}

::selection {
  color: #041421;
  background: #d0d6d6;
}

body {
    background-color: rgb(39, 39, 39);
    margin:0px;
    padding: 0px;
}

#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    background-color: #041421;
    /* Performance optimizations */
    will-change: auto;
    transform: translateZ(0);
    pointer-events: none; /* Improve interaction performance */
}

p, figcaption, li{
    font-size: 16px;
    font-family: "Roboto", 'Courier-new', monospace;
    font-weight: 300;
    font-style: thin;
    color: #d0d6d6;
}

li {
    margin: 5px 0;
}

.flex {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.links:link, .links:visited, .links:active {
    font-family: "Roboto", 'Courier-new', monospace;
    font-weight: 300;
    font-style: thin;
    color: white;
    font-size: 18px;
    text-decoration: none;
    transition: color 0.5s ease, background 0.5s ease;
}
.links:hover{
    color: transparent;
    background: linear-gradient(to left, #041421, #042630, #4c7273, #86b9b0, #d0d6d6, #86b9b0, #4c7273, #042630, #041421);
    -webkit-background-clip: text;
    background-clip:text;
    animation: slide 4s linear infinite;
    -webkit-background-size: 200%;
    background-size:200%;
}

.icon {
    width: 20px;
    margin: -5px 5px -5px 5px;
    filter:invert()
}

h1, h2, h3, h4, h5, h6 { 
    color: #d0d6d6;
    font-optical-sizing: auto;
    font-family: "JetBrains Mono", 'Courier-new', monospace;
    font-weight: 300;
    font-style: thin;
    margin:0 0 10px 0;
}

.large-header {
    font-size: 60px;
}

.medium-header {
    font-size: 50px;
}

.small-header {
    font-size: 40px;
}

hr {
    margin: 10px auto;
    width: 90%;
    height: 2px;
    border: none;
    background: linear-gradient(to left, #041421, #042630, #4c7273, #86b9b0, #d0d6d6, #86b9b0, #4c7273, #042630, #041421);
    background-size: 200% auto;
    animation: slide 4s linear infinite;
}

@keyframes hue-rotate {
    from {
        filter: hue-rotate(0deg);
    }
    to {
        filter: hue-rotate(360deg);
    }
}

@keyframes slide {
    from {
        background-position: 100% 0;
    }
    to {
        background-position: -100% 0;
    }
}

.footer {
    font-size:10px;
}

.bio {
    text-align: center;
    letter-spacing: 0.8px;
}

.thin {
    width: 250px;
}

.thick {
    width: 400px;
}

.aboutme {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

@keyframes slide-in {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(0%);
    }
}

@keyframes slide-out {
    0% {
        transform: translateY(0%);
    }
    100% {
        transform: translateY(-100%);
    }
}

.content {
    width: 80%;
    margin: 0 auto 0 auto;
    padding: 20px 20px 0 20px;
    max-width:900px;
    background-color: #061f33;
    border-radius: 20px;
    min-height:500px;
    max-height: 97vh;
    border: 1px dashed #d0d6d6;
    border-top: none;
    border-radius: 0 0 10px 10px;
    color: #d0d6d6;
    float: top;
    position: relative;
    overflow: auto;
    animation: slide-in 0.9s cubic-bezier(0, 0, 0.48, 1) forwards;
    scrollbar-width: thin;
    scrollbar-color: #d0d6d6 transparent;
}

.align-center {
    text-align: center;
}

.profilepic {
    border-radius:40px;
    border: 2px solid #d0d6d6;
}

.mainimg {
    width: 300px;
}

.projectimg {
    height: 250px;
    width: 250px;
    object-fit:cover;
}

.projectimgWide {
    height: 260px;
    width: 400px;
}

.projectcard {
    display: grid;
    border-radius: 1rem;
    overflow: hidden;
    cursor: pointer;
    width: 250px;
    height: 250px;
    margin: auto;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), top 0.4s cubic-bezier(0.4, 0, 0.2, 1), left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#projectlink {
    width: 250px;
    height: 250px;
    margin: auto;
}

.projectcard > * {
  grid-area: 1/1;
  transition: .2s;
}

.projectcard figcaption {
    display: grid;
    align-items: end;
    font-family: sans-serif;
    font-size: 1.5rem;
    font-weight: bold;
    color: #d0d6d6;
    padding: .75rem;
    background: var(--c,#0009);
    clip-path: inset(0 var(--_i,100%) 0 0);
    -webkit-mask:
        linear-gradient(#000 0 0),
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    -webkit-mask-clip: text, padding-box;
    
}

@supports not (-webkit-mask-clip: text) {
  .projectcard figcaption {
   mask: none;
   color: #fff;
  }
}

.projectcard:hover figcaption{
  --_i: 0%;
  -webkit-mask: none;
  mask: none;
  color: #d0d6d6;
}

.projectcard:hover img {
  transform: scale(1.2);
}

.projecttab {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin: auto;
    width: 100%;
}

.back-button {
    position: fixed;
    top: 20px;
    background-color: #061f33;
    color: #d0d6d6;
    border: 1px dashed #d0d6d6;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-family: "Roboto", 'Courier-new', monospace;
    font-weight: 300;
    font-size: 16px;
    z-index: 1000;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.back-button:hover {
    background-color: #0c3f68;
    color: #ffffff;
}

/* Media query for when screen is too narrow */
@media screen and (max-width: 1200px) {
    .back-button {
        position: fixed;
        left: 20px;
        right: auto;
    }
}

.in-project-button {
    position: static; 
    top: 20px;
    background-color: #061f33;
    color: #d0d6d6;
    padding: 20px 20px;
    cursor: pointer;
    font-family: "Roboto", 'Courier-new', monospace;
    font-weight: 300;
    font-size: 16px;
    transition: all 0.3s ease;
    white-space: normal;
    width: 100%;
    text-decoration:none;
    z-index: 10000;
}

.in-project-button:hover {
    background-color: #0c3f68;
    color: #ffffff;
    border-color: #ffffff;
}

.project-panel {
    position: fixed;
    background-color: #061f33;
    border: 1px dashed #d0d6d6;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    text-align: center;
    transition: opacity 0.2s ease;
    scrollbar-width: thin;
    scrollbar-color: #d0d6d6 transparent;
}

.panel-toggle {
    background-color: #061f33;
    color: #ffffff;
    border: none;
    padding: 8px;
    border-radius: 5px;
    cursor: pointer;
    font-family: "Roboto", 'Courier-new', monospace;
    font-weight: 300;
    font-size: 16px;
    width: 100%;
    transition: background-color 0.3s ease;
    z-index: 10001;
}

.panel-toggle:hover {
    background-color: #0c3f68;
}

.project-panel.collapsed .in-project-button {
    height: 0;
    padding: 0;
    opacity: 0;
}

.code-box {
    border: 1px solid #d0d6d6;
    border-radius: 5px;
    background-color: #041421;
    margin: 20px 0;
    width: 100%;
    overflow: hidden;
    font-family: "Roboto", 'Courier-new', monospace;
}
.code-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    background-color: #061f33;
    padding: 8px 12px;
    border-bottom: 1px solid #d0d6d6;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.code-header button, .code-header a {
    margin-left: 8px;
    padding: 4px 10px;
    background-color: #061f33;
    color: #d6d6d6;
    border: 1px solid #0c3f68;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
}

.code-header button:hover, .code-header a:hover {
    background-color: #0c3f68;
    color: #ffffff;
}

.code-header button::before, .code-header a::before {
    text-align: center;
    font-size: 16px;
}

.copy-btn::before {
    content: ''; /* placeholder for icon later */
}

.raw-btn::before {
    content: ''; /* placeholder for icon later */
}

.download-link::before {
    content: ''; /* placeholder for icon later */
}

.code-box pre {
    margin: 0;
    overflow: auto;
    max-height: 700px;
    padding: 0px 4px;
    font-size: 14px;
    line-height: 1.5;
}

.code-box code {
    background: none !important;
}

/* Line numbers styles (from plugin) */
.hljs-ln {
    border-collapse: collapse;
    width: 100%;
    border-spacing: 0;
}

.hljs-ln td {
    padding: 0;
}

.hljs-ln-numbers {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    text-align: right; 
    color: #d0d6d6; 
    opacity: 0.5;
    vertical-align: top;
    padding: 0 8px 0 0 !important; 
    width: 1%;
    white-space: nowrap;
}

.hljs-ln-code {
    padding-left: 12px !important;
}

.hljs-ln-line {
    padding-top: 0;
    padding-bottom: 0;
}

.file-selector {
    display: flex;
    justify-content: flex-start;
    background: transparent;
    padding: 0;
    border-bottom: none;
    margin-right: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}
.file-selector button {
    margin-right: 8px;
    padding: 4px 10px;
    background-color: #061f33;
    color: #d0d6d6;
    border: 1px solid #0c3f68;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.file-selector button:hover {
    background-color: #0c3f68;
    color: #ffffff;
}
.file-selector button.active {
    background-color: #0c3f68;
    color: #ffffff;
}
.tool-buttons {
    display: flex;
    margin-right: 0;
    margin-left: auto;
}

/* Click animation */
@keyframes toc-click-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 6px rgba(134, 185, 176, 0.6);
    }
    50% {
        transform: scale(1.5);
        box-shadow: 0 0 12px rgba(134, 185, 176, 0.8);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 6px rgba(134, 185, 176, 0.6);
    }
}

.page {
    display: flex;
    flex-direction: row;
    align-items:center;
    justify-content: center;
    height: 100%;
}

.progress-bar {
    position: fixed;
    height: 70vh;
    background: #061f33;
    width: 3px;
    top: 10%;
    right: auto;
    opacity: 0;
    border-radius: 2px;
    transition: opacity 0.2s ease;
}

.progress {
    background: #0c3f68;
    height: 0%;
    width: 100%;
    border-radius: 2px;
}

.marker {
    position: absolute;
    left: -3.5px;
    right: 0;
    height: 10px;
    width: 10px;
    border-radius: 50%;
    background: #d0d6d6;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.marker-label {
    position: fixed;
    font-size: 16px;
    font-family: "Roboto", 'Courier-new', monospace;
    font-weight: 300;
    font-style: thin;
    color: #d0d6d6;
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 4px;
    border-radius: 4px;
    white-space: nowrap;
    margin-left: 10px;
    opacity: 0;
    transition: opacity 0.2s ease;
    user-select: none;
}

.active-heading {
    transform: scale(1.5);
}