/* Everything related to buttons */
button.active {
  background-color: #016e30;
  color: white;
  border-width: 1px;
  border: 1px solid #09ff00;
  margin-bottom: 1%;
  /* Add space below the active button */
}

button {
  background-color: whitesmoke;
  color: black;
  border: black;
  border-radius: 10%;
  font-family: 'Cascadia Code', Courier, monospace;
}

#ParentButtons {
  text-align: center;
  position: sticky;
  top: 10%;
  /* Searchbox height + margin */
  z-index: 99;
}

#Buttons-in-document-section {
  text-align: center;
  position: sticky;
  top: 18%;
  /* Searchbox height + margin */
  z-index: 99;
}

.toggle-btn {
  background-color: whitesmoke;
  color: black;
  border: 1px solid black;
  border-radius: 10%;
  font-family: 'Cascadia Code', Courier, monospace;
  cursor: pointer;
  transition: all 0.3s ease;
}

.toggle-btn:active {
  background-color: #016e30;
  color: white;
  border: 1px solid #09ff00;
}

.toggle-btn.active {
  background-color: #016e30;
  color: white;
  border: 1px solid #09ff00;
}

.slide-content {
  overflow: auto;
  max-height: 100000000;
  transition: max-height 0.5s ease;
  margin-top: 10px;
  padding: 0 20px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.slide-content>button {
  display: inline-block;
  margin-right: 10px;
  margin-bottom: 10px;
}

.slide-content.open {
  /* No need to change padding dynamically */
}

.inner-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
  height: 100%;
  box-sizing: border-box;
}

.inner-slide {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.4s ease;
}

.inner-slide.open {
  max-height: 1000px; /* big enough to show full content */
  opacity: 1;
}

/* ------------------------------------------------------------------------------------ */
/* Everything related to fonts */
.press-start-2p-regular {
  font-family: "Press Start 2P", system-ui;
  font-weight: 400;
  font-style: normal;
}

.exo-2 {
  font-family: "Exo 2", sans-serif;
  font-optical-sizing: auto;
  font-style: normal;
}

.merienda {
  font-family: "Merienda", cursive;
  font-optical-sizing: auto;
}

.cascadia-code {
  font-family: "Cascadia Code", sans-serif;
  font-optical-sizing: auto;
  font-weight: 100;
  font-style: normal;
}

#White {
  color: black;
  background-color: #021b02;
  font-family: "Exo 2", sans-serif;
  border: 3px solid rgb(8, 236, 15);
  /* Combine border properties into one line */
  padding: 3%;
  /* Optional: adds space inside the border */
}

#White li {
  color: black;
  background-color: #4a944a3f;
  font-family: "Exo 2", sans-serif;
  border: 2px solid black;
  /* Visible border for each li item */
  border-style: dashed;
  margin-bottom: 5px;
  /* Optional: spacing between items */
  padding: 3px;
}

/* ------------------------------------------------------------------------------------ */
/* Things in the top */
/* --------------------------------------- */
body {
  background-color: black;
  font-family: 'Cascadia Code', Courier, monospace;

}

#BeneathParrentButtons {
  position: sticky;
  top: 13%;
  /* Combined height of above sections */
  z-index: 98;
}

.Frnt2 {
  text-align: center;
  color: #ffffff;
  font-family: "Exo 2", sans-serif;
  font-optical-sizing: auto;
  font-style: normal;
  background-color: #000000;
  font-size: 200%;
}

.Fronttext {
  text-align: center;
  font-family: "Press Start 2P", system-ui;
  color: #008000;
  background-color: #000000;
}

h1 {
  background-color: #1f1e1c;
  font-family: "Exo 2", sans-serif;
}

h2 {
  color: greenyellow;

}

ol {
  background-color: #1f1e1c;
  padding: 20px;
  /* Padding for the whole list */
  list-style-position: inside;
  /* Optional: keeps bullets inside padding */
  border: 2px solid rgb(140, 140, 140);
  margin-bottom: 5px;
  /* Optional: spacing between items */
}

li {
  background-color: #1f1e1c;
  color: rgb(255, 255, 255);
  padding: 0.01%;
  /* This will expand the li */
  margin-bottom: 10px;
  /* Adds spacing between items */
  border: 0.8px solid #2b2b2b;
  /* Makes padding visible */
  text-shadow: -0.02px 0 #2b2b2b, 0 0.02px #2b2b2b, 0.02px 0 #2b2b2b, 0 -0.02px #2b2b2b;
}

.Blues {
  color: blue;
  font-style: italic;
}

/* --------------------------------------- */
/* Search Function */
#Searchbox {
  text-align: center;
  position: sticky;
  top: 2%;
  z-index: 100;
}

.example {
  margin: auto;
  max-width: 90%;
  color: black;
  font-family: "Exo 2", 'Courier New', Courier, monospace;

}

input[type="text"] {
  padding: 10px;
  font-size: 17px;
  border: 1px solid #09ff00;
  width: 80%;
  background: #333333;
  margin-bottom: 5%;
}

ul#itemList {
  margin-top: 20px;
  list-style: none;
  padding: 0;
}

ul#itemList li {
  padding: 5px;
  border-bottom: 1px solid #09ff00;
}

.highlighted-word {
  background-color: yellow;
  font-weight: bold;
  color: black;
}

.suggestion:hover {
  background: #333333;
}

.suggestion {
  padding: 1%;
  size: 10px;
  border-bottom: 1px solid #201e1e;
  background: #016e30;
  margin-bottom: 1%;
}

/* ------------------------------------------------------------------------------------ */
/* Things in Document Section */

#document-h1 {
  text-align: center;
  position: sticky;
  top: 12.5%;
  /* Searchbox height + margin */
  z-index: 99;
}

#Headings-in-document-section {
  background-color: #000000;
  color: whitesmoke;
  font-family: 'Cascadia Code', Courier, monospace;
}

/* ------------------------------------------------------------------------------------ */
/* COlor indication tags */
#SUPERHERO {
  color: #02b0fa;
}

#ROMANCE {
  background-color: #ff0066d5;
  color: #000000;
}

#PSYCHOLOGICAL {
  background-color: #ff6b02;
  color: #000000;
}

#ADULT {
  text-decoration: line-through rgb(255, 255, 255) dotted;
}

#GOATbutADULT {
  color: #05f072;
  text-decoration: line-through rgb(255, 255, 255) dotted;
}

#GOAT {
  color: #05f072;
}

#BRAINDamaging {
  color: #ff0000;
}

#SciFIeandChild {
  font-family: "Press Start 2P", system-ui;
  color: #00008b;
}

#ColorsIndication {
  text-align: center;
  background-color: #41414198;
  color: rgb(123, 123, 123);
  font-family: "Merienda", cursive;
  font-style: italic;
  text-decoration-style: dotted;
  animation: flicker 2s infinite;
  text-shadow: 0 0 2px #ff00bf, 0 0 10px #00ff1e;
  border-radius: 50%;
  border: 2px solid green;
  border-style: dashed double;
}

.tag-legend {
  position: fixed;
  top: 100px;
  left: 100px;
  /* Use left for JS movement */
  cursor: move;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-width: 300px;
  padding: 1rem;
  background: #31313158;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  user-select: none;
  z-index: 9999;
  touch-action: none;
  /* Prevents scroll during touch drag */
  cursor: grab;
}

.tag-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "Cascadia Code", sans-serif;
  border: 0.01px solid rgb(59, 59, 59);
  padding: 0.1rem 1rem;
  /* add some padding inside the border */
}

/* Apply space only after the last tag-item */
.tag-item:last-child {
  margin-bottom: 10%;
}

.tag-color {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid #ccc;
  flex-shrink: 0;

}

.tag-text {
  font-size: 1rem;
  color: #333;
}

.strike {
  text-decoration: line-through dotted white;
}

.custom-strike {
  color: #05f072;
  text-decoration: line-through white dotted;
}

/* Rainbow */
.rainbow {
  display: inline-block;
}

/* Rainbow color loop: red → orange → yellow → green → blue → indigo → violet */
.rainbow:nth-of-type(1) {
  color: red;
}

.rainbow:nth-of-type(2) {
  color: orange;
}

.rainbow:nth-of-type(3) {
  color: yellow;
}

.rainbow:nth-of-type(4) {
  color: green;
}

.rainbow:nth-of-type(5) {
  color: blue;
}

.rainbow:nth-of-type(6) {
  color: indigo;
}

.rainbow:nth-of-type(7) {
  color: violet;
}

.rainbow:nth-of-type(8) {
  color: red;
}

.rainbow:nth-of-type(9) {
  color: orange;
}

.rainbow:nth-of-type(10) {
  color: yellow;
}

.rainbow:nth-of-type(11) {
  color: green;
}

.rainbow:nth-of-type(12) {
  color: blue;
}

.rainbow:nth-of-type(13) {
  color: indigo;
}

.rainbow:nth-of-type(14) {
  color: violet;
}

.rainbow:nth-of-type(15) {
  color: red;
}

.rainbow:nth-of-type(16) {
  color: orange;
}

.rainbow:nth-of-type(17) {
  color: yellow;
}

.rainbow:nth-of-type(18) {
  color: green;
}

.rainbow:nth-of-type(19) {
  color: blue;
}

.rainbow:nth-of-type(20) {
  color: indigo;
}

.rainbow:nth-of-type(21) {
  color: violet;
}

.rainbow:nth-of-type(22) {
  color: red;
}

.rainbow:nth-of-type(23) {
  color: orange;
}

.rainbow:nth-of-type(24) {
  color: yellow;
}

.rainbow:nth-of-type(25) {
  color: green;
}

.rainbow:nth-of-type(26) {
  color: blue;
}

.rainbow:nth-of-type(27) {
  color: indigo;
}

.rainbow:nth-of-type(28) {
  color: violet;
}

.rainbow:nth-of-type(29) {
  color: red;
}

.rainbow:nth-of-type(30) {
  color: orange;
}

.rainbow:nth-of-type(31) {
  color: yellow;
}

.rainbow:nth-of-type(32) {
  color: green;
}

.rainbow:nth-of-type(33) {
  color: blue;
}

.rainbow:nth-of-type(34) {
  color: indigo;
}

.rainbow:nth-of-type(35) {
  color: violet;
}

.rainbow:nth-of-type(36) {
  color: red;
}

.rainbow:nth-of-type(37) {
  color: orange;
}

.rainbow:nth-of-type(38) {
  color: yellow;
}

.rainbow:nth-of-type(39) {
  color: green;
}

.rainbow:nth-of-type(40) {
  color: blue;
}

.rainbow:nth-of-type(41) {
  color: indigo;
}

.rainbow:nth-of-type(42) {
  color: violet;
}


@keyframes flicker {
  0% {
    opacity: 1;
    color: #00ff80;
  }

  5% {
    opacity: 0.4;
    color: #008d1f;
  }

  10% {
    opacity: 1;
    color: #bbb;
  }

  15% {
    opacity: 0.6;
    color: #eee;
  }

  20% {
    opacity: 1;
    color: #999;
  }

  25% {
    opacity: 0.3;
    color: #59ff00;
  }

  30% {
    opacity: 1;
    color: #127a3a;
  }

  100% {
    opacity: 1;
    color: rgb(23, 46, 24);
  }
}

/* ------------------------------------------------------------------------------------ */
.popup-image {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.75);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
  opacity: 0;
  pointer-events: none;
  /* disables scroll interaction under the popup */
}

.popup-image img {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  border-radius: 8px;
}

.popup-image.show {
  display: flex;
  opacity: 1;
  pointer-events: auto;
  /* Allow interaction only when shown */
}

img:missing::after,
img[alt]:not([src])::after {
  content: attr(alt);
  color: red;
  display: block;
  font-weight: bold;
}

.contentwrapper-box {
  width: 100%;
  margin-bottom: 2rem;
  box-sizing: border-box;
}

/* Auto slide scroll area */
.contentwrapper {
  position: relative;
  max-height: 280px;
  overflow-y: auto;
  padding: 1%;
  border: 1px solid #1aff00;
  box-sizing: border-box;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  opacity: 0.9;
}

.contentwrapper * {
  box-sizing: border-box;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

.contentwrapper img,
.contentwrapper button {
  max-width: 100%;
  height: auto;
}

.svg-frame-wrapper {
  position: relative;

  margin: auto;
}

.svg-frame-wrapper svg {
  height: auto;
  display: block;
}

.svg-frame-wrapper .inner-content {
  position: absolute;
  top: 0%;
  left: 0%;
  right: 0%;
  bottom: 0%;
  color: #fff7da;
}


/* Sticky h2 */
#headerinsidescrollbox {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: flex-end;
  /* Align contents to the right */
  background: transparent;
  /* No background on the full-width h2 */
  z-index: 10;
  padding: 10px;
}

/* Inner box around the text */
.header-box {
  background-color: #000000;
  color: burlywood;
  padding: 8px 16px;
  border-radius: 4px;
  white-space: nowrap;
  /* Prevents wrapping */
}


/* Scroll button container */
.auto-scroll-div {
  position: sticky;
  bottom: 1px;
  display: flex;
  flex-direction: row;
  /* Make buttons horizontal */
  justify-content: flex-end;
  /* Push them to the right */
  gap: 3%;
  width: 100%;
  /* So 'justify-content' applies properly */
  z-index: 10;
  /* Optional: add a background to improve visibility */
  padding-right: 50px;
  /* Optional: adjust spacing from right edge */
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* Button style */
.glow-button {
  text-align: center;
  width: 65px;
  height: 65px;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: bold;
  position: relative;
  z-index: 1;
}

.glow-button:active {
  text-align: center;
  background-color: #41414198;
  color: rgb(123, 123, 123);
  font-family: "Merienda", cursive;
  font-style: italic;
  text-decoration-style: dotted;
  animation: flicker 2s infinite;
  text-shadow: 0 0 2px #ff00bf, 0 0 10px #00ff1e;
  border-radius: 50%;
  border: 2px solid green;
  border-style: dashed double;
}

/* Highlight active/scrolling button */
/* When scrolling: alternate rainbow colors */
.glow-button.scrolling {
  content: '';
  position: fixed;
  top: -0px;
  left: -0px;
  right: -0px;
  bottom: -10px;
  border-radius: 50%;
  z-index: -1;
  filter: blur(30px);
  opacity: 0.8;
  background: conic-gradient(from 0deg,
      red,
      yellow,
      lime,
      cyan,
      blue,
      magenta,
      red);
  animation: rotate 3s linear infinite;
}

/* Glow effect (default) */
.glow-button::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
      red,
      yellow,
      lime,
      cyan,
      blue,
      magenta,
      red);
  z-index: -1;
  filter: blur(15px);
  opacity: 0.6;
  animation: rotate 4s linear infinite;
}


.glow-button::after {
  text-align: center;
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(100%);
  z-index: -1;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 600px) {
  .glow-button {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }
}

/* Ongoing Active symbol fade in out */
.ongoing::after {
  content: "●";
  /* Can be replaced with ⚡, ★, etc. */
  color: limegreen;
  margin-left: 8px;
  animation: fade 1.5s infinite;
  font-size: 1.5em;
  vertical-align: middle;
  text-shadow: 0 0 6px limegreen, 0 0 12px limegreen;
}

@keyframes fade {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.2;
  }

  100% {
    opacity: 1;
  }
}
