:root {
  --jt-bg: #0f0b1a86;
  --jt-panel: rgba(163, 66, 202, 0.479);
  --jt-border: rgba(180, 120, 255, 0.2);

  --jt-primary: #db9eff;
  --jt-secondary: #ff77ff;
  --jt-accent: #00f0ff;
  --jt-code-color: #ff68eb;

  --jt-link: #ff9ff9;

  --jt-text: #eae6ff;
  --jt-text-dim: #a8a2c7;

  --jt-glow: 0 0 12px rgba(188, 72, 255, 0.4);
}

.spec-section {
  background: var(--jt-panel);
  border: 1px solid var(--jt-border);
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;

  backdrop-filter: blur(3px);
  box-shadow: 0 0 20px rgba(0,0,0,0.4);

  position: relative;
  overflow: hidden;

  /* Smooth transitions */
  transition: transform 0.3s cubic-bezier(.2,.8,.2,1),
              box-shadow 0.3s ease,
              border-color 0.3s ease,
              background 0.3s ease;

  display: flex;
  flex-direction: column;
}

.spec-section > * {
  margin: 0.5%;
}

/* §-Icon */
.spec-section::before {
  content: "§";
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 2.4rem;
  color: var(--jt-accent);
  opacity: 0;
  transform: translateY(-12px) rotate(-15deg);
  transition: all 0.4s cubic-bezier(.25,.8,.25,1);
  z-index: 1;
}

/* Inhalte über Glow Layer */
.spec-section > * {
  position: relative;
  z-index: 2;
}

/* Hover Effekt: Lift, Scale, Glow */
.spec-section:hover {
  transform: translateY(-4px) scale(1.005);
  border-color: var(--jt-primary);
  box-shadow: 0 10px 30px rgba(188, 72, 255, 0.4),
              0 15px 50px rgba(0, 240, 255, 0.2);
}

/* §-Icon Hover */
.spec-section:hover::before {
  opacity: 1;
  transform: translateY(0) rotate(0deg);
  z-index: 1000;
}

/* Überschriften */
.spec-section h3 {
  color: var(--jt-secondary);
  font-weight: 1000;
  text-shadow: 0 0 6px rgba(255, 119, 255, 0.4);
  margin: 0;
  position: relative;
  font-size: small;
}

.spec-section h3::after {
  content: "";

  position: absolute;
  width: 100%;
  height: 1px;
  background-color: var(--jt-secondary);
  left: 0;
  bottom: 0;
  opacity: 0.2;
}

.spec-section ul {
  list-style: none;
}

.spec-section ul li {
  position: relative;
}

.spec-section ul li::before {
  content: "§";
  position: absolute;
  left: -10px;
  font-size: 1rem;
  color: var(--jt-accent);
  transform: translateX(-20px);
  transition: all 0.4s cubic-bezier(.25,.8,.25,1);
  z-index: 1;
  opacity: 0.5;
}

.spec-section:hover ul li::before {
  opacity: 1;
  transform: translateX(-12px) rotate(0deg);
}

.spec-section:hover h3:first-of-type::after {
  transition: ease-in-out 0.1s;
  width: calc(100% - 18px);
}

/* Term */
.term {
  font-weight: bold;
  color: var(--jt-primary);
  position: relative;
}

.term::before {
  content: "";
  position: absolute;
  width: 100%;
  bottom: 0;
  left: 0;
  transition: 2s ease-in-out;
  -webkit-box-shadow: 0px 0px 0px 1px #c123ff; 
  box-shadow: 0px 0px 0px 1px #c123ff;
}

.term:hover::before {
  transition: 2s ease-in-out;
  -webkit-box-shadow: 50px 0px 15px 1px #23ffff; 
  box-shadow: 50px 0px 15px 1px #23ffff;
}

/* Definition */
.definition {
  color: var(--jt-text);
  line-height: 1.6;
  margin-left: 10px;
}

/* Code Styling */
#content code {
  background: rgba(62, 43, 83, 0.178);
  color: var(--jt-accent);
  font-family: 'Courier New', Courier, monospace;
  padding: 1px 4px;
  break-inside: avoid;
  border-radius: 6px;

  text-shadow: 2px 2px 2px rgba(65, 4, 59, 0.89);
}

#content pre.block-code {
  background: rgba(18, 13, 24, 0.178);
  color: var(--jt-accent);
  font-family: 'Courier New', Courier, monospace;
  padding: 0.1%;
  border-radius: 10px;

  position: relative;
}

pre.block-code .copy-btn {
  position: absolute;
  top: .3rem; right: .3rem;
  border: none;
  border-radius: .2rem;
  background: none;
  padding: .2rem .5rem;
  cursor: pointer;
}

pre.block-code .copy-btn:hover {
  opacity: 0.8;
}

.jumpup {
  animation: jump-up ease-out 2s;
}

/* Must / Should / May Labels */
.must {
  color: #ff4d6d !important;
  font-weight: bold;
  text-transform: uppercase;
}

.should {
  color: #ffd166 !important;
  font-weight: bold;
  text-transform: uppercase;
}

.may {
  color: #11f830 !important;
  font-weight: bold;
  text-transform: uppercase;
}

.valid {
  color: yellow !important;
  font-weight: bold;
  text-transform: uppercase;
}

.defined {
  color: rgb(92, 161, 250) !important;
  font-weight: bold;
  text-transform: uppercase;
}

.c-comment {
  color: rgb(32, 167, 32);
  font-weight: bold;
}

.c-str {
  color: rgb(255, 118, 54);
}

.c-bool {
  color: rgb(255, 54, 228);
}

.c-list {
  color: rgb(61, 113, 255);
}

.c-num {
  color: rgb(134, 255, 54);
}

.deterministic {
  color: rgb(92, 155, 250) !important;
  font-weight: bold;
  text-transform: uppercase;
}

/* Link Styling */
#content a {
  text-decoration: none;
  position: relative;
}

#content p a, #content li a {
  color: var(--jt-link);
}

#content td a {
  color: var(--jt-link);
}

#content a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0%;
  height: 1px;
  background: var(--jt-accent);
  transition: width 0.2s;
}

#content a:hover::after {
  width: 100%;
}

#content a:hover {
  cursor: pointer;
}

/* Text Styling */
.spec-text {
  color: var(--jt-text);
  line-height: 1.7;
}

.spec-text strong {
  color: var(--jt-secondary);
}


/* Active State */
.spec-section.active {
  border-color: var(--jt-accent);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
  animation: spec-section-active 7s ease-in-out forwards;
}

@keyframes spec-section-active {
  50% {
    border-color: var(--jt-accent);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
  }
  100% {
    box-shadow: 0 0 20px rgba(0,0,0,0.4);
    border: 1px solid var(--jt-border);
  }
}

#control_btns_sides {
  margin-top: 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;

  background-color: var(--jt-panel);
  border-radius: 20px;
}

#next-button {
  height: clamp(10px, 2rem, 50px);
  background-color: var(--jt-panel);
  border: none;
  width: clamp(60px, 5rem, 100px);
  margin: 2%;
  border: solid 2px rgba(102, 51, 153, 0.5);
  border-radius: 20%;
  corner-shape: squircle;
}

#next-button.jump {
  animation: jump-up 0.5s ease-in-out;
}

#last-button {
  height: clamp(10px, 2rem, 50px);
  background-color: var(--jt-panel);
  border: none;
  width: clamp(60px, 5rem, 100px);
  margin: 2%;
  border: solid 2px rgba(102, 51, 153, 0.5);
  border-radius: 20%;
  corner-shape: squircle;
}

#last-button.jump {
  animation: jump-up 0.5s ease-in-out;
}

button.disabled {
  border: solid 2px rgba(98, 89, 107, 0.548);
  background-color: rgba(128, 128, 128, 0.432);
}

.spec-img {
  width: 100%;
  max-width: 500px;
  height: auto;
  display: block;
}

@keyframes jump-up {
  50% {
    transform: translateY(-10px) rotate(10deg);
  }
  75% {
    transform: translateY(10px) rotate(-10deg);
  }
}