/*
 * FilterEverything Pro Plugin Styling Fixes
 * HIGH SPECIFICITY CSS TO OVERRIDE CACHED PLUGIN STYLES
 * Modern filter chip button styling
 */

/* ===== MODERN FILTER CHIP BUTTONS ===== */
/* Main filter chip styling - targets the link inside each chip */
html body .wpc-custom-selected-terms ul.wpc-filter-chips-list li.wpc-filter-chip a,
html body .wpc-filter-chips-list li.wpc-filter-chip a,
html body div .wpc-filter-chips-list li.wpc-filter-chip a,
body .wpc-filter-chips-list li.wpc-filter-chip:not(.wpc-chip-reset-all) a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px 12px !important;
    margin: 4px 6px 4px 0 !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 20px !important;
    color: #374151 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.3 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    max-width: 200px !important;
    min-height: auto !important;
    opacity: 1 !important;
    overflow: hidden !important;
    position: relative !important;
}

/* Filter chip hover state */
html body .wpc-custom-selected-terms ul.wpc-filter-chips-list li.wpc-filter-chip a:hover,
html body .wpc-filter-chips-list li.wpc-filter-chip a:hover,
html body div .wpc-filter-chips-list li.wpc-filter-chip a:hover,
body .wpc-filter-chips-list li.wpc-filter-chip:not(.wpc-chip-reset-all) a:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border-color: #d1d5db !important;
    opacity: 1 !important;
}

/* Reset All button special styling */
html body .wpc-custom-selected-terms ul.wpc-filter-chips-list li.wpc-chip-reset-all a,
html body .wpc-filter-chips-list li.wpc-chip-reset-all a,
html body div .wpc-filter-chips-list li.wpc-chip-reset-all a,
body .wpc-filter-chips-list li.wpc-chip-reset-all a {
    background: linear-gradient(135deg, #dc2626, #ef4444) !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
    font-weight: 600 !important;
    opacity: 1 !important;
    padding: 6px 14px !important;
    border-radius: 20px !important;
}

html body .wpc-custom-selected-terms ul.wpc-filter-chips-list li.wpc-chip-reset-all a:hover,
html body .wpc-filter-chips-list li.wpc-chip-reset-all a:hover,
html body div .wpc-filter-chips-list li.wpc-chip-reset-all a:hover,
body .wpc-filter-chips-list li.wpc-chip-reset-all a:hover {
    /* background: linear-gradient(135deg, #b91c1c, #dc2626) !important; */
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3) !important;
    opacity: 1 !important;
}

/* ===== CLOSE BUTTON (×) STYLING ===== */
/* Modern close button styling */
html body .wpc-filter-chips-list .wpc-chip-remove-icon,
html body .wpc-custom-selected-terms .wpc-chip-remove-icon,
html body .wpc-filter-chips-list .wpc-icon-html-wrapper,
html body .wpc-custom-selected-terms .wpc-icon-html-wrapper {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    line-height: 1 !important;
    font-weight: 600 !important;
    vertical-align: middle !important;
    text-align: center !important;
    width: 16px !important;
    height: 16px !important;
    padding: 0 !important;
    margin-left: 6px !important;
    margin-right: 0 !important;
    color: #6b7280 !important;
    background: rgba(107, 114, 128, 0.1) !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    position: relative !important;
    flex-shrink: 0 !important;
}

/* Close button hover states */
html body .wpc-filter-chips-list .wpc-chip-remove-icon:hover,
html body .wpc-custom-selected-terms .wpc-chip-remove-icon:hover,
html body .wpc-filter-chips-list .wpc-icon-html-wrapper:hover,
html body .wpc-custom-selected-terms .wpc-icon-html-wrapper:hover {
    color: #dc2626 !important;
    background: rgba(220, 38, 38, 0.15) !important;
    transform: scale(1.1) !important;
}

/* Ensure HTML content renders properly in close buttons */
html body .wpc-filter-chips-list .wpc-icon-html-wrapper span,
html body .wpc-custom-selected-terms .wpc-icon-html-wrapper span {
    display: inline-block !important;
    font-family: Arial, sans-serif !important;
    font-size: 11px !important;
    line-height: 1 !important;
    color: inherit !important;
}

/* If the icon wrapper is empty, add a fallback cross symbol */
html body .wpc-filter-chips-list .wpc-chip-remove-icon:empty:before,
html body .wpc-filter-chips-list .wpc-icon-html-wrapper:empty:before {
    content: "×" !important;
    display: inline-block !important;
    font-family: Arial, sans-serif !important;
    font-size: 11px !important;
    line-height: 1 !important;
}

/* ===== CHIP LAYOUT AND CONTAINER ===== */
/* Modern chip container layout */
html body .wpc-custom-selected-terms ul.wpc-filter-chips-list,
html body .wpc-filter-chips-list {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    padding: 0 !important;
    margin: 16px 0 !important;
    list-style: none !important;
    align-items: flex-start !important;
}

/* Individual chip list items */
html body .wpc-custom-selected-terms ul.wpc-filter-chips-list li,
html body .wpc-filter-chips-list li {
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    html body .wpc-custom-selected-terms ul.wpc-filter-chips-list,
    html body .wpc-filter-chips-list {
        margin: 12px 0 !important;
    }
    
    html body .wpc-custom-selected-terms ul.wpc-filter-chips-list li.wpc-filter-chip a,
    html body .wpc-filter-chips-list li.wpc-filter-chip a {
        padding: 8px 12px !important;
        font-size: 13px !important;
        margin: 2px 4px 2px 0 !important;
    }
    
    html body .wpc-filter-chips-list .wpc-chip-remove-icon,
    html body .wpc-filter-chips-list .wpc-icon-html-wrapper {
        width: 18px !important;
        height: 18px !important;
        margin-left: 6px !important;
    }
}

/* ===== OVERRIDE ANY REMAINING PLUGIN OPACITY STYLES ===== */
html body .wpc-filter-chips-list li.wpc-filter-chip a:active,
html body .wpc-custom-selected-terms ul.wpc-filter-chips-list li.wpc-filter-chip a:active {
    opacity: 1 !important;
    transform: translateY(0px) !important;
}

/* Clear any plugin-generated styles that might interfere */
html body .wpc-filter-chips-list *,
html body .wpc-custom-selected-terms ul.wpc-filter-chips-list * {
    box-sizing: border-box !important;
}

/* ===== FILTER TOGGLE BUTTON FIXES ===== */
/* Fix the filter toggle button icon and hover effects */
body .wpc-filters-open-button-container a.wpc-filters-open-widget,
html body .wpc-filters-open-button-container a.wpc-filters-open-widget {
    background-color: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    padding: 10px 16px !important;
    color: #374151 !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

/* Remove the weird red/blue hover effects */
body .wpc-filters-open-button-container a.wpc-filters-open-widget:hover,
html body .wpc-filters-open-button-container a.wpc-filters-open-widget:hover {
    background-color: #f8fafc !important;
    border-color: #d1d5db !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    color: #1f2937 !important;
}

/* Fix the hamburger icon lines */
body .wpc-filters-open-widget .wpc-icon-html-wrapper,
html body .wpc-filters-open-widget .wpc-icon-html-wrapper {
    width: 20px !important;
    height: 16px !important;
    display: inline-flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    background: none !important;
    border-radius: 0 !important;
    position: relative !important;
    transform: none !important;
}

/* Style the individual hamburger lines */
body .wpc-filters-open-widget .wpc-icon-line-1,
body .wpc-filters-open-widget .wpc-icon-line-2,
body .wpc-filters-open-widget .wpc-icon-line-3 {
    width: 18px !important;
    height: 2px !important;
    background-color: #6b7280 !important;
    border-radius: 1px !important;
    transition: all 0.2s ease !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Hover effect for hamburger lines */
body .wpc-filters-open-widget:hover .wpc-icon-line-1,
body .wpc-filters-open-widget:hover .wpc-icon-line-2,
body .wpc-filters-open-widget:hover .wpc-icon-line-3 {
    background-color: #374151 !important;
}

/* Fix the filters text */
body .wpc-filters-open-widget .wpc-filters-button-text {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: inherit !important;
    margin-left: 12px !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
}

/* ===== DROPDOWN/POPUP CLOSE BUTTON FIXES ===== */
/* Ensure dropdown close buttons are not affected by our chip close button styles */
body .wpc-filters-widget-content .close,
body .wpc-filters-popup .close,
body .wpc-filter-modal .close,
body .wpc-filters-section .close:not(.wpc-chip-remove-icon):not(.wpc-icon-html-wrapper) {
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    color: #6b7280 !important;
    font-size: 20px !important;
    line-height: 1 !important;
    padding: 4px !important;
    cursor: pointer !important;
    transition: color 0.2s ease !important;
}

body .wpc-filters-widget-content .close:hover,
body .wpc-filters-popup .close:hover,
body .wpc-filter-modal .close:hover,
body .wpc-filters-section .close:hover:not(.wpc-chip-remove-icon):not(.wpc-icon-html-wrapper) {
    /* color: #dc2626 !important; */
    background: none !important;
    transform: none !important;
}

/* Specific fixes for any × symbols in dropdowns */
body .wpc-filters-widget-content [class*="close"],
body .wpc-filters-popup [class*="close"],
body .wpc-filter-modal [class*="close"] {
    background: none !important;
    border-radius: 0 !important;
    width: auto !important;
    height: auto !important;
}

/* ===== FILTER POPUP CLOSE BUTTON FIX ===== */
/* Fix FilterEverything popup close button to use proper X symbol instead of lowercase x */
.popup23-header .popup23-close::before,
.popup23-wrapper .popup23-header .popup23-close::before,
body .popup23-header .popup23-close::before {
    content: '×' !important; /* Use proper multiplication symbol instead of lowercase x */
    font-size: 20px !important;
    color: #6b7280 !important;
    text-align: center !important;
    display: inline-block !important;
    vertical-align: middle !important;
    line-height: 25px !important;
    font-weight: bold !important;
    transition: all 0.2s ease !important;
    width: 100% !important;
    height: 100% !important;
    left: 0 !important;
    top: 0 !important;
    position: absolute !important;
}

.popup23-header .popup23-close:hover::before,
.popup23-wrapper .popup23-header .popup23-close:hover::before,
body .popup23-header .popup23-close:hover::before {
    /* color: #dc2626 !important; Red color on hover */
    transform: scale(1.1) !important;
}

/* Enhanced styling for the close button container */
.popup23-header .popup23-close,
.popup23-wrapper .popup23-header .popup23-close,
body .popup23-header .popup23-close {
    background: rgba(107, 114, 128, 0.1) !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    border: none !important;
    outline: none !important;
    position: absolute !important;
    top: 14px !important;
    right: 14px !important;
    width: 25px !important;
    height: 25px !important;
}

.popup23-header .popup23-close:hover,
.popup23-wrapper .popup23-header .popup23-close:hover,
body .popup23-header .popup23-close:hover {
    background: rgba(220, 38, 38, 0.1) !important;
    transform: scale(1.05) !important;
}

/* Enhanced close button styling */
.popup23-header .popup23-close {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    height: 25px !important;
    width: 25px !important;
    background: rgba(107, 114, 128, 0.1) !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    border: none !important;
    outline: none !important;
}

.popup23-header .popup23-close:hover {
    background: rgba(220, 38, 38, 0.1) !important;
    transform: scale(1.05) !important;
}

/* ===== OVERRIDE ORIGINAL PLUGIN CSS ===== */
/* Direct override of the original FilterEverything popup close button styles with highest specificity */
html body .popup23-wrapper .popup23 .popup23-inner .popup23-header .popup23-close::before,
body .popup23-wrapper .popup23 .popup23-inner .popup23-header .popup23-close::before,
.popup23-wrapper .popup23 .popup23-inner .popup23-header .popup23-close::before {
    content: '×' !important; /* Force proper multiplication symbol */
    font-size: 20px !important;
    color: #6b7280 !important;
    text-align: center !important;
    display: inline-block !important;
    vertical-align: middle !important;
    line-height: 25px !important;
    font-weight: bold !important;
    transition: all 0.2s ease !important;
    width: 100% !important;
    height: 100% !important;
    left: 0 !important;
    top: 0 !important;
    position: absolute !important;
}

/* High specificity hover state */
html body .popup23-wrapper .popup23 .popup23-inner .popup23-header .popup23-close:hover::before,
body .popup23-wrapper .popup23 .popup23-inner .popup23-header .popup23-close:hover::before,
.popup23-wrapper .popup23 .popup23-inner .popup23-header .popup23-close:hover::before {
    /* color: #dc2626 !important; Red color on hover */
    transform: scale(1.1) !important;
}
