/* Filter Container */
.cpf-filter-widget {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cpf-filter-widget h4,
.cpf-filter-widget > h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #212427 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Scrollable filter (Set, Card Type, Finish) */
.cpf-filter-scrollable .cpf-filter-search {
    margin-bottom: 10px;
}

.cpf-search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.cpf-search-input:focus {
    outline: none;
    border-color: #0073aa;
}

.cpf-scrollable-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 10px;
    background: #fafafa;
}

.cpf-scrollable-list::-webkit-scrollbar {
    width: 8px;
}

.cpf-scrollable-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.cpf-scrollable-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.cpf-scrollable-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Simple filter (Ink Type, Rarity, Colour) */
.cpf-filter-simple .cpf-filter-options {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

/* Option styling */
.cpf-option {
    display: flex;
    align-items: center;
    padding: 6px 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    border-radius: 3px;
}

.cpf-option:hover {
    background: #f9f9f9;
}

.cpf-option input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.cpf-option-label {
    flex: 1;
    color: #333;
}

.cpf-count {
    color: #666;
    font-size: 12px;
    margin-left: 5px;
    font-weight: 500;
}

/* Price filter */
.cpf-price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cpf-price-inputs input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.cpf-price-inputs input:focus {
    outline: none;
    border-color: #0073aa;
}

.cpf-price-separator {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* Name search */
.cpf-text-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.cpf-text-input:focus {
    outline: none;
    border-color: #0073aa;
}

.cpf-text-input.has-value {
    border-color: #0073aa;
    background: #f0f8ff;
}

/* Action buttons */
.cpf-filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.cpf-apply-filters,
.cpf-reset-filters {
    flex: 1;
    padding: 14px 20px;
    text-align: center;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    border: none;
}

.cpf-apply-filters {
    background-color: #2196f3 !important;
    color: #fff !important;
}

.cpf-apply-filters:hover {
    background-color: #42a2ef !important;
    color: #fff !important;
}

.cpf-apply-filters:disabled {
    background: #ccc !important;
    cursor: not-allowed;
}

.cpf-reset-filters {
    background: #f7f7f7;
    color: #999 !important;
    border: 1px solid #ddd;
    display: inline-block;
}

.cpf-reset-filters:hover {
    background: #eee;
    text-decoration: none;
}

/* Form wrapper */
.cpf-filter-form {
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .cpf-price-inputs {
        flex-direction: column;
    }
    
    .cpf-price-separator {
        display: none;
    }
    
    .cpf-filter-widget {
        padding: 15px;
    }
    
    .cpf-scrollable-list {
        max-height: 200px;
    }
}

/* Loading state */
.cpf-apply-filters:disabled::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cpf-spin 0.6s linear infinite;
}

@keyframes cpf-spin {
    to { transform: rotate(360deg); }
}

/* Empty state */
.cpf-filter-options:empty::after {
    content: 'No options available';
    display: block;
    padding: 15px;
    text-align: center;
    color: #999;
    font-style: italic;
}

/* Update Price Button */
.cpf-update-price {
    margin-top: 10px;
    padding: 8px 16px;
    background: #2196f3 !important;
    color: white !important;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.3s;
}

.cpf-update-price:hover {
    background: #42a2ef !important;
}

/* Price Error Message */
.cpf-price-error {
    display: none;
    color: #dc3232;
    font-size: 12px;
    margin-top: 5px;
    line-height: 1.4;
}

/* Subcategory Context Display */
.cpf-set-context .cpf-current-set {
    padding: 15px;
    background: #f0f8ff;
    border: 1px solid #d0e7ff;
    border-radius: 4px;
}

.cpf-viewing-set {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #333;
}

.cpf-viewing-set strong {
    color: #2196f3;
    font-weight: 600;
}

.cpf-view-all-sets {
    display: inline-block;
    padding: 8px 16px;
    background: #fff;
    color: #2196f3 !important;
    border: 1px solid #2196f3;
    border-radius: 4px;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
}

.cpf-view-all-sets:hover {
    background: #2196f3;
    color: #fff !important;
}
