/**
 * @package     MuellerWeb.Module
 * @subpackage  mod_flexible_search
 * @version     1.0.0
 * @copyright   (C) 2026 Heiko Müller. All rights reserved.
 */

.fs-wrapper {
    --fs-bg: transparent;
    --fs-input-bg: #ffffff;
    --fs-text: currentColor;
    --fs-accent: #8b5e3c;
    --fs-btn-text: #ffffff;
    --fs-border: rgba(128, 128, 128, 0.32);
    --fs-input-height: 48px;
    --fs-radius: 8px;
    --fs-padding: 0px;
    --fs-max-width: 100%;
    --fs-cols-desktop: 2;
    --fs-cols-laptop: 2;
    --fs-cols-tablet-l: 2;
    --fs-cols-tablet-p: 1;
    --fs-cols-phone-l: 1;
    --fs-cols-phone-p: 1;

    width: 100%;
    max-width: var(--fs-max-width, 100%);
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box !important;
    font-family: inherit;
    color: var(--fs-text);
    position: relative;
    text-align: left;
}

.fs-wrapper *,
.fs-wrapper *::before,
.fs-wrapper *::after {
    box-sizing: border-box !important;
}

/* Hard-constrain SVG icons against Nicepage global svg {width:100%} rules */
.fs-wrapper svg.fs-svg-icon,
.fs-wrapper .fs-input-icon svg,
.fs-wrapper .fs-submit-btn svg,
.fs-wrapper .fs-clear-btn svg,
.fs-wrapper .fs-pills-bar__label svg {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    display: inline-block !important;
    vertical-align: middle !important;
    flex-shrink: 0 !important;
    fill: none;
    stroke: currentColor;
}

.fs-wrapper .fs-container {
    background: var(--fs-bg);
    padding: var(--fs-padding);
    border-radius: var(--fs-radius);
    position: relative;
}

/* Header */
.fs-wrapper .fs-header {
    margin-bottom: 14px;
}

.fs-wrapper .fs-header__title {
    margin: 0 0 4px 0 !important;
    font-size: 1.35rem !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    color: inherit;
}

.fs-wrapper .fs-header__subtitle {
    margin: 0 !important;
    font-size: 0.94rem !important;
    opacity: 0.82;
}

/* Main Search Form Bar */
.fs-wrapper .fs-form {
    margin: 0 !important;
    padding: 0 !important;
}

.fs-wrapper .fs-bar-row {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
}

.fs-wrapper.fs-btn-pos-below_full .fs-bar-row {
    flex-direction: column !important;
}

.fs-wrapper .fs-input-group {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    flex: 1 1 220px !important;
    min-height: var(--fs-input-height, 48px) !important;
    background-color: var(--fs-input-bg) !important;
    border: 1px solid var(--fs-border) !important;
    border-radius: var(--fs-radius) !important;
    padding: 3px 6px 3px 14px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fs-wrapper .fs-input-group:focus-within {
    border-color: var(--fs-accent) !important;
    box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.16) !important;
}

.fs-wrapper .fs-input-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-right: 10px !important;
    opacity: 0.55;
    flex-shrink: 0 !important;
}

.fs-wrapper .fs-input {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    color: inherit !important;
    font-size: 1rem !important;
    font-family: inherit !important;
    padding: 6px 4px !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.fs-wrapper .fs-input::placeholder {
    color: currentColor;
    opacity: 0.5;
}

/* Clear Button */
.fs-wrapper .fs-clear-btn {
    background: transparent !important;
    border: none !important;
    padding: 6px !important;
    margin: 0 2px !important;
    cursor: pointer !important;
    opacity: 0.5;
    color: inherit !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50%;
    transition: opacity 0.15s, background-color 0.15s;
}

.fs-wrapper .fs-clear-btn:hover {
    opacity: 1;
    background: rgba(128, 128, 128, 0.12) !important;
}

/* Submit Button */
.fs-wrapper .fs-submit-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    background-color: var(--fs-accent) !important;
    color: var(--fs-btn-text) !important;
    border: none !important;
    border-radius: calc(var(--fs-radius) - 2px) !important;
    padding: 8px 18px !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    transition: filter 0.18s ease, transform 0.1s ease;
    min-height: calc(var(--fs-input-height, 48px) - 8px);
}

.fs-wrapper .fs-submit-btn--outside {
    border-radius: var(--fs-radius) !important;
    min-height: var(--fs-input-height, 48px);
    padding: 8px 22px !important;
}

.fs-wrapper .fs-submit-btn:hover {
    filter: brightness(1.08);
}

.fs-wrapper .fs-submit-btn:active {
    transform: translateY(1px);
}

/* Filter Dropdowns (Category / Tag) */
.fs-wrapper .fs-select-wrap {
    display: flex !important;
    align-items: stretch !important;
    min-width: 170px;
}

.fs-wrapper .fs-filter-select {
    width: 100% !important;
    min-height: var(--fs-input-height, 48px) !important;
    background-color: var(--fs-input-bg) !important;
    color: inherit !important;
    border: 1px solid var(--fs-border) !important;
    border-radius: var(--fs-radius) !important;
    padding: 6px 14px !important;
    font-size: 0.93rem !important;
    font-family: inherit !important;
    cursor: pointer;
    outline: none;
}

.fs-wrapper .fs-filter-select:focus {
    border-color: var(--fs-accent) !important;
}

/* Quick Suggestions & Filter Pills Bars */
.fs-wrapper .fs-suggestions-bar,
.fs-wrapper .fs-pills-bar,
.fs-wrapper .fs-year-filter-bar {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    margin-top: 12px !important;
}

.fs-wrapper .fs-suggestions-bar__label,
.fs-wrapper .fs-pills-bar__label {
    font-size: 0.83rem !important;
    font-weight: 600 !important;
    opacity: 0.78;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    margin-right: 4px !important;
}

.fs-wrapper .fs-suggestions-bar__chips,
.fs-wrapper .fs-pills-list {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
}

.fs-wrapper .fs-suggestion-chip,
.fs-wrapper .fs-pill {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 4px 12px !important;
    border-radius: 999px !important;
    font-size: 0.83rem !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    background: rgba(128, 128, 128, 0.1) !important;
    color: inherit !important;
    border: 1px solid transparent !important;
    cursor: pointer !important;
    transition: all 0.15s ease;
    line-height: 1.35 !important;
}

.fs-wrapper .fs-suggestion-chip:hover,
.fs-wrapper .fs-pill:hover {
    border-color: var(--fs-accent) !important;
    background: rgba(139, 94, 60, 0.1) !important;
}

.fs-wrapper .fs-pill.is-active {
    background-color: var(--fs-accent) !important;
    color: var(--fs-btn-text) !important;
    border-color: var(--fs-accent) !important;
}

/* Year Range Filter */
.fs-wrapper .fs-year-inputs {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.fs-wrapper .fs-year-input {
    width: 86px !important;
    padding: 4px 8px !important;
    border: 1px solid var(--fs-border) !important;
    border-radius: 6px !important;
    background: var(--fs-input-bg) !important;
    color: inherit !important;
    font-size: 0.85rem !important;
}

.fs-wrapper .fs-year-reset-btn {
    background: rgba(128, 128, 128, 0.15) !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 4px 10px !important;
    font-size: 0.8rem !important;
    cursor: pointer !important;
    color: inherit !important;
}

/* ==========================================================================
   LIVE INSTANT SEARCH RESULTS
   ========================================================================== */

.fs-wrapper .fs-live-results {
    margin-top: 12px;
    background: var(--fs-input-bg, #ffffff);
    color: #1e293b;
    border: 1px solid var(--fs-border);
    border-radius: var(--fs-radius);
    box-shadow: 0 12px 32px -4px rgba(15, 23, 42, 0.14);
    overflow: hidden;
    z-index: 999;
}

.fs-wrapper.fs-live-mode-dropdown_list .fs-live-results {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 8px;
    max-height: 480px;
    overflow-y: auto;
}

.fs-wrapper .fs-live-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 16px !important;
    background: rgba(128, 128, 128, 0.06);
    border-bottom: 1px solid var(--fs-border);
    font-size: 0.83rem !important;
    font-weight: 600 !important;
}

.fs-wrapper .fs-live-close-btn {
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 0.85rem !important;
    opacity: 0.7;
    color: inherit !important;
}

/* Grid for Inline Cards Mode (6 Nicepage Breakpoints) */
.fs-wrapper.fs-live-mode-inline_cards .fs-live-items {
    display: grid !important;
    gap: 16px !important;
    padding: 16px !important;
    grid-template-columns: repeat(var(--fs-cols-desktop, 2), minmax(0, 1fr)) !important;
}

@media (max-width: 1199.98px) {
    .fs-wrapper.fs-live-mode-inline_cards .fs-live-items {
        grid-template-columns: repeat(var(--fs-cols-laptop, 2), minmax(0, 1fr)) !important;
    }
}
@media (max-width: 991.98px) {
    .fs-wrapper.fs-live-mode-inline_cards .fs-live-items {
        grid-template-columns: repeat(var(--fs-cols-tablet-l, 2), minmax(0, 1fr)) !important;
    }
}
@media (max-width: 767.98px) {
    .fs-wrapper.fs-live-mode-inline_cards .fs-live-items {
        grid-template-columns: repeat(var(--fs-cols-tablet-p, 1), minmax(0, 1fr)) !important;
    }
}
@media (max-width: 575.98px) {
    .fs-wrapper.fs-live-mode-inline_cards .fs-live-items {
        grid-template-columns: repeat(var(--fs-cols-phone-l, 1), minmax(0, 1fr)) !important;
    }
}
@media (max-width: 479.98px) {
    .fs-wrapper.fs-live-mode-inline_cards .fs-live-items {
        grid-template-columns: repeat(var(--fs-cols-phone-p, 1), minmax(0, 1fr)) !important;
    }
    .fs-wrapper.fs-mobile-icon-btn .fs-submit-btn__text {
        display: none !important;
    }
}

.fs-wrapper .fs-result-item {
    display: flex !important;
    align-items: flex-start !important;
    gap: 14px !important;
    padding: 12px 16px !important;
    border-bottom: 1px solid rgba(128, 128, 128, 0.14);
    text-decoration: none !important;
    color: inherit !important;
    transition: background-color 0.15s ease;
}

.fs-wrapper.fs-live-mode-inline_cards .fs-result-item {
    border: 1px solid rgba(128, 128, 128, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.65);
}

.fs-wrapper .fs-result-item:hover {
    background-color: rgba(139, 94, 60, 0.07) !important;
}

.fs-wrapper .fs-result-item__thumb {
    width: 68px !important;
    height: 54px !important;
    border-radius: 6px !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
    background: #e2e8f0;
}

.fs-wrapper .fs-result-item__body {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

.fs-wrapper .fs-result-item__meta {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px !important;
    margin-bottom: 3px !important;
}

.fs-wrapper .fs-badge-cat {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    padding: 2px 7px !important;
    border-radius: 4px !important;
    background: rgba(139, 94, 60, 0.14) !important;
    color: var(--fs-accent) !important;
}

.fs-wrapper .fs-badge-year {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    padding: 2px 7px !important;
    border-radius: 4px !important;
    background: #fef3c7 !important;
    color: #92400e !important;
}

.fs-wrapper .fs-result-item__title {
    font-size: 0.98rem !important;
    font-weight: 700 !important;
    margin: 0 0 4px 0 !important;
    line-height: 1.3 !important;
}

.fs-wrapper .fs-result-item__snippet {
    font-size: 0.85rem !important;
    opacity: 0.82;
    margin: 0 !important;
    line-height: 1.45 !important;
}

.fs-wrapper .fs-result-item__tags {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    margin-top: 6px !important;
}

.fs-wrapper .fs-mini-tag {
    font-size: 0.72rem !important;
    padding: 1px 6px !important;
    border-radius: 4px !important;
    background: rgba(128, 128, 128, 0.1);
    opacity: 0.85;
}

.fs-wrapper mark.fs-hl {
    background: #fef08a !important;
    color: #1e293b !important;
    padding: 0 2px !important;
    border-radius: 2px !important;
}

.fs-wrapper .fs-live-footer {
    padding: 10px 16px !important;
    text-align: center !important;
    background: rgba(128, 128, 128, 0.05);
    border-top: 1px solid var(--fs-border);
}

.fs-wrapper .fs-live-all-btn {
    background: transparent !important;
    border: none !important;
    color: var(--fs-accent) !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    cursor: pointer !important;
}

.fs-wrapper .fs-live-empty {
    padding: 20px 16px !important;
    text-align: center !important;
    font-size: 0.92rem !important;
    opacity: 0.75;
}

/* ==========================================================================
   8 DISTINCT DESIGN PRESETS
   ========================================================================== */

/* 1. Template-Vererbung Clean (Default) */
.fs-wrapper.fs-style-template_inherit {
    --fs-accent: #7c6855;
}

/* 2. Modern Pill Capsule */
.fs-wrapper.fs-style-pill_modern {
    --fs-radius: 999px;
    --fs-accent: #2563eb;
}
.fs-wrapper.fs-style-pill_modern .fs-input-group {
    padding-left: 18px !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}
.fs-wrapper.fs-style-pill_modern .fs-submit-btn--inside {
    border-radius: 999px !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
}
.fs-wrapper.fs-style-pill_modern .fs-live-results {
    border-radius: 16px !important;
}

/* 3. Historisch / Biedenkopf Heritage (Pergament & Schloss-Stil) */
.fs-wrapper.fs-style-museum_heritage {
    --fs-bg: #f6f4ef;
    --fs-input-bg: #ffffff;
    --fs-text: #3d3934;
    --fs-accent: #7c6248;
    --fs-btn-text: #ffffff;
    --fs-border: #d5cec2;
    --fs-padding: 22px;
    --fs-radius: 10px;
}
.fs-wrapper.fs-style-museum_heritage .fs-container {
    border: 1px solid #d5cec2;
    box-shadow: 0 4px 16px rgba(61, 57, 52, 0.06);
    background-image: radial-gradient(rgba(124, 98, 72, 0.04) 1px, transparent 0);
    background-size: 16px 16px;
}

/* 4. Hero-Suchbanner (Große Themen-Box für Übersichtsseiten wie Brunnen / Schutzhütten) */
.fs-wrapper.fs-style-hero_banner {
    --fs-bg: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    --fs-input-bg: #ffffff;
    --fs-text: #f8fafc;
    --fs-accent: #d97706;
    --fs-btn-text: #ffffff;
    --fs-border: rgba(255, 255, 255, 0.22);
    --fs-padding: 32px;
    --fs-radius: 14px;
    --fs-input-height: 54px;
}
.fs-wrapper.fs-style-hero_banner .fs-container {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    box-shadow: 0 14px 30px -6px rgba(15, 23, 42, 0.25);
}
.fs-wrapper.fs-style-hero_banner .fs-header {
    text-align: center;
    margin-bottom: 20px;
}
.fs-wrapper.fs-style-hero_banner .fs-header__title {
    font-size: 1.65rem !important;
    color: #ffffff !important;
}
.fs-wrapper.fs-style-hero_banner .fs-input-group {
    color: #0f172a !important;
}
.fs-wrapper.fs-style-hero_banner .fs-filter-select {
    color: #0f172a !important;
}
.fs-wrapper.fs-style-hero_banner .fs-pill,
.fs-wrapper.fs-style-hero_banner .fs-suggestion-chip {
    background: rgba(255, 255, 255, 0.14) !important;
    color: #f8fafc !important;
}
.fs-wrapper.fs-style-hero_banner .fs-pill.is-active {
    background: var(--fs-accent) !important;
    color: #ffffff !important;
}

/* 5. Minimal Underline */
.fs-wrapper.fs-style-minimal_underline .fs-input-group {
    background: transparent !important;
    border: none !important;
    border-bottom: 2px solid var(--fs-border) !important;
    border-radius: 0 !important;
    padding-left: 4px !important;
    box-shadow: none !important;
}
.fs-wrapper.fs-style-minimal_underline .fs-input-group:focus-within {
    border-bottom-color: var(--fs-accent) !important;
    box-shadow: none !important;
}

/* 6. Dark Contrast */
.fs-wrapper.fs-style-dark_contrast {
    --fs-bg: #0f1115;
    --fs-input-bg: #181b22;
    --fs-text: #f1f5f9;
    --fs-accent: #b8d818;
    --fs-btn-text: #0f1115;
    --fs-border: #2d3340;
    --fs-padding: 22px;
    --fs-radius: 10px;
}
.fs-wrapper.fs-style-dark_contrast .fs-container {
    border: 1px solid #2d3340;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}
.fs-wrapper.fs-style-dark_contrast .fs-live-results {
    background: #181b22;
    color: #f1f5f9;
}

/* 7. Kombinierte Filter-Toolbar (Split Filter Bar) */
.fs-wrapper.fs-style-split_filter_bar {
    --fs-bg: #f8fafc;
    --fs-input-bg: #ffffff;
    --fs-text: #1e293b;
    --fs-accent: #2563eb;
    --fs-border: #cbd5e1;
    --fs-padding: 14px;
    --fs-radius: 10px;
}
.fs-wrapper.fs-style-split_filter_bar .fs-container {
    border: 1px solid #cbd5e1;
}

/* 8. Kompakt-Widget für schmale Sidebars */
.fs-wrapper.fs-style-compact_sidebar {
    --fs-input-height: 40px;
    --fs-radius: 6px;
}
.fs-wrapper.fs-style-compact_sidebar .fs-submit-btn {
    padding: 6px 12px !important;
    font-size: 0.86rem !important;
}
