@font-face {
  font-display: swap;
  font-family: "Fira Mono";
  font-style: normal;
  font-weight: 400;
  src: url("../fonts/fira-mono-v14-latin-regular.woff2") format("woff2");
}

@font-face {
  font-display: swap;
  font-family: "Fira Mono";
  font-style: normal;
  font-weight: 700;
  src: url("../fonts/fira-mono-v14-latin-700.woff2") format("woff2");
}

:root {
  --clr-primary-txt: #c9d1d9;
  --clr-primary-bg: #0d1117;
  --clr-tertiary-bg: #141a24;
  --clr-secondary-bg: #1e4273;
  --clr-border: #8090a8;
  --clr-orange: #ec8e2c;
  --clr-blue: #58a6ff;
  --clr-pink: #bc8cff;
  --clr-light-blue: #79c0ff;
}

[data-theme="light"] {
  --clr-primary-txt: #24292e;   /* Darker text for readability */
  --clr-primary-bg: #fef9ef;    /* Light background */
  --clr-tertiary-bg: #f6f8fa36;
  --clr-secondary-bg: #e1e4e8;
  --clr-border: #d1d5da;
  --clr-orange: #d73a49;
  --clr-blue: #0366d6;
  --clr-pink: #e36209;
  --clr-light-blue: #22863a;
}

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

h1 {
  font-size: 1.1rem;
  font-weight: bold;
}

h2 {
  font-size: 1rem;
  font-weight: bold;
}

a {
  cursor: pointer;
}

body {
  font-family: "Fira Mono", monospace, sans-serif;
  overflow: hidden;
  padding: 1rem;
  height: 100vh;
  width: 100%;
}

.darkmode {
  background-color: var(--clr-primary-bg);
  color: var(--clr-primary-txt);
}

*::-webkit-scrollbar {
  width: 0.4em;
  background-color: var(--clr-primary-bg);
  height: 0.2em;
}

*::-webkit-scrollbar-thumb {
  background-color: var(--clr-primary-txt);
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--clr-primary-txt) var(--clr-primary-bg);
}


div.btn-container {
  margin-top: 0.5rem;
  align-self: flex-start;
  display: table-cell;
  vertical-align: middle;
  text-align: center;
}

div.btn-container i {
  display: inline-block;
  position: relative;
  top: -9px;
}

label {
  font-size: 13px;
  color: #424242;
  font-weight: 500;
}

.btn-color-mode-switch {
  display: inline-block;
  margin: 0;
  position: relative;
}

/* --- Default (unchecked) now represents Dark Mode --- */
.btn-color-mode-switch > label.btn-color-mode-switch-inner {
  margin: 0;
  width: 140px;
  height: 30px;
  background: #383838;  /* dark background */
  border-radius: 26px;
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
  display: block;
  color: #fef9ef;         /* white text */
}

.btn-color-mode-switch > label.btn-color-mode-switch-inner:before {
  content: attr(data-off);
  position: absolute;
  font-size: 12px;
  font-weight: 500;
  top: 7px;
  left: 20px;
}

.btn-color-mode-switch > label.btn-color-mode-switch-inner:after {
  content: attr(data-on);
  width: 70px;
  height: 16px;
  background: #0d1117;
  border-radius: 26px;
  position: absolute;
  left: 68px;          /* knob on right */
  top: 2px;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0px 0px 6px -2px #111;
  padding: 5px 0;
}

/* Hide alert by default */
.btn-color-mode-switch > .alert {
  display: none;
  background: #FF9800;
  border: none;
  color: #fef9ef;
}

/* Invisible checkbox covering the switch */
.btn-color-mode-switch input[type="checkbox"] {
  cursor: pointer;
  width: 50px;
  height: 25px;
  opacity: 0;
  position: absolute;
  top: 0;
  z-index: 1;
  margin: 0;
}

/* --- Checked state now represents Light Mode --- */
.btn-color-mode-switch input[type="checkbox"]:checked + label.btn-color-mode-switch-inner {
  background: #cac9c9;  /* light background */
  color: #000000;       /* dark text */
}

.btn-color-mode-switch input[type="checkbox"]:checked + label.btn-color-mode-switch-inner:after {
  content: attr(data-off);
  left: 2px;            /* knob moves to left */
  background: #fef9ef;
}

.btn-color-mode-switch input[type="checkbox"]:checked + label.btn-color-mode-switch-inner:before {
  content: attr(data-on);
  right: 20px;          /* label moves to right */
  left: auto;
}

.btn-color-mode-switch input[type="checkbox"]:checked ~ .alert {
  display: block;
}




svg {
  overflow: visible;
}

#logo {
  width: 100%;
}

#logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 70%;
  margin-bottom: 2rem;
  min-height: 224px;
}

#main-container {
  display: flex;
  flex-direction: column;
  height: 93%;
  gap: 0.4rem;
  justify-content: flex-start;
}

#section-container {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 90%;
  gap: 0.4rem;
  margin-top: 3rem;
}


#pages {
  display: flex;
  flex-direction: row;
  gap: 0.2rem;
  justify-content: center;
  align-items: center;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 10; /* Keeps the header above other content */
  padding: 0.5rem 1rem; /* Reduce padding to make header smaller */
  height: 2rem; /* Set a fixed height to make it compact */
  display: flex;
  align-items: center; /* Vertically center content */
}

#pages .container-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  flex-wrap: wrap; 

}

#pages nav{
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  
}

#pages nav ul {

  flex: 1;
  list-style: none;
  display: flex;
  gap: 20%; /* Reduce gap between navigation items */
  margin: 0;
  padding: 0;
  justify-content: flex-end; 
  align-items: center;
}

#pages nav ul li a {
  text-decoration: none;
  font-size: 2rem; /* Reduce font size for compact header */
  color: var(--clr-primary-txt); /* Adjust color as needed */
  transition: color 0.3s;
}
#pages nav ul li a.active{
  text-decoration: underline;
}

#pages nav ul li a:hover {
  color: var(--clr-light-blue); /* Adjust hover color as needed */
}




#left-section {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 25%;
  min-width: 400px;
  /* margin-top: 4rem; This prevents overlap with the fixed header */
}


#right-section {
  display: flex;
  flex-direction: column;
  flex-grow: 2;
  width: 75%;
}

#main-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: hidden;
}

#main-content .container-content {
  overflow-y: auto;
  line-height: 1.5rem;
  gap: 1.5rem;
  padding: 2rem;
  align-items: center;
  width: calc(100% - 4rem);
  height: 95vh;
}

#footer {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  border: none;
  margin-top: 0.2rem;
  font-size: 0.8rem;
  overflow: hidden;
  min-height: 4ch;
}

#home {
  height: auto;
  padding: 0.5rem;
}

#home-section-paragraph {
  padding: 0 0.2rem;
}



.footer-item {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
}

#posts{
  height: 50%
}
.container {
  display: flex;
  flex-direction: column;
  border: 0.1px solid var(--clr-primary-txt);
  position: relative;
  padding-top: 0.4rem;
  height: 25%;
}


#left-section .container:hover:not(.selected-frame) {
  border-color: var(--clr-border);
}

.container-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.outer-paragraph-container {
  width: 100%;
}

.inner-paragraph-container {
  display: flex;
  justify-content: flex-start;
  flex-direction: column;
  gap: 1rem;
}

.image-container {
  width: 100%;
  margin: 0.5rem 0;
  display: flex;
  justify-content: center;
}

.image-inner-container {
  display: flex;
  justify-content: center;
  width: 70%;
  padding: 0.5rem;
  border: 0.1px solid var(--clr-light-blue);
}

.project-image {
  margin: 0.5rem;
  width: 100%;
  max-width: fit-content;
  background-color: var(--clr-secondary-bg);
}

pre {
  display: block;
  font-family: "Fira Mono", monospace, sans-serif;
  font-size: 0.8rem;
  line-height: 1.2rem;
  padding: 0.5rem;
  border: 0.1px solid var(--clr-light-blue);
  color: var(--clr-primary-txt);
  overflow-x: scroll;
}

.snippet-container {
  margin-top: 4rem;
}

.scrollable {
  overflow-y: auto;
}

.h-sm {
  height: 5%;
}

.h-auto {
  height: fit-content;
}

.h-fill {
  flex-grow: 1;
}

.h-full {
  height: 100%;
}

.mt-4 {
  margin-top: 2rem 4rem;
}

.decorating-text {
  position: absolute;
  padding: 0 0.75rem;
  width: fit-content;
}

.decorating-text p {
  position: relative;
  z-index: 2;
}

.decorating-text div {
  position: relative;
  z-index: 1;
  background-color: var(--clr-primary-bg);

  height: 0.5ch;
  top: -1ch;
  left: -2px;
  width: 104%;
}

.title {
  top: -12px;
}

.title p {
  color: var(--clr-orange);
}

.list-index {
  bottom: -12px;
  align-self: flex-end;
}

.ui-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 99%;
  padding: 0.2rem;
  overflow-y: auto;
  overflow-x: hidden;
}

#posts .ui-list,
#experience .ui-list {
  justify-content: space-between;
}

#posts .ui-list div,
#experience .ui-list div {
  width: 100%;
  text-wrap: balance;
}

#posts .ui-list div div,
#experience .ui-list div div {
  justify-content: flex-start;
  gap: 1rem;
}

#posts .ui-list .topic{
  width: 50%;
}

#experience .ui-list .topic{
  width: 60%;
}

#posts .ui-list .place{
  width: 50%;
}

#experience .ui-list .place{
  width: 40%;
}


.ui-list div {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.ui-list img {
  width: 1rem;
  height: 1rem;
}

.ui-list div:hover:not(.selected-item):not(.selected-item > div) {
  background-color: var(--clr-tertiary-bg);
}

.selected-frame {
  border-color: var(--clr-light-blue);
}

.selected-frame .decorating-text {
  color: var(--clr-light-blue);
}

.selected-frame .container-content {
  scrollbar-color: var(--clr-light-blue) var(--clr-primary-bg);
}

div.selected-frame > ::-webkit-scrollbar-thumb {
  background-color: var(--clr-light-blue);
}

.selected-item,
.selected-item div {
  background-color: var(--clr-secondary-bg);
}

.text-orange {
  color: var(--clr-orange);
}

.text-blue {
  color: var(--clr-blue);
}

.text-pink {
  color: var(--clr-pink);
}

.page-selected{
  color: var(--clr-light-blue);
}



.text-xs {
  font-size: 0.6rem;
}

.reference {
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--clr-blue);
}

.technologies-row {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.buttons-container {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  margin: 1rem 0;
}

.project-button {
  all: unset;
  padding: 0.5rem 1rem;
  border: 0.1px solid var(--clr-primary-txt);
  color: var(--clr-primary-txt);
  cursor: pointer;
  min-width: 150px;
  text-align: center;
  font-size: 1.5rem;
}

.project-button:hover {
  background-color: var(--clr-secondary-bg);
}

.project-button:active {
  opacity: 0.5;
}

.noscript-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 25%;
  gap: 0.5rem;
  padding: 1rem;
  width: 100%;
}

.nav-container {
  display: none;
}

#modal-controls {
  display: none;
}

#mobile-help {
  display: none;
}

@media screen and (max-width: 768px) {
  body {
    height: 100%;
    padding: 2vw;
    margin-top: 100px;
    overflow-y: scroll !important;
    overflow-x: hidden;
  }

  #experience .ui-list div {
    align-items: center;
  }

  #main-container div div nav ul li a{
    font-size: 2rem;
  }

  #main-container div div nav ul li a.active{

    text-decoration: underline;
  }
  

  .buttons-container {
    flex-direction: column;
  }

  .project-button {
    padding: 1rem 0;
  }

  .image-inner-container {
    width: 100%;
  }

  #main-container {
    height: 100%;
  }

  #section-container {
    flex-direction: column;
    gap: 1rem;
  }

  #left-section {
    display: none;
  }

  #right-section {
    width: 100%;
    height: 100%;
    padding-top: 1rem;
  }

  #main-content {
    font-size: 1.2rem;
  }

  .outer-paragraph-container {
    padding: 0 5%;
  }

  #mobile-help {
    margin-top: 1rem;
    font-size: 1.1rem;
    display: block;
  }

  #desktop-help {
    display: none;
  }

  #main-content .container-content {
    height: 100%;
  }

  .container {
    height: fit-content !important;
  }

  .ui-list {
    font-size: 1.2rem;
    gap: 0;
    width: auto;
  }

  .ui-list div {
    padding: 0.5rem;
  }

  #experience .ui-list div {
    width: auto;
  }

  #logo-container {
    width: 90%;
    min-height: 50px;
  }



  #footer {
    margin: 1rem 0;
    justify-content: center;
    font-size: 1rem;
  }

  .footer-item {
    gap: 1rem;
  }

  #footer-help {
    display: none;
  }

  /* Hide the desktop header on mobile */
  #pages {
    display: none;
  }

  /* NAVBAR */
  .nav-container {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    justify-content: space-around;
    align-items: center;
    padding: 0 5vw;
    width: 100vw;
    height: 110px;
    background-color: var(--clr-primary-bg);
    opacity: 0.9;
    z-index: 98;
  }

  /* Hide logo container on mobile */
  #logo-container {
    display: none;
  }

  .nav-container img {
    position: relative;
    bottom: 5px;
    width: 70%;
  }

  /* --- Mobile Navigation Toggle --- */
  /* Hide the actual checkbox */
  .nav-container .checkbox {
    display: none;
  }

  /* Hamburger menu (using a label for the checkbox) */
  #hamburger-menu {
    cursor: pointer;
    position: relative;
    left: -16px;
    width: 32px;
    z-index: 101;
  }

  /* Hamburger lines styling */
  #hamburger-menu .hamburger-lines {
    height: 26px;
    width: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  #hamburger-menu .hamburger-lines .line {
    display: block;
    height: 4px;
    width: 100%;
    background-color: var(--clr-primary-txt);
    transition: all 0.2s ease-in-out;
  }

  /* Animate hamburger lines when toggled */
  #menu-toggle:checked + label#hamburger-menu .hamburger-lines .line.line1 {
    transform: rotate(45deg) translate(5px, 5px);
  }

  #menu-toggle:checked + label#hamburger-menu .hamburger-lines .line.line2 {
    opacity: 0;
  }

  #menu-toggle:checked + label#hamburger-menu .hamburger-lines .line.line3 {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  /* Mobile menu (navigation links) – note that your HTML should include 
     the mobile menu container with classes "container-content mobile-menu" 
     placed after the hamburger label */
  .mobile-menu {
    display: none;
    width: 100%;
    background-color: var(--clr-primary-bg);
    position: absolute;
    top: 110px; /* Adjust if needed so it sits below the navbar */
    left: 0;
    padding: 1rem 0;
    text-align: center;
    z-index: 100;
  }

  /* Show the mobile menu when the checkbox is checked */
  #menu-toggle:checked ~ .mobile-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  /* Mobile menu navigation links styling */
  .mobile-menu nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .mobile-menu nav ul li {
    margin: 0.5rem 0;
  }

  .mobile-menu nav ul li a {
    text-decoration: none;
    font-size: 1.2rem;
    color: var(--clr-primary-txt);
  }

  /* Retain any additional rules */
  #left-section {
    transform: translate(150%);
    width: 97vw;
    display: flex;
    position: fixed;
    left: 1.5vw;
    transition: transform 0.5s ease-in-out;
    z-index: 99;
    background-color: var(--clr-primary-bg);
  }



  .menu-open {
    transform: translate(0) !important;
    position: absolute !important;
    margin-top: 6em;
  }

  .menu-open + #right-section {
    display: none;
  }

  footer.menu-open   {
    display: none !important;
  }

  .nav-container input[type=checkbox]:checked~.hamburger-lines .line1 {
    transform: rotate(45deg)
  }

  .nav-container input[type=checkbox]:checked~.hamburger-lines .line2 {
      transform: scaleY(0)
  }

  .nav-container input[type=checkbox]:checked~.hamburger-lines .line3 {
      transform: rotate(-45deg)
  }

  #skills {
    flex-grow: 1;
  }
}


@media (prefers-color-scheme: light) {
  :root {
    --clr-primary-txt: #24292e;   /* Darker text for readability */
    --clr-primary-bg: #ffffff;    /* Light background */
    --clr-tertiary-bg: #f6f8fa;
    --clr-secondary-bg: #e1e4e8;
    --clr-border: #d1d5da;
    --clr-orange: #d73a49;
    --clr-blue: #0366d6;
    --clr-pink: #e36209;
    --clr-light-blue: #22863a;
  }
}