/**
 * Custom Filtering By Reyad - Styles
 */

/* Filters Container */
.cfr-filters-container {
    background: #ffffff;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.cfr-filter-section {
    margin-bottom: 25px;
}

.cfr-filter-section:last-of-type {
    margin-bottom: 0;
}

.cfr-filter-heading {
    font-weight: bold;
    color: #000000;
    margin: 0 0 15px 0;
    font-size: 16px;
}

.cfr-filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cfr-filter-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.cfr-filter-checkbox {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    border: 1px solid #cccccc;
    border-radius: 2px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    position: relative;
}

.cfr-filter-checkbox:checked {
    background-color: #0073aa;
    border-color: #0073aa;
}

.cfr-filter-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
}

.cfr-filter-label {
    color: #333333;
    font-size: 14px;
}

.cfr-filter-count {
    color: #999999;
    font-weight: normal;
    margin-left: 5px;
}

.cfr-no-terms {
    color: #666666;
    font-style: italic;
    margin: 0;
}

.cfr-clear-filters {
    text-align: right;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eeeeee;
}

.cfr-clear-link {
    color: #0073aa;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
}

.cfr-clear-link:hover {
    text-decoration: underline;
}

/* Search Container */
.cfr-search-container {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.cfr-search-form {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.cfr-search-field {
    flex: 1;
    min-width: 200px;
}

.cfr-distance-field {
    flex: 0 0 auto;
    min-width: 150px;
}

.cfr-search-input,
.cfr-search-select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #dddddd;
    border-radius: 4px;
    font-size: 14px;
    background: #ffffff;
    color: #333333;
}

.cfr-search-input::placeholder {
    color: #999999;
}

.cfr-search-select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 35px;
}

.cfr-search-actions {
    display: flex;
    gap: 10px;
    flex: 0 0 auto;
}

.cfr-search-button {
    padding: 10px 25px !important;
    background: #0073aa !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: background-color 0.3s !important;
}

.cfr-search-button:hover {
    background: #005a87 !important;
}

.cfr-clear-button {
    padding: 10px 20px !important;
    background: #f5f5f5 !important;
    color: #666666 !important;
    border: 1px solid #dddddd !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    font-weight: normal !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    transition: background-color 0.3s !important;
}

.cfr-clear-button:hover {
    background: #e5e5e5 !important;
}

/* Sort Container */
.cfr-sort-container {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin-bottom: 20px !important;
}

.cfr-sort-label {
    color: #000000 !important;
    font-size: 14px !important;
    font-weight: normal !important;
    margin: 0 !important;
}

.cfr-sort-select {
    width: auto !important;
    padding: 8px 30px 8px 12px !important;
    border: none !important;
    border-bottom: 2px solid #0073aa !important;
    background: transparent !important;
    color: #0073aa !important;
    font-size: 14px !important;
    cursor: pointer !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230073aa' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right center !important;
    padding-right: 25px !important;
}

.cfr-sort-select:focus {
    outline: none !important;
    border-bottom-color: #005a87 !important;
}

/* Loading Animation */
.cfr-loading-overlay {
    position: relative;
    min-height: 200px;
}

.cfr-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: cfr-spin 1s linear infinite;
    z-index: 9999;
}

.cfr-loading-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 9998;
    border-radius: 4px;
}

@keyframes cfr-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Results Container */
.cfr-results-container {
    margin-top: 30px;
}

.cfr-results-loading {
    text-align: center;
    padding: 40px;
    color: #666666;
}

.cfr-results-empty {
    text-align: center;
    padding: 40px;
    color: #666666;
}

.cfr-results-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cfr-result-item {
    padding: 20px;
    border-bottom: 1px solid #eeeeee;
}

.cfr-result-item:last-child {
    border-bottom: none;
}

.cfr-result-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.cfr-result-title a {
    color: #0073aa;
    text-decoration: none;
}

.cfr-result-title a:hover {
    text-decoration: underline;
}

.cfr-result-excerpt {
    color: #666666;
    margin-bottom: 10px;
}

.cfr-result-date {
    color: #999999;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .cfr-search-form {
        flex-direction: column;
    }
    
    .cfr-search-field,
    .cfr-distance-field {
        width: 100%;
        min-width: auto;
    }
    
    .cfr-search-actions {
        width: 100%;
        justify-content: stretch;
    }
    
    .cfr-search-button,
    .cfr-clear-button {
        flex: 1;
    }
}

