.advanced-search-container {
    max-width: 834px;
    position: relative;
    margin: 0.5em;
    width: 834px;
}

@media screen and (max-width: 1279px) {
    .advanced-search-container {
        width: 100%;
    }
}

.search-wrapper {
    display: flex;
    border-radius: 30px;
    overflow: visible;
    box-shadow: 0px 1px 3px 0px rgba(0,0,0, 0.1), 0px 1px 2px -1px rgba(0,0,0, 0.1);
    position: relative;
    background-color: #fff;
    transition: box-shadow 0.3s ease;
}

.search-wrapper:hover {
    box-shadow: 0px 1px 10px 0px rgba(0,0,0, 0.05), 0px 1px 10px -1px rgba(0,0,0, 0.05);
}

/* Hide original select element */
#search-subject {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.search-field-wrapper {
    flex-grow: 1;
    position: relative;
}

#search-input {
    width: 100%;
    height: 50px;
    padding: 0 15px 0 45px;
    border: none;
    font-size: 18px;
    outline: none;
    border-radius:30px 0px 0px 30px;
    background-color: white;
}

#search-input::placeholder {
    color: var(--teal-700);
}

/* Styling für den Clear-Button des Search-Inputs */
#search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23777'><path d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/></svg>") no-repeat center;
    cursor: pointer;
    margin-right: 10px;
}

#search-input::-webkit-search-cancel-button:hover {
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333'><path d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/></svg>") no-repeat center;
}

/* Für Firefox */
#search-input::-moz-search-clear-button {
    -moz-appearance: none;
    height: 20px;
    width: 20px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23777'><path d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/></svg>") no-repeat center;
    cursor: pointer;
    margin-right: 10px;
}

#search-input::-moz-search-clear-button:hover {
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333'><path d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/></svg>") no-repeat center;
}

.search-field-wrapper::before {
    content: "\f4a5";
    font-family: Ionicons;
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-color: transparent;
    line-height:1;
    font-size: 20px;
    color: var(--teal-700);
    pointer-events: none;
    font-weight: 400;
    font-style: normal;
    font-variant: normal;
}

.search-button {
    background-color: var(--teal-700);
    color: white;
    height: 50px;
    border: none;
    padding: 0 40px 0 30px;
    cursor: pointer;
    border-radius: 0 30px 30px 0;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button:hover {
    background-color: #166262;
}

.search-button svg {
    fill: white;
}

/* Mobile Styles für den Such-Button */
@media screen and (max-width: 767px) {
    .search-button {
        padding: 0 30px;
        min-width: 50px;
    }
    
    .search-button span {
        display: none;
    }
    
    .search-button::before {
        content: "\f4a5";
        font-family: Ionicons;
        font-size: 25px;
        color: white;
    }
}

/* Der Container wird jetzt mit position: fixed gesetzt */
#search-suggestions {
    background-color: white;
    border-radius: 0 0 4px 4px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 2px 2px 5px -1px rgba(0,0,0, 0.2);
    right: 0;
    display: none; /* Standardmäßig ausgeblendet */
    max-width: 792px;
    margin: 0px 22px;
    border-top: 2px solid #edf7f7;
    scrollbar-width: auto;
    scrollbar-color: var(--teal-700) #f0f0f0; /* Hellerer Hintergrund für bessere Sichtbarkeit */
}

@media screen and (max-width: 767px) {
    #search-suggestions {
        display: none !important;
    }
    
    .search-field-wrapper {
        border-radius: 30px !important;
    }
}

/* Webkit (Chrome, Safari, Edge) */
#search-suggestions::-webkit-scrollbar {
    width: 20px !important; /* Erzwinge die Breite */
}

#search-suggestions::-webkit-scrollbar-track {
    background: transparent;
}

#search-suggestions::-webkit-scrollbar-thumb {
    background-color: var(--teal-700);
    border-radius: 3px;
}

#search-suggestions::-webkit-scrollbar-thumb:hover {
    background-color: var(--teal-800);
}

/* IE */
#search-suggestions {
    -ms-overflow-style: auto;
}

#search-suggestions.show {
    display: block; /* Wird angezeigt, wenn die Klasse 'show' hinzugefügt wird */
}

@media screen and (max-width: 1279px) {
    #search-suggestions {
        max-width: 552px;
    }
}

/* Verbesserte Styles für die Vorschlagselemente */
.suggestion-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background-color: #f5f5f5;
}

.suggestion-item img, 
.suggestion-item .placeholder-icon,
.suggestion-item .suggestion-image {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
    box-shadow: 0 0 1px 0 rgba(0,0,0,0.1);
    border: 1px solid var(--base-ultra-light);
    background-color: white;
}

.suggestion-item .placeholder-icon {
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    color: var(--teal-500);
}

.suggestion-title {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
}

.suggestion-cat {
    font-size: 10px;
    background-color: #efefef;
    line-height: 1;
    padding: 6px 12px;
    border-radius: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
    flex-shrink: 0;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus states for accessibility */
#search-input:focus,
.choices-advanced-search.is-focused .choices__inner {
    box-shadow: 0 0 0 2px rgba(30, 125, 125, 0.2);
}

.search-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

/* Choices.js Custom Styles */
.choices-advanced-search {
    margin-bottom: 0;
    font-size: var(--text-m);
    position: relative;
    width: 210px;
    opacity: 1;
    visibility: visible;
    cursor: pointer;
}

.choices-advanced-search .choices__inner {
    background-color: var(--white-trans-90);
    border: none;
    border-left: 2px solid #edf7f7;
    border-radius: 0;
    min-height: 50px;
    padding: 0;
    height: 50px;
    display: flex;
    align-items: center;
}

.choices-advanced-search:focus-visible {
    outline-offset: 0;
    outline-width: 0!important;
    outline-color: transparent;
    outline: none!important;
    outline-style: none!important;
}
.choices-advanced-search:after {
    content: "\f3d0";
    font-family: Ionicons;
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    text-align: center; 
    font-size: 20px;
    color: var(--teal-700);
    pointer-events: none;
    font-weight: 400;
    font-style: normal;
    font-variant: normal;
    transition: transform 0.2s ease;
    transform-origin: center center;
}

.choices-advanced-search.is-open:after {
    transform: translateY(-50%) rotate(180deg);
}

.choices-advanced-search .choices__list--single {
    padding: 0 30px 0 15px;
    color: var(--teal-700);
}

/* Überschreibe die Standard-CSS von Choices.js */
.choices-advanced-search .choices__list--dropdown,
.choices-advanced-search .choices__list[aria-expanded] {
    position: fixed !important;
    max-height: calc(100vh - var(--dropdown-top, 0px));
    overflow-y: auto;
}

.choices-advanced-search .choices__list--dropdown {
    display: none;
    visibility: hidden;
    opacity: 0;
}
.is-flipped .choices__list--dropdown, .is-flipped .choices__list[aria-expanded] {
    bottom:auto;
}
.choices-advanced-search.is-open .choices__list--dropdown {
    display: block;
    visibility: visible;
    opacity: 1;
    border: none;
    box-shadow: -1px 1px 10px -1px rgba(0,0,0, 0.1);
    border-radius: 0 0 4px 4px;
    margin-top: 0;
    background-color: var(--white-trans-90);
    min-width: 280px;
    width: auto;
    left: 0;
    right: auto;
    z-index: 999999;
    transform: none;
}

.choices__list--dropdown .choices__list, .choices__list[aria-expanded] .choices__list {
   display: flex;
   flex-direction: column;
}

/* JavaScript wird die genaue Position setzen */

.choices-advanced-search .choices__list--dropdown .choices__item--selectable {
    padding: 7px 12px;
    font-size: 15px;
    line-height: 1.6;
    border-bottom: 1px solid #edf7f7;
}

.choices-advanced-search .choices__list--dropdown .choices__item--selectable.is-highlighted {
    background-color: var(--teal-200);
    color: var(--teal-700);
}

.choices-advanced-search[data-type*="select-one"] .choices__inner {
    padding-bottom: 0;
}

.choices__item.choices__placeholder {
    color: var(--teal-700);
    opacity: 1;
    font-size: 18px;
}

.choices__list--single .choices__item {
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    hyphens: auto;
  -webkit-hyphens: auto; /* Für Safari */
  -ms-hyphens: auto; 
}

/* Deaktiviere Silbentrennung im Choices.js Dropdown */
.choices__list--dropdown .choices__item {
    hyphens: none;
    -webkit-hyphens: none;
    -moz-hyphens: none;
    -ms-hyphens: none;
    word-break: keep-all;
}

/* Verstecke die Fachbereichsauswahl auf mobilen Geräten */
@media screen and (max-width: 1023px) {
    .choices-advanced-search {
        display: none !important;
    }
}

.more-results {
    display: flex;
    justify-content: center;
    padding: 8px 20px;
    transition: background-color 0.3s ease;
    background-color: var(--teal-700);
    cursor: pointer;
    gap: 10px;
}

.more-results:hover {
    background-color: var(--teal-800);
}

.more-results-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-weight: 400;
    font-size: 16px;
    gap:7px;
}

.more-results-link i {
    color: white;
    fill: white;
    font-size: var(--text-m);
}