/* WP Immo Search - Search Filter Styles (Simple Clean Design) */

/* ==========================================================================
   CONTAINER & FORM
   ========================================================================== */

.wp-immo-search-filter-container {
    margin-bottom: 32px;
}

.immo-search-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ==========================================================================
   GRID LAYOUT
   ========================================================================== */

.filter-row {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 20px;
    align-items: end;
}

/* Main filters (25% = 2 columns each) */
.filter-group[data-filter="objektart"],
.filter-group[data-filter="vermarktungsart"],
.filter-group[data-filter="location"],
.filter-group[data-filter="radius"] {
    grid-column: span 2;
}

/* Secondary filters (12.5% = 1 column each) */
.filter-group[data-filter="area"],
.filter-group[data-filter="rooms"],
.filter-group[data-filter="price"],
.filter-group[data-filter="objektnummer"],
.search-button-group {
    grid-column: span 1;
}

.filter-group {
    position: relative;
}

/* ==========================================================================
   INPUT & SELECT STYLING
   ========================================================================== */

.filter-group input[type="text"],
.filter-group input[type="number"],
.select-wrapper select {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid #aaa;
    border-radius: 3px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    color: #333;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.select-wrapper select {
    padding-right: 40px;
    cursor: pointer;
}

.filter-group input[type="text"]:focus,
.filter-group input[type="number"]:focus,
.select-wrapper select:focus {
    outline: none;
    border-color: var(--ci-color);
}

.filter-group input[type="text"]::placeholder,
.filter-group input[type="number"]::placeholder {
    color: #666;
    font-size: 14px;
    padding-left: 0;
}

/* ==========================================================================
   SELECT WRAPPER & ARROW
   ========================================================================== */

.select-wrapper {
    position: relative;
    width: 100%;
}

.select-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* ==========================================================================
   LOCATION AUTOCOMPLETE
   ========================================================================== */

.location-input-wrapper {
    position: relative;
    width: 100%;
}

/* Clear X button für Location Input */
.location-input-wrapper input[type="text"] {
    padding-right: 40px;
}

.location-clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: #999;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s;
}

.location-clear-btn:hover {
    background: #666;
}

.location-clear-btn::before,
.location-clear-btn::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 2px;
    background: white;
}

.location-clear-btn::before {
    transform: rotate(45deg);
}

.location-clear-btn::after {
    transform: rotate(-45deg);
}

.location-clear-btn.show {
    display: flex;
}

.location-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.location-suggestions.show,
.location-suggestions.active {
    display: block;
}

.location-suggestion {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #333;
}

.location-suggestion:hover,
.location-suggestion.active {
    background: #f8f9fa;
    color: var(--ci-color);
}

/* ==========================================================================
   SEARCH BUTTON
   ========================================================================== */

.search-button {
    width: 100%;
    height: 48px;
    background: var(--ci-color);
    border: 1px solid var(--ci-color);
    border-radius: 0;
    color: white;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    text-transform: uppercase;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
    box-shadow: none;
}

.search-button:hover {
    background: var(--wp-immo-ci-color-hover, #8a7a5f);
    border-color: var(--wp-immo-ci-color-hover, #8a7a5f);
    box-shadow: none;
    transform: none;
}

.search-button:focus {
    outline: none;
    box-shadow: none;
}

/* ==========================================================================
   DEBUG INFO
   ========================================================================== */

.wp-immo-debug-filter-info {
    border-left: 3px solid var(--ci-color);
    font-family: monospace;
    line-height: 1.4;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 1200px) {
    .filter-row {
        flex-wrap: wrap;
        gap: 12px;
    }

    .filter-row .filter-group {
        flex: 1 1 calc(50% - 6px);
    }
}

@media (max-width: 768px) {
    .filter-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .filter-group {
        grid-column: span 1;
    }

    .filter-group input,
    .select-wrapper select,
    .search-button {
        height: 48px;
        font-size: 16px;
    }
}

/* Debug Info */
.wp-immo-debug-filter-info {
    background: #f0f0f0;
    padding: 10px;
    margin-top: 10px;
    border-radius: 0;
    font-size: 12px;
    color: #666;
}

.wp-immo-debug-filter-info strong {
    font-weight: 600;
}

/* ==========================================================================
   MOBILE FILTER SLIDE-IN (< 768px only)
   ========================================================================== */

/* Hide mobile elements on desktop */
@media (min-width: 1025px) {
    .mobile-filter-toggle,
    .mobile-filter-overlay,
    .mobile-filter-close {
        display: none !important;
    }
}

/* Mobile & Tablet Styles */
@media (max-width: 1024px) {
    /* Mobile Filter Toggle Button - VERSTECKT (wird durch Modal-Icons ersetzt) */
    .mobile-filter-toggle {
        display: none !important;
    }
    
    .mobile-filter-toggle svg {
        width: 22px;
        height: 22px;
        stroke: var(--ci-color);
    }
    
    .mobile-filter-toggle:active {
        background: #f8f9fa;
    }
    
    /* Overlay */
    .mobile-filter-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1001;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .mobile-filter-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Slide-In Container */
    .wp-immo-search-filter-container {
        position: fixed;
        top: 0;
        left: -85%;
        width: 85%;
        height: 100%;
        background: white;
        z-index: 1002;
        overflow-y: auto;
        transition: left 0.3s ease;
        padding: 60px 20px 20px;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
    }
    
    .wp-immo-search-filter-container.active {
        left: 0;
    }
    
    /* Close Button */
    .mobile-filter-close {
        position: absolute;
        top: 15px;
        right: 15px;
        background: transparent;
        border: none;
        color: #666;
        cursor: pointer;
        padding: 5px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-filter-close:hover {
        color: #333;
    }
    
    /* Filter Form Anpassungen */
    .filter-row {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 15px !important;
    }

    .filter-group {
        width: 100% !important;
        flex-basis: 100%;
    }

    /* Von/Bis Felder nebeneinander (50/50) */
    .filter-group[data-filter="price"],
    .filter-group[data-filter="rooms"],
    .filter-group[data-filter="area"] {
        width: calc(50% - 7.5px) !important;
        flex-basis: calc(50% - 7.5px);
    }

    .search-button-group {
        margin-top: 5px;
        width: 100% !important;
        flex-basis: 100%;
    }

    .search-button {
        width: 100%;
        height: 50px;
        font-size: 16px;
    }
}
