#chatbot-button {
    position: fixed;
    /*bottom: 5.2rem;
    right: 4.5rem;*/
    bottom: 9rem;
    right: 0.95rem;
    background: white;
    color: white;
    border-radius: 50%;
    border: 0px solid rgb(0, 72, 118);
    height: 2.7rem;
    width: 2.7rem;
    cursor: pointer;
    z-index: 9999;
    box-shadow: grey 1px 1px 10px 1px;
    background-image: url("../../Images/white_speech_bubble3.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 60%;
    background-color: rgb(0, 72, 118);
    transition: bottom 0.5s ease-out, background-color 0.2s ease;
    animation: colorPulse 1s infinite alternate;
    /*display: none;*/
}

@keyframes colorPulse {
    0% {
        background-color: #004876;       /* dunkelblau */
    }
    100% {
        background-color: rgb(192,31,80); /* pink */
    }
}

#chatbot-modal.hidden {
    display: none;
}

#chatbot-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
}

.chatbot-transparent-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4); /* Abdunkelung */
}

.chatbot-window {
    position: absolute;
    bottom: 60px;
    right: 20px;
    width: 600px;
    height: 80vh;
    max-width: 90vw;
    max-height: 80vh;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
}

.chatbot-window:focus {
    outline: none;
}


.chatbot-header {
    background-color: #004877; /* UdS Blau */
    color: #fff;
    font-weight: bold;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1;
}

.chatbot-close-btn:hover {
    color: #ccc;
}

#chatbot-container {
    flex: 1 1 auto;
    height: 100%;
    width: 100%;
    display: flex;
}

#chatbot-container iframe {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    border: none;
}

/* Scroll-Lock wenn Chat offen */
body.chatbot-no-scroll {
    overflow: hidden;
}

@media (max-width: 768px) {
    .chatbot-window {
        width: 90vw;
        height: 80vh;
        right: 5%;
        bottom: 5%;
    }

    #chatbot-button {
        background-size: 50%;
        height: 3.7rem;
        width: 3.7rem;
    }
}

.header__main-bar--searchbox, .header__main-bar--searchbox.decentral {
    display: none;
}

.switch {
    position: relative;
    width: 100px; /* Erhöht von 100px */
    height: 38px; /* Erhöht von 32px */
    background: #081D36;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
    font-size: 12px;
    font-family: sans-serif;
    overflow: hidden;
}

.switch:focus-visible {
    outline: 2px solid #0056b3;
    outline-offset: 3px;
    border-radius: 4px;
}


/******************** KI-Suche Toggle - Schrift 16px & Größerer Switch ********************/

.search-toggle-checkbox {
    display: none !important;
}

.header__main-bar--searchbox .search-form__button {
    display: none !important;
}

.search-form.header {
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
    width: 100%;
}

.header__main-bar--searchbox .search-form__input {
    border-radius: 10px;
    background-image: url("/typo3conf/ext/uni_saarland/Resources/Public/Icons/Suche.svg");
    background-position: 93% center;
    background-position: 5% center;
    background-repeat: no-repeat;
}

.search-form__input.has-text, .search-form__input:focus {
    background-image: none !important;
}

.forms-wrapper {
    flex: 0 1 auto;
}

/* 2. DER SCHALTER (SWITCH) - GRÖSSE ANGEPASST */
.toggle-container {
    flex: 0 0 auto;
}



/* Der farbige Springer (Slider) */
.slider {
    position: absolute;
    height: 85%; /* Etwas kleinerer Abstand zum Rand für moderne Optik */
    width: 48%;
    width: 45%;
    background-color: #C01F50;;
    #background-color: gray;
    border-radius: 10px;
    z-index: 1;
    left: 2px;
    left: 4px;

    /* STARTPOSITION: LINKS (KI) */
    transform: translateX(0px);

    /* Smooth-Snap Transition */
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.2);
}

/* Texte im Schalter */
.text-left {
    position: relative;
    color: white;
    z-index: 2;
    width: 50%;
    text-align: center;
    pointer-events: none;
    line-height: 40px; /* Zentriert die 16px Schrift vertikal zur Schalterhöhe */
    transition: all 0.2s ease;
}

.text-right {
    position: relative;
    color: white;
    z-index: 2;
    width: 50%;
    text-align: center;
    pointer-events: none;
    line-height: 40px; /* Zentriert die 16px Schrift vertikal zur Schalterhöhe */
    transition: all 0.2s ease;
}


/* 3. LOGIK: STANDARD-ZUSTAND (KI AKTIV) */
.solr-form { display: none !important; }
.chatbot-form { display: flex !important; }

.text-left { font-weight: bold; opacity: 1; }
.text-right { font-weight: normal; opacity: 1; }

/* 4. LOGIK: WECHSEL ZUR SUCHE (Checked) */

/* Springer springt nach RECHTS (Berechnet auf neue Breite) */
.search-toggle-checkbox:checked ~ .toggle-container .slider {
    transform: translateX(52px); /* Angepasst an 110px Gesamtbreite */
}

/* Formulare tauschen */
.search-toggle-checkbox:checked ~ .forms-wrapper .solr-form {
    display: flex !important;
}
.search-toggle-checkbox:checked ~ .forms-wrapper .chatbot-form {
    display: none !important;
}

/* Texte umschalten */
.search-toggle-checkbox:checked ~ .toggle-container .text-right {
    opacity: 1;
    font-weight: bold;
}
.search-toggle-checkbox:checked ~ .toggle-container .text-left {
    opacity: 1;
    font-weight: normal;
}

/******************** Tooltip Styling ********************/

.toggle-container {
    position: relative;
}

/* Die Sprechblase */
.toggle-container::before {
    content: attr(data-tooltip); /* Holt den Text aus dem HTML */
    position: absolute;
    bottom: 125%; /* Erscheint über dem Schalter */
    left: 0%;
    transform: translateX(-50%) translateY(10px);
    padding: 8px 12px;
    background-color: #F1F1F1;
    border: 0px solid #000;
    border-color: #000;
    color: #000;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Anzeigen bei Hover */
.toggle-container:hover::before,
.toggle-container:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/************************************* media breakpoints *******************************************/

@media (min-width: 768px) {
    #chatbot-button {
        bottom:calc(200px - 7vw);
        width: 5.2rem;
        height: 5.2rem;
        right: 5.5rem;
    }
    .header__main-bar--searchbox {
        display: inline-flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 15px;
        margin-right: 7.25rem!important;
    }
    .header__main-bar--searchbox.decentral {
        display: inline-flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 15px;
        margin-right: 6.25rem!important;
        margin-top: -5px!important;
        margin-top: 2px !important;
    }
}

@media (min-width: 1250px) {
    .header__main-bar--searchbox {
        margin-right: 1.75rem !important;
    }
    .header__main-bar--searchbox.decentral {
        margin-right: 10.75rem !important;
    }
    .switch {
        font-size: 14px;
        width: 105px; /* Erhöht von 100px */
        height: 43px; /* Erhöht von 32px */
        padding: 0 2px;
    }
}

@media (min-width: 1350px) {
    .header__main-bar--searchbox {
        margin-right: 3.75rem !important;
    }
    .header__main-bar--searchbox.decentral {

    }
}

@media (min-width: 1790px) {
    #chatbot-button {
        bottom: 0.875rem;
    }
}

@media (max-width: 480px) {
    #chatbot-button {
        background-size: 50%;
    }
}