/**
 * Responsive Search Widget Styles
 * 
 * @package LebeBewusst
 * @since 1.0.0
 */

/* === RESPONSIVE SEARCH WIDGET === */
.lb-responsive-search {
    position: relative;
    width: 100%;
}

/* === MOBILE VERSION (bis 1099px) === */
.lb-search-mobile {
    display: block;
}

.lb-search-mobile-trigger {
    background: transparent;
    color: var(--lb-primary, #191970);
    border: none;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: none;
    transition: all 0.2s ease;
    min-width: 40px;
    min-height: 40px;
    width: 40px;
    height: 40px;
}

.lb-search-mobile-trigger:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

.lb-search-mobile-trigger i {
    font-size: 1.1em;
    display: block;
    width: 20px;
    height: 20px;
}

/* Fallback SVG für mobile Geräte */
.lb-search-mobile-trigger .lb-search-icon-fallback {
    width: 35px;
    height: 35px;
    color: inherit;
    display: none;
}

/* Fallback wenn Elementor Icon nicht lädt */
.lb-search-mobile-trigger i.eicon-search:empty,
.lb-search-mobile-trigger i.eicon-search:not([style*="font-family"]) {
    display: none;
}
.lb-search-mobile-trigger i.eicon-search:empty + .lb-search-icon-fallback,
.lb-search-mobile-trigger i.eicon-search:not([style*="font-family"]) + .lb-search-icon-fallback {
    display: block !important;
}

/* Mobile Popup */
.lb-search-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.lb-search-popup.open {
    display: flex !important;
}

.lb-search-popup .box {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    width: min(900px, 92%);
    padding: 12px;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.lb-search-popup .field {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.lb-search-popup .lb-search-input-wrapper,
.lb-search-popup .lb-location-input-wrapper,
.lb-search-popup .lb-event-type-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    min-width: 200px;
}

.lb-search-popup .lb-search-input-wrapper {
    flex: 2;
}

.lb-search-popup input {
    width: 100%;
    height: 54px;
    border: none;
    outline: none;
    background: transparent;
    padding: 0 16px 0 52px;
    font-size: 16px;
    color: var(--lb-primary, #191970);
    border-radius: 14px;
    transition: all 0.3s ease;
}

.lb-search-popup input:focus {
    background: rgba(240,152,25,.05);
}

.lb-search-popup .lb-event-type-select {
    width: 100%;
    height: 54px;
    border: none;
    outline: none;
    background: transparent;
    padding: 0 16px 0 52px;
    font-size: 16px;
    color: var(--lb-primary, #191970);
    border-radius: 14px;
    transition: all 0.3s ease;
    appearance: none;
    cursor: pointer;
}

.lb-search-popup .lb-event-type-select:focus {
    background: rgba(240,152,25,.05);
}

.lb-search-popup input::placeholder {
    color: rgba(25, 25, 112, 0.6);
    font-weight: 400;
}

.lb-search-popup .lb-search-icon,
.lb-search-popup .lb-location-icon,
.lb-search-popup .lb-event-type-icon {
    position: absolute;
    left: 20px;
    color: var(--lb-primary, #191970);
    opacity: 0.6;
    z-index: 2;
    width: 20px;
    height: 20px;
}

/* Trennlinie zwischen den Inputs */
.lb-search-popup .lb-location-input-wrapper::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 30px;
    background: rgba(25, 25, 112, 0.2);
}

.lb-search-popup .lb-search-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background-image: linear-gradient(to right, #F09819 0%, #EDDE5D 51%, #F09819 100%);
    margin: 0;
    padding: 14px 24px;
    text-align: center;
    text-transform: uppercase;
    transition: all 0.3s ease;
    background-size: 200% auto;
    color: white;
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(240, 152, 25, 0.28);
    border: none;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.5px;
    cursor: pointer;
    white-space: nowrap;
    height: 54px;
    min-width: 140px;
}

.lb-search-popup .lb-search-button:hover {
    background-position: right center;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(240, 152, 25, 0.4);
}

.lb-search-popup .lb-btn-icon {
    transition: transform 0.2s ease;
    width: 16px;
    height: 16px;
}

.lb-search-popup .lb-search-button:hover .lb-btn-icon {
    transform: translateX(2px);
}

/* === DESKTOP VERSION (ab 1100px) === */
.lb-search-desktop {
    display: none;
    background: #fff;
    border-radius: 25px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    padding: 3px;
    border: 1px solid rgba(0,0,0,.08);
    transition: all 0.3s ease;
    max-width: 400px;
}

.lb-search-desktop:hover,
.lb-search-desktop:focus-within {
    box-shadow: 0 4px 20px rgba(0,0,0,.1);
    border-color: rgba(240,152,25,.3);
}

.lb-search-desktop .field {
    display: flex;
    gap: 4px;
    align-items: center;
}

.lb-search-desktop .lb-search-input-wrapper,
.lb-search-desktop .lb-location-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.lb-search-desktop .lb-search-input-wrapper {
    flex: 2;
}

.lb-search-desktop input {
    width: 100%;
    height: 40px;
    border: none;
    outline: none;
    background: transparent;
    padding: 0 15px 0 15px;
    font-size: 15px;
    color: var(--lb-primary, #191970);
    border-radius: 25px;
    transition: background-color 0.2s ease;
}

.lb-search-desktop input:focus {
    background: rgba(240,152,25,.05);
}

.lb-search-desktop .lb-search-icon,
.lb-search-desktop .lb-location-icon {
    position: absolute;
    left: 15px;
    color: var(--lb-primary, #191970);
    opacity: .6;
    z-index: 2;
    width: 16px;
    height: 16px;
}

.lb-search-desktop .lb-search-button {
    background: linear-gradient(to right, #EDDE5D 0%, #F09819 100%) !important;
    border: none;
    color: var(--lb-primary, #191970);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.lb-search-desktop .lb-search-button:hover {
    background: rgba(240,152,25,.1);
    color: var(--lb-accent, #F09819);
    transform: scale(1.05);
}

/* === RESPONSIVE BREAKPOINTS === */
@media (max-width: 1150px) {
    .lb-search-desktop {
        display: none !important;
    }
    .lb-search-mobile {
        display: block !important;
    }
    .search-icon-btn {
        width: 60px !important;
    }
}

@media (min-width: 1151px) {
    .lb-search-mobile {
        display: none !important;
    }
    .lb-search-desktop {
        display: block !important;
    }
}

/* Mobile Popup responsive adjustments */
@media (max-width: 600px) {
    .lb-search-popup .field {
        flex-direction: column;
        gap: 12px;
    }
    
    .lb-search-popup .lb-search-input-wrapper,
    .lb-search-popup .lb-location-input-wrapper {
        width: 100%;
        min-width: auto;
    }
    
    .lb-search-popup .lb-search-button {
        width: 100%;
        min-width: auto;
    }
    
    .lb-search-popup .lb-location-input-wrapper::before {
        display: none;
    }
}

/* Desktop responsive adjustments - kompakte Version */
@media (max-width: 1300px) and (min-width: 1100px) {
    .lb-search-desktop {
        max-width: 350px;
    }
    
    .lb-search-desktop input {
        font-size: 14px;
        padding: 0 12px 0 38px;
    }
    
    .lb-search-desktop .lb-search-icon,
    .lb-search-desktop .lb-location-icon {
        left: 12px;
        width: 14px;
        height: 14px;
    }
}

@media (min-width: 1151px) {
    .lb-search-desktop .lb-location-input-wrapper {
        display: none; /* Desktop: Nur ein Suchfeld für alles */
    }
}

/* === FILTER-CHIPS STYLES (nur für Tablet und Mobile) === */
.lb-responsive-search .lb-filter-chips {
    display: none;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
    align-items: center;
    animation: lb-rs-slideDown 0.3s ease;
}

/* Filter-Chips standardmäßig sichtbar wenn Popup geöffnet ist */
@media (max-width: 1150px) {
    .lb-search-popup.open .lb-filter-chips {
        display: flex !important;
    }
    
    .lb-responsive-search.chips-open .lb-filter-chips,
    .lb-responsive-search.active .lb-filter-chips {
        display: flex !important;
    }

    .lb-search-popup:focus-within .lb-filter-chips,
    .lb-search-popup .field:focus-within + .lb-filter-chips {
        display: flex !important;
    }
}

/* Desktop: Filter-Chips komplett verstecken */
@media (min-width: 1151px) {
    .lb-responsive-search .lb-filter-chips {
        display: none !important;
    }
}

@keyframes lb-rs-slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.lb-responsive-search .lb-filter-dropdown {
    position: relative;
}

.lb-responsive-search .lb-filter-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid rgba(25, 25, 112, 0.2);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    color: var(--lb-primary, #191970);
    white-space: nowrap;
}

.lb-responsive-search .lb-filter-chip:hover {
    background: rgba(240, 152, 25, 0.1);
    border-color: rgba(240, 152, 25, 0.3);
}

.lb-responsive-search .lb-filter-chip.active {
    background: var(--lb-primary, #191970);
    border-color: var(--lb-primary, #191970);
    color: white;
}

.lb-responsive-search .lb-filter-chip svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--lb-primary, #191970);
}

.lb-responsive-search .lb-filter-chip.active svg {
    color: white;
}

.lb-responsive-search .lb-filter-label {
    font-weight: 500;
    color: var(--lb-primary, #191970);
}

.lb-responsive-search .lb-filter-value {
    font-weight: 600;
    color: var(--lb-primary, #191970);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lb-responsive-search .lb-filter-chip.active .lb-filter-label,
.lb-responsive-search .lb-filter-chip.active .lb-filter-value {
    color: white;
}

.lb-responsive-search .lb-dropdown-arrow {
    width: 12px;
    height: 12px;
    margin-left: 4px;
    transition: transform 0.2s ease;
    color: var(--lb-primary, #191970);
}

.lb-responsive-search .lb-filter-chip.active .lb-dropdown-arrow {
    color: white;
}

.lb-responsive-search .lb-dropdown-trigger.active .lb-dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown-Menüs */
.lb-responsive-search .lb-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 4px;
}

.lb-responsive-search .lb-dropdown-menu.show {
    display: block;
    animation: lb-rs-fadeIn 0.2s ease;
}

@keyframes lb-rs-fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.lb-responsive-search .lb-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 13px;
    color: var(--lb-primary, #191970);
}

.lb-responsive-search .lb-dropdown-item:hover {
    background: rgba(240, 152, 25, 0.1);
}

.lb-responsive-search .lb-dropdown-item.active {
    background: var(--lb-primary, #191970);
    color: white;
}

.lb-responsive-search .lb-dropdown-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--lb-primary, #191970);
}

.lb-responsive-search .lb-dropdown-item.active svg {
    color: white;
}

.lb-responsive-search .lb-clear-all-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: none;
    border: 1px solid rgba(25, 25, 112, 0.2);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    color: var(--lb-primary, #191970);
    margin-left: auto;
}

.lb-responsive-search .lb-clear-all-filters:hover {
    background: rgba(240, 152, 25, 0.1);
    border-color: rgba(240, 152, 25, 0.3);
    color: var(--lb-primary, #191970);
}

.lb-responsive-search .lb-clear-all-filters svg {
    color: var(--lb-primary, #191970);
}

