/*

  Steve, I beg of you - leave the CSS alone. 

  Everything looks good. 

*/

:root {
/* These are defaults that are overridden by the theme-selector JS
  - there are other classes near the bottom of the file called
  ".dark-mode" and ".light-mode" that normally set the theme. */
  --primary-color: rgb(50 205 50);
  --secondary-color: rgb(205, 50, 197);
  --bg-main: rgb(0, 0, 0);
  --bg-alt: rgb(70, 70, 70);
  --bg-alt-alt: rgb(90, 90, 90);
  --text-light: rgb(255, 255, 255);
  --alt-color: rgb(255, 255, 0);
  --gray: rgb(110, 110, 110);
  --hint-gradient-bg: ellipse at left center,
    rgba(26, 26, 26, 1) 0%,
    rgba(26, 26, 26, 0.8) 30%,
    rgba(26, 26, 26, 0) 70%;

  --kbd-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2), 0 2px 0 0 rgba(255, 255, 255, 0.7) inset;
  --code-runner: repeating-linear-gradient(to right,
      transparent,
      rgb(205, 50, 197) 10%,
      transparent);
  --hint-bar-gradient: linear-gradient(transparent 0%,
      rgb(205, 50, 197) 50%,
      transparent 100%);
  --bg-code: rgb(30, 30, 30);
  --text-code-header: rgb(255, 255, 255);
}

.dark-mode {
  --primary-color: rgb(50 205 50);
  --secondary-color: rgb(205, 50, 197);
  --bg-main: rgb(0, 0, 0);
  --bg-alt: rgb(70, 70, 70);
  --bg-alt-alt: rgb(90, 90, 90);
  --text-light: rgb(255, 255, 255);
  --alt-color: rgb(255, 255, 0);
  --gray: rgb(110, 110, 110);
  --hint-gradient-bg: ellipse at left center,
    rgba(26, 26, 26, 1) 0%,
    rgba(26, 26, 26, 0.8) 30%,
    rgba(26, 26, 26, 0) 70%;

  --kbd-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2), 0 2px 0 0 rgba(255, 255, 255, 0.7) inset;
  --code-runner: repeating-linear-gradient(to right,
      transparent,
      rgb(205, 50, 197) 10%,
      transparent);
  --hint-bar-gradient: linear-gradient(transparent 0%,
      rgb(205, 50, 197) 50%,
      transparent 100%);
  --bg-code: rgb(30, 30, 30);
  --text-code-header: rgb(255, 255, 255);
}

/* Light mode class - matches your default scheme */
.light-mode {
  --primary-color: rgb(30, 144, 255);
  --secondary-color: rgb(255, 141, 30, 1);
  --bg-main: rgb(255, 255, 255);
  --bg-alt: rgb(230, 230, 230);
  --bg-alt-alt: rgb(200, 200, 200);
  --text-light: rgb(0, 0, 0);
  --alt-color: rgb(205, 50, 197);
  --gray: rgb(110, 110, 110);
  --hint-gradient-bg: ellipse at left center,
    rgba(226, 226, 226, 1) 0%,
    rgba(226, 226, 226, 0.8) 30%,
    rgba(226, 226, 226, 0) 70%;
  --code-runner: repeating-linear-gradient(to right,
      transparent,
      rgb(255, 141, 30, 1) 10%,
      transparent);
  --hint-bar-gradient: linear-gradient(transparent 0%,
      rgb(255, 141, 30, 1) 50%,
      transparent 100%);
  --bg-code: rgb(225, 225, 225);
  --text-code-header: rgb(0, 0, 0);
}


html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-main);
  font-family: 'Cantarell', sans-serif;
  color: var(--text-light);
  line-height: 1.6em;
  transition: all 0.3s ease;
}

img {
  max-width: 100%;
}

a,
a:active,
a:link,
a:visited {
  font-weight: 500;
  color: var(--primary-color);
  text-decoration: underline dotted;
  background-color: var(--bg-alt);
  padding: 5px;
  margin-top: 3px;
  margin-bottom: 3px;
  border-radius: 8px;
}


a:hover {
  color: var(--alt-color) !important;
  text-decoration: underline dotted;
  background-color: var(--bg-alt-alt);
}

.wip {
  cursor: not-allowed !important;
  color: var(--gray);
}

.wip::before {
  content: "(WIP) ";
  color: var(--alt-color);
}

.site-header {
  display: flex;
  align-items: center;
  gap: .5em;
  /* Space between SVG and text */
}

.header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 0;
  flex-wrap: nowrap;
  /* Prevents unwanted wrapping */
}

.svg-logo {
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.logoBorder {
  box-shadow: 0 0 10px white;

}

.header-text {
  font-weight: 900;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: auto;
  width: 100%;
}


.header-title {
  font-size: clamp(1.5em, 2.25em, 4vw);
  margin: 0;
  line-height: 1.2;
  white-space: nowrap;
}

.header-subtitle {
  font-size: clamp(0.9em, 1.25em, 3vw);
  margin: 0;
  color: var(--bg-main);
  background-color: var(--primary-color);
  padding: 3px;
  border-radius: 8px;
  white-space: nowrap;
  position: relative;
  width: calc(100% - 0.26em);
}

.header-subtitle.typing-in-progress .cursor {
  animation: blink 1s step-end infinite;
  margin-left: 1px;
  color: var(--bg-main);
}

.header-subtitle.typing-complete::after {
  content: "█";
  animation: blink 1s step-end infinite;
  margin-left: 4px;
  color: var(--bg-main);
  vertical-align: top;
}

.home-link {
  background: none !important;
  border: none !important;
  outline: none !important;
}

h2 {
  color: var(--primary-color);
  font-size: 2em;
  font-weight: 900;
  position: relative;
  display: inline-block;
  width: 100%;
  margin-bottom: 1px;
}

h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.3em;
  width: 100%;
  height: 0.1em;
  background: var(--code-runner) !important;
}

h3 {
  font-family: 'JetBrains Mono', Courier, monospace;
  font-weight: 900;

  background-color: var(--bg-code);
  color: var(--text-code-header);
  padding-right: 10px;
  padding-left: 10px;
  padding-top: 15px;
  padding-bottom: 5px;
  margin-bottom: -3px;
  border-radius: 8px 8px 0 0;
  position: relative;
  display: inline-block;
  border-top: 3px solid var(--primary-color);
  border-left: 3px solid var(--primary-color);
  border-right: 3px solid var(--primary-color);
  z-index: 1;
}

code {
  font-family: 'JetBrains Mono', Courier, monospace;
  font-size: 1em;
  color: var(--alt-color);
  border-radius: 4px;
  white-space: pre-wrap;
}

code:not([class*="language-"]) {
  background-color: var(--bg-alt-alt);
  background: linear-gradient(to bottom right, var(--bg-alt-alt) , transparent);
  padding: 2px;
}

.page-container {
  position: relative;
  margin-left: auto;
  margin-right: auto;
  width: 80vw;
  padding-bottom: 100px;
}

.mainPageLinks {
  display: flex;
  flex-direction: column;
  gap: 1em;
  width: 100%;
}

.linkBox-container {
  position: relative;
  padding-bottom: 10px;
  overflow: hidden;
}

.linkBox {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  gap: 6px;
  padding: 4px 0;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.linkBox::-webkit-scrollbar {
  display: none;
}

.linkBox::before {
  content: "On this page:";
  margin-right: .25em;
  padding-top: .5em;
  font-weight: 900;
  flex-shrink: 0;
}

.linkBox a {
  white-space: nowrap;
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

/* Fade-out effects with softer gradient */
.linkBox-container::before,
.linkBox-container::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 10px;
  width: 60px;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.3s;
}

.linkBox-container::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-main) 0%, transparent 100%);
  opacity: 0;
}

.linkBox-container::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-main) 0%, transparent 100%);
  opacity: 0;
}

.linkBox-container.scrollable-start::before,
.linkBox-container.scrollable-end::after {
  opacity: 1;
}

/* SVG Navigation buttons */
.linkBox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bg-main);
  box-shadow: 0 0 8px var(--text-light);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  opacity: 0;
  transition: all 0.3s ease;
}

.linkBox-container:hover .linkBox-nav {
  opacity: 1;
}

.linkBox-nav:hover {
  background-color: var(--bg-main);
  transform: translateY(-50%) scale(1.05);
}

.linkBox-nav svg {
  width: 2.5em;
  height: 2.5em;
  fill: var(--primary-color);
}

.linkBox-prev {
  left: 1.25em;
}

.linkBox-next {
  right: 1.25em;
}

.linkBox-prev,
.linkBox-next {
  top: 1.95em;
}

.linkBox-nav.hidden {
  display: none;
}

.winScript::Before {
  content: "PS C:\\scripts>";
  margin-right: 8px;
  color: var(--primary-color);
  vertical-align: top;
}

.scriptFile::before {
  content: ".\\";
  color: var(--alt-color) !important;
  vertical-align: top;
}

.scriptFile::after {
  content: "█";
  animation: blink 1s step-end infinite;
  margin-left: 4px;
  color: var(--primary-color);
  vertical-align: top;
}

.vscode-snippet {
  font-size: 1em !important;
  line-height: 1.5em !important;
  font-family: 'JetBrains Mono', Courier, monospace !important;
  position: relative;
  padding: 10px;
  background-color: var(--bg-code);
  width: calc(100% - 26px);
  z-index: 0;
  border: 3px solid var(--primary-color);
  border-radius: 0 8px 0 8px;
  overflow-x: auto;
  overflow-y: hidden;
}

.vscode-snippet>* {
  font-size: inherit !important;
  line-height: inherit !important;
  font-family: inherit !important;

}

.homeLink:hover a {
  color: var(--alt-color);
  transition: all 0.3s ease;
  text-decoration: underline dotted;
}

.back-to-top {
  display: none;
  position: fixed;
  bottom: 30px;
  right: 50%;
  left: 50%;
  z-index: 99;
  width: 50px;
  height: 50px;
  border-radius: 50% !important;
  background-color: var(--bg-main);
  background: radial-gradient(var(--bg-main), var(--bg-alt-alt) 50%);
  font-size: 32px;
  font-weight: 900;
  text-align: center;
  line-height: 1.5em;   /* Manaully adjusted to center the arrow */
  text-decoration: none;
  animation: bounce 2s infinite;
  box-shadow: 0 0 0 5px var(--secondary-color);
  opacity: 50%;
  cursor: pointer;
}

.back-to-top:hover {
  opacity: 1;
  box-shadow: 0 0 0 5px var(--alt-color);
  background: radial-gradient(var(--bg-alt-alt), var(--bg-main) 50%);
}

a.back-to-top {
  color: var(--text-light);
  text-decoration: none;
}

.back-to-top.visible {
  display: block;
}

kbd {
  padding: 2px 4px;
  font-size: .95em;
  color: var(--text-light);
  background-color: var(--bg-alt);
  /* revisit this when doing light mode */
  border: 1px solid var(--text-light);
  border-radius: 3px;
  box-shadow: var(---kbd-box-shadow);
  white-space: nowrap;
  font-family: 'JetBrains Mono', Courier, monospace;
}

pre {
  font-family: 'JetBrains Mono', Courier, monospace;
}

.console-output {
  white-space: pre;
  overflow-x: auto;
  overflow-y: auto;
  word-wrap: normal;
  word-break: keep-all;
  width: calc(100% - 26px);
  max-height: 450px;
  background-color: var(--bg-alt);
  color: var(--text-light);
  font-family: 'JetBrains Mono', Courier, monospace;
  padding: 10px;
  border: 3px dotted var(--alt-color);
  border-radius: 8px 0 8px 0px;
  margin: 0;
  tab-size: 4;
  -moz-tab-size: 4;
  -o-tab-size: 4;
}

.tutorial-hint {
  position: relative;
  background:
    radial-gradient(var(--hint-gradient-bg));
  border-radius: 24px;
  padding: 10px;
  color: var(--text-light);
  width: 100%;
  margin: auto;
  margin-top: 20px;
  overflow: hidden;
}

.tutorial-hint::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 8px;
  background: var(--hint-bar-gradient);
  pointer-events: none;
}

.tutorial-hint h4 {
  color: var(--primary-color);
  margin-top: 0.5rem;
  margin-left: .5rem;
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
}

.tutorial-hint p {
  margin-top: 0.5rem;
  margin-left: .5rem;
  line-height: 1.5;
}

.tutorial-hint a {
  text-decoration: underline dotted;
}

.command-table {
  background-color: var(--bg);
  width: auto;
  max-width: 90vw;
  border-radius: 12px;
  margin-bottom: 30px;
  border-collapse: separate;
  border-spacing: 0;
  border: 3px solid var(--primary-color);
  table-layout: auto;
  font-size: min(1em, 1.5vw);
  margin-left: auto;
  margin-right: auto;
}

/* Optional: Set a minimum font size to prevent text from becoming unreadable */
@media (max-width: 768px) {
  .command-table {
    font-size: min(0.9em, 1.8vw);
    /* Different scaling for mobile */
  }
}

@media (max-width: 768px) {
  .command-table {
    font-size: min(1.25em, 1.65vw);
    /* Different scaling for mobile */
  }
}



.command-table th:not(:last-child),
.command-table td:not(:last-child) {
  width: 1%;
  white-space: nowrap;
}

.command-table th:last-child,
.command-table td:last-child {
  width: auto;
}

.command-table tr:first-child th:first-child {
  border-top-left-radius: 8px;
}

.command-table tr:first-child th:last-child {
  border-top-right-radius: 8px;
}

.command-table tr:last-child td:first-child {
  border-bottom-left-radius: 8px;
}

.command-table tr:last-child td:last-child {
  border-bottom-right-radius: 8px;
}

.command-table th {
  background-color: var(--primary-color);
  color: var(--bg-main);
  font-size: 1.25em;
  font-weight: 400;
  padding: 12px 15px;
  text-align: left;
}

.command-table td {
  padding-top: 10px;
  padding-bottom: 10px;
  padding-left: 5px;
  border-bottom: 1px solid var(--secondary-color);
  vertical-align: top;
}

.command-table tr:nth-child(odd) {
  background-color: var(--bg-alt);
}

.command-table tr:nth-child(even) {
  background-color: var(--bg-alt-alt);
}

.command-table tr:hover {
  background-color: var(--bg-main);
  color: var(--primary-color);
  transition: all 0.75s ease;

}

#svg-logo {
  text-align: middle;
  position: relative;
  width: 7em;
  height: 7em;
}

#logoColor {
  fill: var(--primary-color);
  stroke: var(--primary-color);
  stroke-width: 0.206172;
  fill-opacity: 1;
}

#logoColor:hover {
  fill: var(--alt-color) !important;
}

@media (max-width: 920px) {
  .page-container {
    width: 90vw;
  }

  .svg-logo {
    width: 3em;
    height: 3em;
  }

  .header-title {
    white-space: normal;
    /* Allows text to wrap if needed */
  }
  .command-table {
    background-color: var(--bg);
    width: auto;
    max-width: 80vw;
  }
}

@media (max-width: 480px) {
  .header {
    gap: 8px;
  }

  .svg-logo {
    width: 2.5em;
    height: 2.5em;
  }
}

@font-face {
  font-family: 'Cantarell';
  src: url('./Cantarell-VF.otf') format('opentype');
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('./JetBrainsMono-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@keyframes blink {

  /* Cursor blinking animation */
  0%,
  50% {
    opacity: 1;
  }

  50.1%,
  100% {
    opacity: 0;
  }
}

@keyframes bounce {
  /* To-the-top bouncer */

  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(10px);
  }

  60% {
    transform: translateY(5px);
  }
}





/* Updated toggle visibility */
.theme-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-toggle-label.animate .lightbulb-icon {
  animation: pullCord 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.theme-toggle-label {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background-color: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  transition: all 0.3s ease;
  box-shadow: 0 0 14px var(--secondary-color);

}

/* SVG icon styles */
.lightbulb-icon {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

/* Light mode icon colors */
.lightbulb-icon .bulb-glass {
  fill: var(--bg-main);
  stroke: var(--bg-main);
  stroke-width: 0.5;
}

.lightbulb-icon .bulb-filament {
  fill: var(--bg-main);
  opacity: 0.8;
}

.lightbulb-icon .bulb-base {
  fill: var(--bg-main);
}

/* Dark mode icon colors */
.dark-mode .lightbulb-icon .bulb-glass {
  fill: var(--bg-main);
  stroke: var(--bg-main);
}

.dark-mode .lightbulb-icon .bulb-filament {
  fill: var(--bg-main);
}

.dark-mode .lightbulb-icon .bulb-base {
  fill: var(--bg-main);
}

/* Lightbulb Pull Cord Animation */
.lightbulb-icon {
  width: 24px;
  height: 24px;
  transform-origin: center 20%;
  /* Pivot point at top of bulb */
  transition:
    transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55),
    filter 0.3s ease;
}

/* Click animation when toggling */
.theme-toggle:active+.theme-toggle-label .lightbulb-icon,
.theme-toggle:checked:active+.theme-toggle-label .lightbulb-icon {
  animation: pullCord 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

/* Pull cord animation */
@keyframes pullCord {
  0% {
    transform: translateY(0) rotate(0);
  }

  30% {
    transform: translateY(8px) rotate(-5deg);
  }

  60% {
    transform: translateY(-4px) rotate(3deg);
  }

  80% {
    transform: translateY(2px) rotate(-2deg);
  }

  100% {
    transform: translateY(0) rotate(0);
  }
}

/* Add glowing filament effect when dark mode is active */
.theme-toggle:checked+.theme-toggle-label .lightbulb-icon .bulb-filament {
  animation: filamentGlow 1.5s infinite alternate;
}

@keyframes filamentGlow {
  from {
    opacity: 0.8;
    filter: drop-shadow(0 0 2px rgba(255, 235, 59, 0.5));
  }

  to {
    opacity: 1;
    filter: drop-shadow(0 0 6px rgba(255, 235, 59, 0.9));
  }
}