﻿/**
 * Autocomplete / Typeahead Dropdown Fixes
 * Stellt sicher, dass die Autocomplete-Dropdowns korrekt positioniert und gestylt werden
 */

/* Verhindere, dass Input-Container das Dropdown überlagern */
.custom-input {
    position: relative !important;
    z-index: 1 !important;
}

/* Wichtig: Form-Gruppen dürfen keinen eigenes z-index haben */
.form-group {
    position: relative !important;
    z-index: 1 !important;
}

/* WICHTIG: Dropdowns mit ng-hide Klasse verstecken */
.dropdown-menu.ng-hide,
ul[uib-typeahead-popup].ng-hide {
    display: none !important;
    visibility: hidden !important;
}

/* Typeahead Dropdown Basis-Styling */
.dropdown-menu,
ul.dropdown-menu,
ul[uib-typeahead-popup],
ul[uib-typeahead-popup].dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    z-index: 10000 !important;
    display: block !important;
    float: left !important;
    min-width: 200px !important;
    max-width: 500px !important;
    padding: 5px 0 !important;
    margin: 2px 0 0 !important;
    font-size: 14px !important;
    text-align: left !important;
    list-style: none !important;
    background-color: #ffffff !important;
    background-clip: padding-box !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    box-shadow: 0 6px 12px rgba(0,0,0,.175) !important;
    max-height: 300px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Verstecke Dropdowns die keine Items haben (über Angular gesteuert) */
ul[uib-typeahead-popup]:empty {
    display: none !important;
}

/* Typeahead Dropdown Items */
.dropdown-menu > li > a,
ul[uib-typeahead-popup] > li > a {
    display: block !important;
    padding: 10px 15px !important;
    clear: both !important;
    font-weight: normal !important;
    line-height: 1.42857143 !important;
    color: #333333 !important;
    white-space: normal !important;
    text-decoration: none !important;
    background-color: #ffffff !important;
    cursor: pointer !important;
}

/* Hover-Zustand */
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus,
ul[uib-typeahead-popup] > li > a:hover,
ul[uib-typeahead-popup] > li > a:focus {
    color: #000000 !important;
    background-color: #FFC53D !important;
    text-decoration: none !important;
}

/* Aktiver/ausgewählter Zustand */
.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover,
.dropdown-menu > .active > a:focus,
ul[uib-typeahead-popup] > .active > a,
ul[uib-typeahead-popup] > .active > a:hover,
ul[uib-typeahead-popup] > .active > a:focus {
    color: #000000 !important;
    background-color: #FFC53D !important;
    outline: 0 !important;
}

/* Spezifische Styles für Flugsuche-Autocomplete */
div#flights form#searchflight div.custom-input.full-width div.form-group .dropdown-menu {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    max-height: 200px !important;
    min-width: calc(100% - 20px) !important;
}

#flightsearch .dropdown-menu li a {
    padding: 10px 15px !important;
}

#flightsearch .dropdown-menu li a small {
    display: block !important;
    font-size: 11px !important;
    color: #666666 !important;
    margin-top: 3px !important;
}

#flightsearch .dropdown-menu li a:hover small,
#flightsearch .dropdown-menu li a:focus small,
#flightsearch .dropdown-menu li.active a small {
    color: #333333 !important;
}

/* Land-Name Styling */
#flightsearch .dropdown-menu .Country {
    display: block !important;
    padding: 8px 15px !important;
    font-weight: bold !important;
    color: #333333 !important;
}

/* SVG Icons im Autocomplete */
#flightsearch .dropdown-menu svg,
.dropdown-menu svg {
    width: 16px !important;
    height: 16px !important;
    margin-right: 8px !important;
    vertical-align: middle !important;
    display: inline-block !important;
}

/* Flughafen/Region Icon Container */
#flightsearch .dropdown-menu span[ng-if] {
    display: inline-block !important;
}

/* uib-typeahead-match Klasse */
li.uib-typeahead-match {
    list-style: none !important;
}

/* Stelle sicher, dass das Dropdown über anderen Elementen liegt */
.custom-input.full-width {
    z-index: auto !important;
}

/* Das Dropdown soll über dem nächsten Input-Feld liegen */
.custom-input:focus-within {
    z-index: 10001 !important;
}



