/**
 * SE Builder - Advanced Filter Widget Frontend Styles
 */

/* Main Filter Container */
.se-advanced-filter {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.se-filter-content {
    font-size: 14px;
}

/* Horizontal Layout */
.se-filter-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
}

.se-filter-horizontal .se-filter-sections-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    flex: 1;
}

.se-filter-horizontal .se-filter-section {
    min-width: 180px;
    flex: 1;
}

/* Filter Header */
.se-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.se-filter-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.se-filter-reset {
    padding: 6px 12px;
    font-size: 12px;
    color: #6b7280;
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.se-filter-reset:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Filter Sections */
.se-filter-section {
    margin-bottom: 20px;
}

.se-filter-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.se-filter-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.se-filter-section-toggle {
    padding: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    border-radius: 4px;
    transition: all 0.2s;
}

.se-filter-section-toggle:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Search Box */
.se-filter-search-box {
    position: relative;
}

.se-filter-search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.se-filter-search-input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.se-filter-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Checkbox & Radio Lists */
.se-filter-checkbox-list,
.se-filter-radio-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.se-filter-checkbox-item,
.se-filter-radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 0;
}

.se-filter-checkbox-item input,
.se-filter-radio-item input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #3b82f6;
}

.se-filter-checkbox-label,
.se-filter-radio-label {
    flex: 1;
    color: #374151;
    font-size: 14px;
}

.se-filter-count {
    font-size: 12px;
    color: #9ca3af;
}

.se-filter-show-more {
    padding: 6px 0;
    font-size: 13px;
    color: #3b82f6;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
}

.se-filter-show-more:hover {
    text-decoration: underline;
}

/* Dropdown Select */
.se-filter-dropdown-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    box-sizing: border-box;
}

.se-filter-dropdown-select:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Pills/Buttons */
.se-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.se-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.se-filter-pill:hover,
.se-filter-pill.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.se-filter-pill-count {
    font-size: 11px;
    opacity: 0.8;
}

/* Link List */
.se-filter-link-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.se-filter-link-list li {
    margin-bottom: 4px;
}

.se-filter-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    color: #374151;
    text-decoration: none;
    transition: color 0.2s;
}

.se-filter-link:hover,
.se-filter-link.active {
    color: #3b82f6;
}

/* Tag Cloud */
.se-filter-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    line-height: 1.6;
}

.se-filter-tag {
    padding: 2px 8px;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}

.se-filter-tag:hover,
.se-filter-tag.active {
    color: #3b82f6;
}

/* Logo Grid */
.se-filter-logo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.se-filter-logo-item {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.se-filter-logo-item:hover,
.se-filter-logo-item.active {
    border-color: #3b82f6;
    background: #eff6ff;
}

.se-filter-logo-item img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

.se-filter-logo-item span {
    font-weight: 600;
    color: #6b7280;
}

/* Price Range */
.se-filter-price-slider {
    padding: 10px 0;
}

.se-filter-price-labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 10px;
}

.se-filter-range-track {
    position: relative;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    margin-bottom: 10px;
}

.se-filter-range-fill {
    position: absolute;
    height: 100%;
    background: #3b82f6;
    border-radius: 3px;
    pointer-events: none;
}

.se-filter-range-input {
    position: absolute;
    width: 100%;
    height: 6px;
    top: 0;
    left: 0;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    margin: 0;
    padding: 0;
}

.se-filter-range-input::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: transparent;
}

.se-filter-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: all;
    width: 18px;
    height: 18px;
    background: white;
    border: 2px solid #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

.se-filter-range-input::-moz-range-track {
    width: 100%;
    height: 6px;
    background: transparent;
}

.se-filter-range-input::-moz-range-thumb {
    pointer-events: all;
    width: 18px;
    height: 18px;
    background: white;
    border: 2px solid #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Ensure second slider thumb is on top */
.se-filter-range-input:last-of-type {
    z-index: 2;
}

.se-filter-price-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
}

.se-filter-price-input-group {
    flex: 1;
}

.se-filter-price-input-group label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.se-filter-price-input-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.se-filter-price-input-group input:focus {
    outline: none;
    border-color: #3b82f6;
}

.se-filter-price-separator {
    color: #9ca3af;
    margin-top: 20px;
}

/* Filter Actions */
.se-filter-actions {
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    margin-top: 16px;
}

.se-filter-apply-btn {
    width: 100%;
    padding: 12px 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.se-filter-apply-btn:hover {
    background: #2563eb;
}

/* Count Display */
.se-filter-count-display {
    font-size: 13px;
    color: #6b7280;
    padding: 8px 0;
}

/* Hidden items (for show more functionality) */
.se-filter-item-hidden {
    display: none;
}

/* Target indicator (hidden on frontend) */
.se-filter-target-indicator {
    display: none !important;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .se-filter-horizontal {
        flex-direction: column;
    }
    
    .se-filter-horizontal .se-filter-sections-horizontal {
        flex-direction: column;
    }
    
    .se-filter-horizontal .se-filter-section {
        min-width: 100%;
    }
    
    .se-filter-logo-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .se-filter-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .se-filter-reset {
        width: 100%;
        text-align: center;
    }
    
    .se-filter-logo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .se-filter-price-inputs {
        flex-direction: column;
    }
    
    .se-filter-price-separator {
        display: none;
    }
}
