/**
 * Noble Atlas Filter Styles
 * Enhanced CI-compliant styling for filter dashboard
 * 
 * @package Noble_Frontend_Display
 * @since 2.2.3
 */

/* ========================================
   PLZ RADIUS SELECTOR - Noble Atlas CI
   ======================================== */
.plz-radius-steps {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(1, 34, 28, 0.4), rgba(10, 58, 48, 0.4));
    border: 1px solid rgba(219, 193, 109, 0.3);
    border-radius: var(--radius-md);
    margin-top: 12px;
}

.plz-radius-steps label {
    color: var(--noble-gold);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.radius-btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.radius-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(219, 193, 109, 0.1), rgba(219, 193, 109, 0.05));
    border: 1px solid rgba(219, 193, 109, 0.3);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.radius-btn:hover {
    background: linear-gradient(135deg, rgba(219, 193, 109, 0.2), rgba(219, 193, 109, 0.1));
    border-color: rgba(219, 193, 109, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(219, 193, 109, 0.2);
}

.radius-btn.active {
    background: linear-gradient(135deg, var(--noble-gold), rgba(219, 193, 109, 0.8));
    border-color: var(--noble-gold);
    color: var(--bg-primary);
    font-weight: 700;
    box-shadow: 
        0 0 20px rgba(219, 193, 109, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Mobile */
@media (max-width: 768px) {
    .plz-radius-steps {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px;
    }
    
    .radius-btn-group {
        justify-content: space-between;
    }
    
    .radius-btn {
        flex: 1;
        min-width: 60px;
        padding: 10px 12px;
        text-align: center;
    }
}

/* ========================================
   FILTER PANEL HEADER & RESULT COUNTER
   @since 2.22.0
   ======================================== */
.filter-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid rgba(219, 193, 109, 0.2);
}

.filter-panel-header h3 {
    margin: 0;
    color: var(--noble-gold);
    font-family: 'Playfair Display', serif;
    font-size: 24px;
}

.results-preview {
    background: linear-gradient(135deg, rgba(219, 193, 109, 0.15), rgba(219, 193, 109, 0.05));
    border: 1px solid rgba(219, 193, 109, 0.3);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.results-preview .count-number {
    color: var(--noble-gold);
    font-size: 16px;
    font-weight: 700;
}

.results-preview.updated {
    animation: counterPulse 0.3s ease;
}

@keyframes counterPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); background: rgba(219, 193, 109, 0.3); }
    100% { transform: scale(1); }
}

.count-loader {
    color: var(--text-secondary);
    font-style: italic;
}

/* Mobile */
@media (max-width: 768px) {
    .filter-panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .results-preview {
        font-size: 13px;
        padding: 5px 12px;
    }
}

/* ========================================
   CATEGORY QUICK ACCESS
   @since 2.22.0
   ======================================== */
.category-quick-access {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.category-quick-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(219, 193, 109, 0.1), rgba(219, 193, 109, 0.05));
    border: 1px solid rgba(219, 193, 109, 0.3);
    border-radius: 24px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-quick-btn:hover {
    background: linear-gradient(135deg, rgba(219, 193, 109, 0.2), rgba(219, 193, 109, 0.1));
    border-color: rgba(219, 193, 109, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(219, 193, 109, 0.2);
}

.category-quick-btn.active {
    background: linear-gradient(135deg, var(--noble-gold), rgba(219, 193, 109, 0.8));
    border-color: var(--noble-gold);
    color: var(--bg-primary);
    font-weight: 700;
}

.cat-icon {
    font-size: 18px;
    line-height: 1;
}

.cat-label {
    white-space: nowrap;
}

/* Mobile */
@media (max-width: 768px) {
    .category-quick-access {
        gap: 8px;
        padding: 12px 0;
    }
    
    .category-quick-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .cat-icon {
        font-size: 16px;
    }
}

/* ========================================
   FILTER DASHBOARD - Noble Atlas CI
   ======================================== */
.noble-filters-section {
    background: #ffffff;
    border: 1px solid rgba(1, 34, 28, 0.15);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 6px 20px rgba(1, 34, 28, 0.06);
    position: relative;
}

/* Advanced Accordion (Erweiterte Filter) */
.filter-accordion {
    border: 1px solid rgba(219, 193, 109, 0.25);
    border-radius: 12px;
    background: linear-gradient(135deg, #01221c, #0a3a30);
    box-shadow: 0 6px 20px rgba(1, 34, 28, 0.25);
}

.accordion-toggle {
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: none;
    border-bottom: 1px solid rgba(219, 193, 109, 0.25);
    color: #ffffff;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.accordion-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.accordion-panel {
    padding: 14px 16px;
    background: transparent;
}

/* Zwei Spalten auf Desktop für Checkbox-Gruppen und dichte Felder */
@media (min-width: 992px) {
    .accordion-panel .checkbox-group {
        display: grid;
        grid-template-columns: repeat(3, minmax(220px, 1fr));
        gap: 10px 16px;
    }
    .accordion-panel .range-inputs {
        display: grid;
        grid-template-columns: repeat(4, minmax(80px, 1fr));
        gap: 10px 12px;
    }
}

/* Active Filter Chips */
.active-filter-chips .chip {
    background: #dbc16d;
    color: #01221c;
    border: 1px solid #dbc16d;
    border-radius: 16px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
}
.active-filter-chips .chip:hover {
    filter: brightness(0.95);
}

.noble-filters-section::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(219, 193, 109, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

/* Filter Toggle Buttons */
.filter-toggle {
    padding: 10px 20px;
    background: transparent; /* no background */
    border: 1px solid rgba(219, 193, 109, 0.35); /* subtle gold border */
    border-radius: 20px;
    color: #dbc16d; /* use badge color as text */
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.filter-toggle:hover {
    color: #e7d590; /* lighter gold */
    border-color: rgba(219, 193, 109, 0.35);
}

.filter-toggle.active {
    background: linear-gradient(135deg, #dbc16d 0%, #e5cb7f 50%, #dbc16d 100%); /* original badge */
    border-color: #dbc16d;
    color: #01221c; /* emerald text */
    box-shadow: 0 0 20px rgba(219, 193, 109, 0.45), 0 6px 16px rgba(0,0,0,0.12);
}

/* Location Search Input */
#noble-location-search {
    background: rgba(1, 34, 28, 0.5);
    border: 1px solid rgba(219, 193, 109, 0.3);
    border-radius: 24px;
    padding: 12px 20px;
    color: var(--text-primary);
    font-size: 14px;
    width: 100%;
    transition: all 0.3s ease;
}

#noble-location-search:focus {
    outline: none;
    border-color: var(--noble-gold);
    box-shadow: 
        0 0 20px rgba(219, 193, 109, 0.3),
        inset 0 2px 8px rgba(0, 0, 0, 0.2);
    background: rgba(1, 34, 28, 0.7);
}

#noble-location-search::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Use Location Button */
#noble-use-location {
    background: linear-gradient(135deg, rgba(219, 193, 109, 0.2), rgba(219, 193, 109, 0.1));
    border: 1px solid rgba(219, 193, 109, 0.3);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#noble-use-location:hover {
    background: linear-gradient(135deg, rgba(219, 193, 109, 0.3), rgba(219, 193, 109, 0.2));
    border-color: var(--noble-gold);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(219, 193, 109, 0.4);
}

/* Active Filters Display */
.active-filters-display {
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(219, 193, 109, 0.05), transparent);
    border: 1px solid rgba(219, 193, 109, 0.15);
    border-radius: var(--radius-md);
    display: none;
}

.active-filters-display.show {
    display: block;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(219, 193, 109, 0.2), rgba(219, 193, 109, 0.1));
    border: 1px solid rgba(219, 193, 109, 0.3);
    border-radius: 16px;
    color: var(--noble-gold);
    font-size: 12px;
    font-weight: 600;
    margin-right: 8px;
    margin-bottom: 8px;
}

.btn-clear-filters {
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.2), rgba(200, 0, 0, 0.1));
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 20px;
    color: #ff6b6b;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-clear-filters:hover {
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.3), rgba(200, 0, 0, 0.2));
    border-color: rgba(255, 0, 0, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

/* Detail Search Button */
#noble-detail-search-btn {
    padding: 10px 20px;
    background: #01221c;
    border: 1px solid #01221c;
    border-radius: 24px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Ensure advanced form background is not white card inside */
#noble-detail-search-form {
    background: transparent !important;
}

#noble-detail-search-btn:hover {
    opacity: 0.9;
}

/* Loading State */
.noble-sedcard-grid.loading {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.noble-sedcard-grid.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(219, 193, 109, 0.2);
    border-top-color: var(--noble-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ========================================
   3-SPALTEN CHECKBOX-LAYOUT (NEU)
   Für Sprachen, Service für, etc.
   ======================================== */
.checkbox-group-3col {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px 16px !important;
}

.checkbox-group-3col .checkbox-label {
    margin: 0 !important;
    padding: 10px 12px !important;
    background: linear-gradient(135deg, rgba(219, 193, 109, 0.08), rgba(219, 193, 109, 0.03)) !important;
    border: 1px solid rgba(219, 193, 109, 0.2) !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
}

.checkbox-group-3col .checkbox-label:hover {
    background: linear-gradient(135deg, rgba(219, 193, 109, 0.15), rgba(219, 193, 109, 0.08)) !important;
    border-color: rgba(219, 193, 109, 0.4) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(219, 193, 109, 0.15) !important;
}

.checkbox-group-3col .checkbox-label input[type="checkbox"]:checked + span {
    color: var(--noble-gold) !important;
    font-weight: 600 !important;
}

.checkbox-group-3col .checkbox-label input[type="checkbox"]:checked ~ * {
    background: linear-gradient(135deg, rgba(219, 193, 109, 0.2), rgba(219, 193, 109, 0.1)) !important;
    border-color: var(--noble-gold) !important;
}

/* Mobile: 2 Spalten */
@media (max-width: 768px) {
    .checkbox-group-3col {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    
    .checkbox-group-3col .checkbox-label {
        padding: 8px 10px !important;
        font-size: 13px !important;
    }
}

/* Mobile klein: 1 Spalte */
@media (max-width: 480px) {
    .checkbox-group-3col {
        grid-template-columns: 1fr !important;
    }
}

/* ========================================
   FILTER TAB CONTENT - Optimierte Abstände
   ======================================== */
.filter-tab-content {
    padding: 20px 0 !important;
}

.filter-tab-content .filter-group {
    margin-bottom: 24px !important;
}

.filter-tab-content .filter-group:last-child {
    margin-bottom: 0 !important;
}

/* Labels mit mehr Kontrast */
.filter-tab-content label {
    color: var(--noble-gold) !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    margin-bottom: 12px !important;
    display: block !important;
    letter-spacing: 0.3px !important;
}

/* Service Kategorien - Kompakter */
.service-category {
    margin-bottom: 20px !important;
}

.service-category:last-child {
    margin-bottom: 0 !important;
}

.service-category-title {
    color: var(--text-primary) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    margin-bottom: 10px !important;
    padding-bottom: 6px !important;
    border-bottom: 1px solid rgba(219, 193, 109, 0.2) !important;
}

/* Service Category Accordion (NEU: Gruppierte Service-Auswahl) */
.service-category-accordion {
    margin-bottom: 8px !important;
    border: 1px solid #e5e5e5 !important;
    border-radius: 8px !important;
    background: #fff !important;
    transition: all 0.3s ease !important;
}

.service-category-accordion:hover {
    border-color: var(--noble-gold, #dbc16d) !important;
    box-shadow: 0 2px 8px rgba(219, 193, 109, 0.1) !important;
}

.service-category-toggle {
    width: 100% !important;
    padding: 12px 16px !important;
    background: transparent !important;
    border: none !important;
    text-align: left !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: var(--noble-emerald, #01221c) !important;
    transition: all 0.2s ease !important;
}

.service-category-toggle:hover {
    background: rgba(219, 193, 109, 0.05) !important;
}

.service-category-icon {
    display: none !important; /* Icons entfernt - nur Text */
}

.service-category-name {
    flex: 1 !important;
}

.service-category-arrow {
    font-size: 12px !important;
    transition: transform 0.2s ease !important;
    color: var(--noble-gold, #dbc16d) !important;
}

.service-category-arrow.rotated {
    transform: rotate(180deg) !important;
}

.service-category-content {
    padding: 12px 16px 16px !important;
    border-top: 1px solid #e5e5e5 !important;
}

/* Filter Input Fields - Einheitliches Styling */
.filter-input {
    width: 100% !important;
    padding: 10px 14px !important;
    background: rgba(1, 34, 28, 0.4) !important;
    border: 1px solid rgba(219, 193, 109, 0.3) !important;
    border-radius: 8px !important;
    color: var(--text-primary) !important;
    font-size: 14px !important;
    transition: all 0.3s ease !important;
}

.filter-input:focus {
    outline: none !important;
    border-color: var(--noble-gold) !important;
    background: rgba(1, 34, 28, 0.6) !important;
    box-shadow: 0 0 15px rgba(219, 193, 109, 0.2) !important;
}

.filter-input::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

/* Filter Hint - Hilfetext unter Inputs */
.filter-hint {
    margin-top: 8px !important;
    font-size: 12px !important;
    color: rgba(219, 193, 109, 0.7) !important;
    font-style: italic !important;
    line-height: 1.4 !important;
}

/* Detail Search Panel - Max-Height für Scrolling */
.detail-search-panel {
    max-height: 70vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Scrollbar Styling für Filter-Panel */
.detail-search-panel::-webkit-scrollbar {
    width: 8px !important;
}

.detail-search-panel::-webkit-scrollbar-track {
    background: rgba(1, 34, 28, 0.3) !important;
    border-radius: 4px !important;
}

.detail-search-panel::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(219, 193, 109, 0.5), rgba(219, 193, 109, 0.3)) !important;
    border-radius: 4px !important;
}

.detail-search-panel::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(219, 193, 109, 0.7), rgba(219, 193, 109, 0.5)) !important;
}

