/**
 * Elevateck Property Filters - Styles
 */

/* Main Wrapper */
.elevateck-filters-wrapper {
    width: 100%;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* Form Layout */
.elevateck-filters-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Filter Groups */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* Input Styles */
.filter-group input[type="text"],
.filter-group input[type="number"],
.filter-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: #fff;
}

.filter-group input[type="text"]:focus,
.filter-group input[type="number"]:focus,
.filter-group select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
}

/* Range Inputs (Από - Έως) */
.filter-range .range-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-range .range-inputs input {
    flex: 1;
    min-width: 0;
}

.filter-range .range-separator {
    color: #999;
    font-weight: 500;
}

/* Select2 Customization */
.select2-container--default .select2-selection--multiple {
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    min-height: 44px !important;
    padding: 4px 8px !important;
}

.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: #2271b1 !important;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15) !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #2271b1 !important;
    border: none !important;
    border-radius: 4px !important;
    color: #fff !important;
    padding: 4px 8px !important;
    margin: 2px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #fff !important;
    margin-right: 6px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #ff6b6b !important;
}

.select2-dropdown {
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.select2-results__option--highlighted[aria-selected] {
    background-color: #2271b1 !important;
}

/* Parent areas styling in Select2 */
.select2-results__option[data-parent="1"] {
    font-weight: 600;
    color: #333;
}

/* Category Dropdown Custom */
.category-dropdown {
    position: relative;
}

.category-selected {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.3s;
}

.category-selected:hover {
    border-color: #2271b1;
}

.category-selected.active {
    border-color: #2271b1;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.dropdown-arrow {
    transition: transform 0.3s;
}

.category-selected.active .dropdown-arrow {
    transform: rotate(180deg);
}

.category-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #2271b1;
    border-top: none;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.category-options.show {
    display: block;
}

.category-parent {
    border-bottom: 1px solid #eee;
}

.category-parent:last-child {
    border-bottom: none;
}

.category-parent-header {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.category-parent-header:hover {
    background: #f5f5f5;
}

.category-toggle {
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.toggle-icon {
    transition: transform 0.3s;
}

.category-parent.expanded .toggle-icon {
    transform: rotate(180deg);
}

.category-label,
.category-child-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex: 1;
}

.category-label input,
.category-child-label input {
    margin-right: 8px;
    accent-color: #2271b1;
}

.category-children {
    padding-left: 43px;
    background: #fafafa;
}

.category-children.collapsed {
    display: none;
}

.category-child-label {
    padding: 8px 15px;
    border-top: 1px solid #eee;
}

.category-child-label:hover {
    background: #f0f0f0;
}

/* Buttons */
.filter-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.filter-submit,
.filter-reset {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-submit {
    background: #2271b1;
    color: #fff;
}

.filter-submit:hover {
    background: #135e96;
}

.filter-reset {
    background: #f0f0f0;
    color: #333;
}

.filter-reset:hover {
    background: #e0e0e0;
}

.filter-submit svg,
.filter-reset svg {
    flex-shrink: 0;
}

/* Loading */
.filter-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    color: #666;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f0f0f0;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Results Count */
.filter-results-count {
    padding: 15px;
    background: #f0f7fc;
    border-radius: 6px;
    text-align: center;
    margin-top: 15px;
    color: #2271b1;
    font-weight: 500;
}

.filter-results-count .count {
    font-size: 18px;
    font-weight: 700;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .elevateck-filters-wrapper {
        padding: 15px;
    }
    
    .elevateck-filters-form {
        gap: 15px;
    }
    
    .filter-range .range-inputs {
        flex-direction: column;
        gap: 8px;
    }
    
    .filter-range .range-separator {
        display: none;
    }
    
    .filter-buttons {
        flex-direction: column;
    }
    
    .filter-submit,
    .filter-reset {
        width: 100%;
    }
}

/* Divi 5 Loop Integration - Hidden items */
.elevateck-hidden,
[data-loop-id].elevateck-hidden {
    display: none !important;
}

/* Animation for showing/hiding */
[data-loop-id] {
    transition: opacity 0.3s ease;
}

[data-loop-id].elevateck-filtering {
    opacity: 0.5;
}

/* No results message */
.elevateck-no-results {
    grid-column: 1 / -1;
    padding: 40px 20px;
    text-align: center;
    background: #f9f9f9;
    border-radius: 8px;
    color: #666;
}

.elevateck-no-results svg {
    width: 48px;
    height: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.elevateck-no-results p {
    margin: 0;
    font-size: 16px;
}

/* Results Count */
.filter-results-count {
    text-align: center;
    padding: 12px;
    background: #e8f4f8;
    border-radius: 6px;
    color: #0073aa;
    font-weight: 500;
    margin-top: 15px;
}

.filter-results-count strong {
    font-size: 1.2em;
}

/* Category clear option */
.category-clear {
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.category-clear .category-label {
    color: #666;
    font-style: italic;
}

/* Reset button as link */
a.filter-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f5f5f5;
    color: #666;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

a.filter-reset:hover {
    background: #eee;
    color: #333;
}
