/* Page demo styles (safe to remove in production) */
:root {
    color-scheme: dark;
}

html, body {
    height: 100%;
}

body {
    position: relative;
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    background: #0f0e15;
    color: #e7ecff;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

#ai-starfield {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1; 
    pointer-events: none;
    display: block;
}

.ai-sparkle-overlay {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: radial-gradient(1200px 900px at 80% 20%, rgba(88, 102, 255, 0.08), transparent 60%),
                radial-gradient(900px 700px at 20% 80%, rgba(0, 255, 198, 0.06), transparent 60%);
    pointer-events: none;
}

.demo-wrap {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 4rem 1.5rem;
}

.card {
    max-width: 780px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 28px 26px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.28);
    backdrop-filter: blur(6px);
}

.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.controls label {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .9rem;
    opacity: .9;
}

input[type="range"], select { 
    width: 100%; 
}

footer {
    position: fixed;
    bottom: 5px;
    right: 5px;
}

footer a {
    color: #fff;
}

/* AI-Input Pill */
.ai-input{
  --ai-bg: var(--bs-body-bg, #fff);
  --ai-border: rgba(0,0,0,.12);
  --ai-shadow: 0 2px 10px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.06);
  --ai-shadow-focus: 0 8px 30px rgba(0,0,0,.10), 0 2px 8px rgba(0,0,0,.08);

  display:flex; align-items:center; gap:.5rem;
  width:min(768px, 100%);
  background:var(--ai-bg);
  border:1px solid var(--ai-border);
  border-radius:9999px;
  padding:.6rem .6rem .6rem .9rem;
  box-shadow:var(--ai-shadow);
  transition: box-shadow .2s ease, border-color .2s ease, background-color .2s ease;
}

.ai-input:focus-within{
  border-color: rgba(13, 253, 97, 0.35); /* Bootstraps primary-ish */
  box-shadow: var(--ai-shadow-focus);
}

.ai-leading-icon{
  font-size:1.1rem;
  color: #6c757d; /* muted */
}

.ai-textarea{
  flex:1 1 auto;
  resize:none;
  overflow-y: hidden;
  border:none;
  outline:none;
  background:transparent;
  color:inherit;
  font:inherit;
  line-height:1.45;
  max-height: 30dvh; /* begrenzt Wachsen */
  padding:.5rem .5rem;
}

.ai-textarea::placeholder{
  color: transparent;
}

/* Overlay-Placeholder */
.ai-input .ph{
  position: absolute;
  left: 44px;             /* Platz für .ai-leading-icon */
  right: 44px;            /* Platz für .ai-send-btn */
  top: 50%;
  transform: translateY(-50%);
  color: #8b96a3;
  pointer-events: none;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  line-height: 1.2;
  transition: transform .25s ease, opacity .2s ease;
}

/* Overlay-Placeholder */
.ai-input .ph{
  position: absolute;
  left: 44px;             /* Platz für .ai-leading-icon */
  right: 44px;            /* Platz für .ai-send-btn */
  top: 50%;
  transform: translateY(-50%);
  color: #8b96a3;
  pointer-events: none;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  line-height: 1.2;
  transition: transform .25s ease, opacity .2s ease;
}

/* Fokus/gefüllt → leicht nach oben raus + ausfaden */
.fancy-ph:focus-within .ph,
.ai-input.has-value .ph{
  transform: translateY(-140%);
  opacity: 0;
}

/* Durchscrollender Placeholder – „Marquee“-Fenster */
.cycling-ph .ph{
  height: 1.2em;
  line-height: 1.2em;
  overflow: hidden;
}

/* Liste der Phrasen */
.cycling-ph .phrases{
  display: inline-block;
  will-change: transform;
  animation: ph-scroll 10s steps(5) infinite; /* 5 Begriffe → steps(5) */
}

/* Jede Phrase als eigene Zeile */
.cycling-ph .phrases > span{
  display: block;
  height: 1.2em;
  line-height: 1.2em;
}

/* Beim Fokus/bei Wert: Animation pausieren und Placeholder ausblenden */
.cycling-ph:focus-within .phrases,
.cycling-ph.has-value .phrases{
  animation-play-state: paused;
}
.cycling-ph:focus-within .ph,
.cycling-ph.has-value .ph{
  transform: translateY(-140%);
  opacity: 0;
}

/* Keyframes für 5 Zeilen → -400% */
@keyframes ph-scroll{
  0%   { transform: translateY(0%); }
  100% { transform: translateY(-400%); }
}

/* Send Button */
.ai-send-btn{
  flex:0 0 auto;
  width:44px; height:44px;
  border:none;
  border-radius:9999px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, #077860, #0bd7a1);
  color:#fff;
  box-shadow: 0 4px 14px #2dfd0d59;
  transition: transform .08s ease, box-shadow .2s ease, opacity .2s ease;
}

.ai-send-btn:disabled{
  opacity:.5; cursor:not-allowed; box-shadow:none;
}

.ai-send-btn:hover{ transform: translateY(-1px); }
.ai-send-btn:active{ transform: translateY(0); box-shadow: 0 2px 8px rgba(13, 253, 37, 0.35); }

/* Dark-Mode Feinschliff (falls BS dark body) */
@media (prefers-color-scheme: dark){
  .ai-input{
    --ai-bg: rgba(255,255,255,.06);
    --ai-border: rgba(255,255,255,.12);
    --ai-shadow: 0 2px 10px rgba(0,0,0,.5);
    --ai-shadow-focus: 0 10px 30px rgba(0,0,0,.6);
    backdrop-filter: blur(6px);
  }
  .ai-textarea::placeholder{ color:#b7bcc3; }
}

.nav-link {
  color: #aaa;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding-left: 8px;
}

h2, h3 {
  padding-top: 60px; /* Offset für Scrollspy */
  margin-top: -60px;
}

.sidebar { 
  position: sticky; 
  top: 1rem; 
}

#toc {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow: auto;
    padding-right: .25rem;          /* etwas Platz für aktiven Hintergrund */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* IE/Edge legacy */
}

#toc::-webkit-scrollbar { display: none; }  /* WebKit */

.back-to-top {
  background: #ffffff88;
  position: fixed;
  padding: .5em .75em .5em .75em;
  text-align: center;
  bottom: 50px;
  right: 30px;
  z-index: 100;
  border-radius: 7px;
  color: #333;
  transition: all .2s;
}

.back-to-top:hover {
  background: #ffffff;
  transition: all .2s;
}

.chat-user{
  background: #ffffff11;
  padding: .75em;
  transition: all .2s;
  border-radius: 7px;
  margin: 5px 0 5px 0;
}

.chat-bot {
  background: #ffffff33;
  padding: .75em;
  transition: all .2s;
  border-radius: 7px;
  margin: 5px 0 5px 0;
}

.chat-bot a {
  color: #fff;
}

#chatOutput {
  width: 100%;
  max-width: 768px;
  padding: 1em;
  max-height: 20em;
  overflow: auto;
}

.nav-pills .nav-link.active, .nav-pills .show>.nav-link {
  background-color: #077860;
}