/**
 * Chemical Compatibility Filter Styles (v2 - with Ratings)
 * For MODX 2.8.6
 */

/* ================================================
   Base Container
   ================================================ */
.chem-compat-filter {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ================================================
   Rating Colors
   ================================================ */
.rating-a, .rating-badge.rating-a { background: #22c55e; color: white; }
.rating-b, .rating-badge.rating-b { background: #3b82f6; color: white; }
.rating-c, .rating-badge.rating-c { background: #f59e0b; color: white; }
.rating-x, .rating-badge.rating-x { background: #ef4444; color: white; }
.rating-none, .rating-badge.rating-none { background: #9ca3af; color: white; }

.rating-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 13px;
    cursor: help;
}

/* ================================================
   Search Section
   ================================================ */
.chem-search-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
}

.chem-search-section h2 {
    margin: 0 0 10px;
    color: #1a1a2e;
    font-size: 28px;
    font-weight: 600;
}

.chem-search-section > p {
    color: #666;
    margin: 0 0 25px;
}

#chem-search-form {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}
#chem-search-form input {
    margin: 0;
}
.search-input-wrapper {
    display: flex;
    gap: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 50px;
    overflow: hidden;
}

.chem-search-input {
    flex: 1;
    padding: 18px 25px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-right: none;
    border-radius: 50px 0 0 50px;
    outline: none;
    transition: border-color 0.3s;
}

.chem-search-input:focus {
    border-color: #0066cc;
}

.chem-search-btn {
    padding: 18px 35px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 0 50px 50px 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.chem-search-btn:hover {
    background: #0052a3;
}

/* Rating Legend */
.rating-legend {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
    color: #666;
}

.legend-title {
    font-weight: 600;
    color: #333;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-item .rating-badge {
    width: 20px;
    height: 20px;
    font-size: 11px;
}
/* Rating Legend */
.rating-legend {
    margin-top: 20px;
    text-align: center;
}

.legend-ratings {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
    color: #666;
}

.legend-note {
    margin: 10px 0 0;
    font-size: 12px;
    color: #888;
    font-style: italic;
}

/* Disclaimer */
.chemical-disclaimer {
    margin-top: 20px;
    padding: 15px 20px;
    background: #fff8e6;
    border: 1px solid #f0d58c;
    border-left: 4px solid #e6a800;
    border-radius: 6px;
    font-size: 13px;
    color: #665500;
    line-height: 1.5;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.chemical-disclaimer strong {
    color: #554400;
}
/* ================================================
   Autocomplete Dropdown
   ================================================ */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    margin-top: 8px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}

.autocomplete-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f0f0f0;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: #f0f7ff;
}

.autocomplete-item mark {
    background: #fff3cd;
    padding: 0 2px;
    border-radius: 2px;
}

.autocomplete-no-results {
    padding: 20px;
    text-align: center;
    color: #666;
}

/* ================================================
   Results Section
   ================================================ */
.chem-results-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.results-header {
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.results-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.results-header .chemical-name {
    color: #0066cc;
    font-weight: 600;
}

.result-count {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.results-container {
    display: flex;
    min-height: 500px;
}
.no-results-message {
    grid-column: 1 / -1;
    max-width: 600px;
    margin: 0 auto;
}
/* ================================================
   Sidebar Filters
   ================================================ */
.results-sidebar {
    width: 300px;
    flex-shrink: 0;
    border-right: 1px solid #eee;
    padding: 20px;
    background: #fafafa;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.filter-header h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.clear-filters-btn {
    background: none;
    border: none;
    color: #0066cc;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
}

.filter-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.filter-section:last-of-type {
    border-bottom: none;
}

.filter-section h4,
.filter-category h4 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Rating Filter */
.rating-options {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.rating-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 1px 0px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
    font-size: 13px;
line-height: 1;
}

.rating-radio:hover {
    background: #e8f4ff;
}

.rating-radio input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #0066cc;
}

/* Material Checkboxes */
.material-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    margin: 0;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
}

.material-checkbox:hover:not(.disabled) {
    background: #e8f4ff;
}

.material-checkbox.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.material-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #0066cc;
}

.material-checkbox .mat-name {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.material-checkbox .mat-rating {
    width: 22px;
    height: 22px;
    font-size: 12px;
}
.material-checkbox .mat-rating {
    width: 22px;
    height: 22px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-weight: 700;
    font-size: 13px;
}
.apply-filters-btn {
    width: 100%;
    padding: 12px 20px;
    margin-top: 15px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.apply-filters-btn:hover {
    background: #0052a3;
}

/* ================================================
   Results Content
   ================================================ */
.results-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.pump-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* ================================================
   Pump Result Card
   ================================================ */
.pump-result-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.3s, transform 0.2s;
}

.pump-result-card:hover {
    /* box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1); */
    /* transform: translateY(-2px); */
    border-color: #0066cc;
}

.pump-image {
    height: 160px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pump-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.pump-image .no-image {
    color: #999;
    font-size: 14px;
}

.pump-info {
    padding: 18px;
}

.pump-title {
    margin: 0 0 6px;
    font-size: 17px;
}

.pump-title a {
    color: #1a1a2e;
    text-decoration: none;
}

.pump-title a:hover {
    color: #0066cc;
}

.pump-part-number {
    margin: 0 0 8px;
    font-size: 12px;
    color: #666;
}

.pump-description {
    margin: 0 0 12px;
    font-size: 13px;
    color: #555;
    line-height: 1.4;
}

.pump-specs {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 12px;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 12px;
}

.spec-label {
    color: #666;
}

.spec-value {
    color: #333;
    font-weight: 500;
}

/* Materials with Ratings */
.pump-materials-rated {
    margin-bottom: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
}

.material-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 12px;
}

.material-row:not(:last-child) {
    border-bottom: 1px solid #e8e8e8;
    padding-bottom: 8px;
    margin-bottom: 3px;
}

.material-label {
    color: #666;
    min-width: 70px;
}

.material-value {
    flex: 1;
    color: #333;
    font-weight: 500;
}

.material-row .rating-badge {
    width: 22px;
    height: 22px;
    font-size: 11px;
}

.pump-details-btn {
    display: inline-block;
    width: 100%;
    padding: 11px 18px;
    background: #0066cc;
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.3s;
}

.pump-details-btn:hover {
    background: #0052a3;
    color: #fff;
}

/* ================================================
   No Results
   ================================================ */
.no-results-message {
    text-align: center;
    padding: 60px 40px;
    color: #666;
}

.no-results-icon {
    margin-bottom: 20px;
    color: #ccc;
}

.no-results-message h4 {
    margin: 0 0 15px;
    font-size: 22px;
    color: #333;
}

.no-results-message p {
    margin: 0 0 10px;
}

.no-results-message .suggestions {
    margin-top: 25px;
    font-weight: 600;
    color: #333;
}

.no-results-message ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
}

.no-results-message li {
    padding: 5px 0;
}

/* ================================================
   Responsive Design
   ================================================ */
@media (max-width: 992px) {
    .results-container {
        flex-direction: column;
    }
    
    .results-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    
    .rating-legend {
        gap: 10px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .chem-search-section {
        padding: 20px 15px;
    }
    
    .chem-search-section h2 {
        font-size: 22px;
    }
    
    .search-input-wrapper {
        flex-direction: column;
        border-radius: 12px;
    }
    
    .chem-search-input {
        border-radius: 12px 12px 0 0;
        border-right: 2px solid #e0e0e0;
        border-bottom: none;
    }
    
    .chem-search-btn {
        border-radius: 0 0 12px 12px;
    }
    
    .rating-legend {
        flex-direction: column;
        gap: 8px;
    }
    
    .results-header {
        flex-direction: column;
        text-align: center;
    }
    
    .pump-results-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .chem-compat-filter {
        padding: 10px;
    }
    
    .pump-info {
        padding: 15px;
    }
}


