/* Lokale Font-Definitionen */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('./fonts/Inter_18pt-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('./fonts/Inter_18pt-Bold.ttf') format('truetype');
}

@font-face {
    font-family: 'Sora';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('./fonts/Sora-Bold.ttf') format('truetype');
}

@font-face {
    font-family: 'Material Icons Outlined';
    font-style: normal;
    font-weight: 400;
    font-display: block;
    src: url('./fonts/MaterialIconsOutlined-Regular.woff2') format('woff2');
}

.material-icons-outlined {
    font-family: 'Material Icons Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'liga';
}

:root {
    font-size: 19px;
    --gray2: rgb(248, 249, 250);
    --hauptfarbe: rgb(0, 120, 174);
    --grau3: rgb(242, 242, 242);
    --grau4: rgb(171, 171, 171);
    --grau5: rgb(127 127 127);
    --weiss: #FFFFFF;
    --border-color: #EAEAEA;
}

body {
    background: linear-gradient(135deg, var(--gray2) 0%, #f5f6f7 60%, #e9ecef 100%);
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding-top: 30px;
    min-height: 100vh;
    box-sizing: border-box;
    font-size: 0.8rem;
}

body, html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}


.normenButtons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

}

.normButton {
    background: var(--grau3);
    color: var(--hauptfarbe);
    border: none;
    border-radius: 5px;
    padding: 5px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.normButton:hover,
.normButton:focus {
    background: var(--hauptfarbe);
    color: #fff;
}

.focused {
    background: var(--hauptfarbe);
    color: #fff;
}

.highlightChunk {
    background: transparent; /* Initial versteckt */
    color: #222;

    border-radius: 2px;
}

/* Animierter Marker-Effekt */
.highlightChunk.animated {
    background: linear-gradient(90deg, #ffe066 0%, #ffe066 var(--highlight-progress, 0%), transparent var(--highlight-progress, 0%));
    animation: none;
}

@keyframes markerHighlight {
    from {
        background-size: 0% 100%;
    }
    to {
        background-size: 100% 100%;
    }
}

.highlightChunk.marker-animation {
    background: linear-gradient(90deg, #ffe066 0%, #ffe066 100%);
    background-size: 0% 100%;
    background-repeat: no-repeat;
    background-position: left center;
    animation: markerHighlight var(--animation-duration, 1s) ease-out forwards;
}




.weisseKarte {
    min-width: 300px;
    max-width: 700px;
    width: 100%;
    background-color: var(--weiss);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 15px;
    margin: 5px 0;
    box-sizing: border-box;
}

body>.weisseKarte:first-of-type {
    margin-top: 0;
}

h1 {
    font-family: 'Sora', sans-serif;
    color: var(--hauptfarbe);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.3rem;
    text-align: center;
    position: relative; /* Für die Positionierung des Pseudo-Elements */
    overflow: hidden; /* Alles was über den Rand geht, wird abgeschnitten */
}

/* Glanzstreifen-Effekt */
h1::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: all 2s;
    z-index: 1;
}

h1.glanz::before {
    left: 100%;
}

#eingabeTextWrapper {
    display: flex;
    align-items: center;
    background-color: var(--grau3);
    border-radius: 5px;
    padding: 0 0 0 10px;
    margin-bottom: 0;
}

#questionIcon {
    color:  rgb(175, 175, 175);
    font-size: 1.3rem;
    margin-right: 8px;
    user-select: none;
    transition: none;
}

#questionIcon.animiert {
    animation: iconColorFade 0.5s cubic-bezier(0.4,0,0.2,1) forwards;
}

@keyframes iconColorFade {
    0% {
        color: rgb(175, 175, 175);
    }
    100% {
        color: var(--hauptfarbe);
    }
}

#questionIcon.animiert {
    animation: iconColorFade 1s cubic-bezier(0.4, 0, 0.2, 1) 0.5s forwards, iconWiggleRotate 2s cubic-bezier(0.4, 0, 0.2, 1) 2s forwards, iconGrowPulseTwice 1s cubic-bezier(0.4, 0, 0.2, 1) 0.5s;
}

@keyframes iconWiggleRotate {
    0% {
        transform: rotate(0deg);
    }
    10% {
        transform: rotate(15deg);
    }
    20% {
        transform: rotate(-15deg);
    }
    30% {
        transform: rotate(10deg);
    }
    40% {
        transform: rotate(-10deg);
    }
    50% {
        transform: rotate(5deg);
    }
    60% {
        transform: rotate(-5deg);
    }
    70% {
        transform: rotate(2deg);
    }
    80% {
        transform: rotate(-2deg);
    }
    90% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

@keyframes iconGrowPulseTwice {
    0% {
        transform: scale(1);
    }
    20% {
        transform: scale(1.3);
    }
    30% {
        transform: scale(1.15);
    }
    40% {
        transform: scale(1);
    }
    60% {
        transform: scale(1.3);
    }
    70% {
        transform: scale(1.15);
    }
    80% {
        transform: scale(1);
    }
    100% {
        transform: scale(1);
    }
}

#eingabeTextInhalt {
    flex: 1;
    width: 100%;
    min-height: 35px;
    max-height: 200px;
    resize: none;
    background-color: transparent;
    border: none;
    border-radius: 5px;
    padding: 8px 15px 8px 0; /* Etwas mehr Padding oben/unten für bessere Lesbarkeit */
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
    font-size: 0.8rem;
    line-height: 1.3;
    overflow-y: auto;
    transition: height 0.1s ease; /* Sanftere Überblendung bei Höhenänderung */
    scrollbar-width: none;         /* Firefox */
    -ms-overflow-style: none;      /* IE 10+ */
}

#eingabeTextInhalt::-webkit-scrollbar {
    display: none;                 /* Chrome/Safari/Opera */
}

#eingabeTextInhalt::placeholder {
    color: #999;
    font-size: 0.8rem;
}



#eingabeTextInhalt:focus {
    outline: none;
    border-color: var(--hauptfarbe);
}

.hinweistext {
    color: var(--grau5);
    font-size: 0.9rem;
}

.hinweistext_klein {
    color: var(--grau5);
    font-size: 0.75rem;
    margin-bottom: 5px;
}

.gefundeneGesetzeWrapper {
    min-height: 100px;
    border: 1px dashed #CCC;
    border-radius: 5px;
    padding: 10px;
    color: rgb(59, 59, 59);
    white-space: inherit;
    background-color: var(--grau2);
    text-align: left; /* Von einzelErgebnis übernommen */
    overflow: hidden;
}

.ladeMeldung {
    text-align: center;
    padding: 20px;
    color: #888;
}

.einzelErgebnis {
    /* Reduzierte Eigenschaften, da die meisten nun in gefundeneGesetzeWrapper sind */
    margin-bottom: 20px;
}

.einzelErgebnis h3, .gefundeneGesetzeWrapper h3 {
    margin-top: 0;
    color: var(--hauptfarbe);
    font-size: 1.1rem;
}

.contentWrapper {
    margin-top: 10px;
    border: 1px solid var(--border-color);
    padding: 10px;
    background-color: var(--weiss);
    border-radius: 4px;
    max-height: 300px;
    overflow: auto;
}

.paragraphAbsatz {
    margin-top: 10px;
}

.paragraphHeader {
    font-family: 'Sora';
    font-size: 1rem;
    margin-top: 10px;
}

.grayColor {
    color: var(--grau5);
}

.darkGrayColor {
    color: black;
    font-size: 0.9rem;
}

.hauptColor {
    color: var(--hauptfarbe);
}

dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 1em;
    row-gap: 0.5em;
    align-items: start;
}

dt {
    margin: 0;
}

dd {
    margin: 0;
}

#paddingLR12 {
    color: black;
        margin-top: -25px;
}

.gap {
    margin: 20px 0px;
}


.einleitungText {
    color: #000000;
    margin-bottom: 0.7em;
}

.einleitungListe {
    list-style: none;
    padding: 0;
    margin: 18px 0 0 0;
}

.einleitungListe li {
    display: flex;
    color: #353535;
}

.einleitungCheck {
    color: var(--hauptfarbe);
    font-size: 1.3rem;
    margin-right: 10px;
    vertical-align: middle;
    user-select: none;
}

.hidden {
    display: none !important;
}

.spinnerKarte {
    display: flex;
    align-items: center;
    gap: 18px; /* Abstand zwischen Spinner und Text */
}

/* Neuer Spinner-Stil (ersetzt alten Spinner) */
.loader {
  position: relative;
  width: 100px;
  height: 16px;
  transform: scale(0.8);
}
.loader:before, .loader:after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--grau4);
  box-shadow: 32px 0 var(--grau4);
  left: 0;
  top: 0;
  animation: ballMoveX 2s linear infinite;
}
.loader:after {
  box-shadow: none;
  transform: translateX(64px) scale(1);
  z-index: 2;
  animation: none;
  animation: trfLoader 2s linear infinite;
}

@keyframes trfLoader {
  0%, 5% {
    transform: translateX(64px) scale(1);
    background: var(--grau4);
  }
  10% {
    transform: translateX(64px) scale(1);
    background: var(--hauptfarbe);
  }
  40% {
    transform: translateX(32px) scale(1.5);
    background: var(--hauptfarbe);
  }
  90%, 95% {
    transform: translateX(0px) scale(1);
    background: var(--hauptfarbe);
  }
  100% {
    transform: translateX(0px) scale(1);
    background: var(--grau4);
  }
}
@keyframes ballMoveX {
  0%, 10% { transform: translateX(0) }
  90%, 100% { transform: translateX(32px) }
}

/* Neue Klasse für das gptErgebnis mit expliziten Anzeigeeinstellungen */
.gptErgebnisKarte {
    display: block !important;

}

.primaryActionBtn {
    background: var(--hauptfarbe);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 5px 18px;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
    min-width: 120px;
    max-height: 50px;
    height: 30px; /* Feste Höhe für alle Action-Buttons */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.primaryActionBtn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: all 2s;
    z-index: 1;
}

.primaryActionBtn.glanz::before {
    left: 100%;
}

/* NEU: Buttons im Einleitungstext maximal auseinanderziehen */
#einleitung {
    max-height: 500px;
}

#einleitung .einleitungText {
    display: flex;
    flex-direction: column;
    gap: 0.7em;
}
#einleitung .einleitungListe {
    margin-bottom: 0.7em;
}

#einleitung .zufallsFrageBtn, #einleitung .zufallsFrageBtn + .zufallsFrageBtn {
    margin-top: 0;
}
#einleitung .zufallsFrageBtn, #einleitung .zufallsFrageBtn + button {
    display: inline-block;
}
#einleitung .zufallsFrageBtn:last-child {
    margin-left: 0;
}

.gesetzHighlight {
    color: var(--hauptfarbe);
    font-weight: bold;
}

.menueLeiste {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
}

#eingabeLosBtnWrapper {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
    max-height: 40px;
    gap: 5px;
}


#scrollUpBtn {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 70px;
    height: 70px;
    background: #fff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: opacity 0.3s;
    opacity: 0;
    pointer-events: none;
  }
  #scrollUpBtn.show {
    opacity: 1;
    pointer-events: auto;
        box-shadow: 1px 1px 13px 2px #979797;   
  }
  #scrollDownBtn {
    position: fixed;
    left: 24px;
    bottom: 24px;
    width: 70px;
    height: 70px;
    background: #fff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: opacity 0.3s;
    opacity: 0;
    pointer-events: none;
  }
  #scrollDownBtn.show {
    opacity: 1;
    pointer-events: auto;
    box-shadow: 1px 1px 13px 2px #979797;
  }

  @media (max-width: 600px) {
    #scrollUpBtn {
      right: 20px;
      bottom: 20px;
      width: 48px;
      height: 48px;
    }
    #scrollUpBtn .material-icons-outlined {
      font-size: 30px;
    }
    #scrollDownBtn {
      left: 20px;
      bottom: 20px;
      width: 48px;
      height: 48px;
    }
    #scrollDownBtn .material-icons-outlined {
      font-size: 30px;
    }
  }

.hinweisOverlayBox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.25);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hinweisBox {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.15);
    padding: 28px 32px 18px 32px;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.hinweisBoxMsg {
    font-size: 0.8rem;
    color: #222;
    margin-bottom: 10px;
    text-align: center;
}

.hinweisBoxOkBtn {
    background: var(--hauptfarbe);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 7px 22px;
    font-size: 1em;
    cursor: pointer;
    margin-top: 10px;
}

.normenInfoBox {
    position: fixed;
    left: 50%;
    top: 20px;
    transform: translateX(-50%);
    background: #fff;
    color: black;
    padding: 7px 18px;
    border-radius: 16px;
    font-size: 0.9rem;
    box-shadow: rgb(20 20 20 / 12%) 0px 1px 8px 9px;
    z-index: 9999;
    pointer-events: none;
}

/* Kontaktformular Styles */
#kontaktForm input:focus,
#kontaktForm textarea:focus {
    outline: none;
    border-color: var(--hauptfarbe);
}

#kontaktForm button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#headlineFragezeichen {
    font-size: 0.0rem;
    opacity: 0;
    transition: none;
    display: inline-block;
    vertical-align: middle;
    margin-bottom: 3px;
}

#headlineFragezeichen.animiert {
    animation: fragezeichenGrow 1.5s cubic-bezier(0.4,0,0.2,1) forwards;
}

@keyframes fragezeichenGrow {
    from {
        font-size: 0.0rem;
        opacity: 0;
    }
    to {
        font-size: 1.3rem;
        opacity: 1;
    }
}

::selection {
    background: rgba(0, 120, 174, 0.18);
    color: #222;
}
::-moz-selection {
    background: rgba(0, 120, 174, 0.18);
    color: #222;
}

/* Umformulierungsbutton Styles */
.umformulierungsBtn {
    background: var(--grau3) !important;
    color: var(--grau5) !important;
    margin-top: 12px !important;
    font-size: 0.9rem !important;
    border: none !important;
    border-radius: 5px !important;
}

/* Norm-Button fokussiert */
.normButton.focused {
    background: var(--hauptfarbe) !important;
    color: #fff !important;
}

/* Wrapper Styles */
.eingabeLosBtnWrapper {
    display: flex !important;
    justify-content: flex-end !important;
    margin-top: 10px !important;
}

.eingabeLosBtnWrapper.hidden {
    display: none !important;
}

/* Header Wrapper */
.headerWrapper {
    display: flex !important;
    align-items: center !important;
}

/* Icon Styles */
.clickIcon {
    color: var(--hauptfarbe) !important;
    user-select: none !important;
    transform: translate(0px, -6px) !important;
    margin-left: 6px !important;
}

/* Paragraphen Kopf */
.paragraphHeader.hauptColor {
    margin-bottom: 10px !important;
    cursor: pointer !important;
    margin-right: 10px;
}

/* RAG-Ergebnisse Styles */
.ragErgebnisWrapper {
    padding: 8px 0;
    /* cursor: pointer; */
    transition: background-color 0.2s;
}

.ragErgebnisWrapper.googleApiSortiert {
    font-weight: 400;
}

/* RAG Fullscreen Modal Styles */
.ragFullscreenModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.ragModalInhalt {
    background: #fff;
    border-radius: 8px;
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.ragModalHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px 15px 25px;
    border-bottom: 1px solid var(--border-color);
    background: var(--grau2);
    border-radius: 8px 8px 0 0;
}

.ragModalSchliessenBtn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--grau5);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
}


.ragModalText {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
    line-height: 1.2;
    font-size: 0.9rem;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Toggle-Button für RAG-Ergebnis Container */
.ragSchliessenBtn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: var(--grau3);
    color: var(--hauptfarbe);
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: bold;
    font-family: 'Inter';
    cursor: pointer;
    font-size: 0.7rem;
    transition: background-color 0.2s, color 0.2s;
    z-index: 5;
}

.ragSchliessenBtn:hover {
    background-color: var(--hauptfarbe);
    color: white;
}

/* RAG Container Animation und Styling - VEREINFACHT */
@keyframes slideDown {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 150px;
        opacity: 1;
    }
}

#ragErgebnis {
    position: relative;
    transition: max-height 0.5s ease-out;
    overflow: hidden;
}

/* Initiales Erscheinen - Animation */
#ragErgebnis.show-animation {
    animation: slideDown 0.5s ease-out forwards;
}

/* Minimierter Zustand */
#ragErgebnis.ragMinimiert {
    height: 150px;
    max-height: 150px;
    overflow: hidden;
    mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
}

/* Expandierter Zustand */
#ragErgebnis:not(.ragMinimiert) {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    mask-image: none !important;
    -webkit-mask-image: none !important;
}

/* Verlaufs-Indikator am unteren Rand nur im minimierten Zustand */
#ragErgebnis.ragMinimiert::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.8) 60%, white);
    pointer-events: none; /* Damit Klicks durchgehen */
    z-index: 2;
}

@media (max-width: 600px) {
    .ragModalInhalt {
        width: 95vw;
        max-height: 95vh;
    }
    
    .ragModalHeader {
        padding: 15px 20px 10px 20px;
    }
    
    .ragModalText {
        padding: 20px;
        font-size: 0.8rem;
    }
}

/* Umformulierungsbutton mittig in der weisseKarte */
.weisseKarte .umformulierungsBtn {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-top: 18px !important;
}

/* Bayern-Checkbox Wrapper Styles */
#bayernCheckboxWrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: #666;
    cursor: pointer;
    user-select: none;
}