/**
 * Villa Filter Widget Styles - Complete Dual Widget Version
 * Save this as: /css/villa-filter.css in your child theme directory
 */

/* Widget Container - Base Styles */
#villa-filter-widget {
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Form container */
.villa-filter-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: all 0.3s ease;
}

/* Filter Groups */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f3f4;
    transition: all 0.3s ease;
}

.filter-group:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #007cba;
}

.filter-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

.filter-label:before {
    content: "";
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, #007cba, #0056b3);
    border-radius: 2px;
    margin-right: 10px;
}

/* Number Range Fields - Always Side by Side */
.number-range {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: end;
}

.number-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.number-field label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    margin: 0;
}

.number-field input[type="number"] {
    padding: 10px 12px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
    font-weight: 400;
    color: #2c3e50;
}

.number-field input[type="number"]:focus {
    border-color: #007cba;
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 124, 186, 0.15);
    transform: translateY(-1px);
}

.number-field input[type="number"].has-value {
    border-color: #28a745;
    background: linear-gradient(135deg, #f8fff9 0%, #fff 100%);
}

.number-field input[type="number"].error {
    border-color: #dc3545;
    background: linear-gradient(135deg, #fff5f5 0%, #fff 100%);
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.number-field input[type="number"]::placeholder {
    color: #adb5bd;
    font-style: italic;
    font-weight: 400;
}

.number-field input[type="number"]:hover {
    border-color: #007cba;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.1);
}

/* Remove default number input spinners */
.number-field input[type="number"]::-webkit-outer-spin-button,
.number-field input[type="number"]::-webkit-inner-spin-button {
    margin: 0;
}

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

.filter-submit,
.filter-reset {
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
}

.filter-submit {
    background: linear-gradient(135deg, #007cba 0%, #0056b3 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.3);
}

.filter-submit:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 124, 186, 0.4);
}

.filter-reset {
    background: #6c757d;
    color: white;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.2);
}

.filter-reset:hover {
    background: #545b62;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* Villa Facilities Filter */
.filter-facility .facilities-grid {
    max-height: 330px;
    overflow-y: scroll;
}

.facilities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.facility-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    font-size: 14px;
}

.facility-checkbox {
    margin-right: 8px;
    accent-color: #007cba;
}

.facility-checkbox:checked + .facility-label {
    font-weight: 600;
    color: #007cba;
}

.facility-label {
    user-select: none;
    transition: all 0.3s ease;
}

/* Mobile Filter Wrapper - NEW DUAL WIDGET STYLES */
.villa-filter-mobile-wrapper {
    display: none;
    margin: 20px 0;
    text-align: center;
}

@media (max-width: 767px) {
    .villa-filter-mobile-wrapper {
        display: block;
    }
    
    /* Hide sidebar widget on mobile */
    .widget.villa-filter-widget {
        display: none !important;
    }
}

@media (min-width: 768px) {
    /* Hide mobile widget on desktop */
    .villa-filter-mobile-wrapper {
        display: none !important;
    }
}

/* Mobile Toggle Button */
.villa-filter-mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #007cba 0%, #0056b3 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
    width: 100%;
    max-width: 200px;
    margin: 0 auto 15px auto;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.villa-filter-mobile-toggle:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 124, 186, 0.4);
}

.villa-filter-mobile-toggle:active {
    transform: scale(0.95);
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
}

.villa-filter-mobile-toggle .toggle-icon {
    transition: transform 0.3s ease;
}

/* Mobile Widget Container */
.villa-filter-mobile-widget {
    margin-top: 15px;
    text-align: left;
}

.mobile-widget-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.mobile-widget-title {
    display: none; /* Hide title for mobile */
}

/* Search Results Info */
.villa-search-info {
    margin-bottom: 30px !important;
}

.villa-search-info h2 {
    margin: 0 0 10px 0;
    color: #007cba;
    font-size: 24px;
    font-weight: 700;
}

.villa-search-info p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

.villa-search-info strong {
    color: #2c3e50;
}

/* Widget Title Styling */
.villa-filter-widget .widget-title {
    display: none;
}

/* Rating Range Slider Styles */
.rating-range-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.rating-slider-wrapper {
    position: relative;
    height: 40px;
    display: flex;
    align-items: center;
}

.rating-range-slider {
    position: relative;
    width: 100%;
    height: 6px;
}

.rating-slider {
    position: absolute;
    width: 100%;
    height: 6px;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.rating-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #007cba;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    pointer-events: all;
    position: relative;
    z-index: 3;
}

.rating-slider::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #007cba;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    pointer-events: all;
    border: none;
}

.rating-slider-track {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    z-index: 1;
}

.rating-slider-range {
    position: absolute;
    top: 0;
    height: 6px;
    background: linear-gradient(90deg, #007cba 0%, #0056b3 100%);
    border-radius: 3px;
    z-index: 2;
}

.rating-inputs-row {
    display: flex;
    gap: 15px;
    justify-content: space-between;
}

.rating-input-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rating-input-label {
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rating-input {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    background: #f8f9fa;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.rating-input:focus {
    border-color: #007cba;
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 124, 186, 0.15);
    background: white;
}

.rating-input:hover {
    border-color: #007cba;
    background: white;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .rating-range-container {
        gap: 12px;
    }
    
    .rating-slider-wrapper {
        height: 35px;
    }
    
    .rating-slider::-webkit-slider-thumb {
        height: 18px;
        width: 18px;
    }
    
    .rating-slider::-moz-range-thumb {
        height: 18px;
        width: 18px;
    }
    
    .rating-inputs-row {
        gap: 12px;
    }
    
    .rating-input {
        padding: 10px 14px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* RESPONSIVE BEHAVIOR */

/* Desktop: Normal sidebar behavior */
@media (min-width: 768px) {
    /* Widget normal styles */
    #villa-filter-widget {
        margin-bottom: 25px;
        width: auto;
    }
    
    /* Side-by-side buttons on larger screens */
    .filter-buttons {
        gap: 15px;
    }
}

/* Mobile: Show mobile widget and adjust spacing */
@media (max-width: 767px) {
    
    /* Mobile spacing adjustments for both widgets */
    #villa-filter-widget,
    .villa-filter-mobile-widget #villa-filter-widget {
        width: 100%;
        margin: 0;
    }
    
    .villa-filter-form {
        gap: 15px;
    }
    
    .filter-group {
        padding: 15px;
        gap: 10px;
    }
    
    .filter-label {
        font-size: 14px;
    }
    
    .number-range {
        gap: 10px;
    }
    
    .number-field input[type="number"] {
        padding: 10px 12px;
        font-size: 16px; /* Prevent zoom on iOS */
        min-height: 44px;
    }
    
    .filter-buttons {
        gap: 10px;
        flex-direction: column;
    }
    
    .filter-submit,
    .filter-reset {
        padding: 12px 18px;
        font-size: 14px;
        min-height: 50px;
        touch-action: manipulation;
    }
    
    .filter-submit:active {
        transform: scale(0.98);
    }
    
    .filter-reset:active {
        transform: scale(0.98);
    }
    
    /* Mobile facilities grid */
    .facilities-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .facility-option {
        font-size: 16px; /* Prevent zoom on iOS */
        cursor: pointer;
        border-radius: 8px;
        border: 1px solid transparent;
    }
    
    .facility-option:active {
        background-color: #f0f8ff;
        transform: scale(0.98);
    }
    
    .facility-checkbox {
        width: 20px;
        height: 20px;
        margin-right: 12px;
    }
    
    .villa-search-info {
        padding: 15px 0;
        margin-bottom: 20px;
    }
    
    .villa-search-info h2 {
        font-size: 20px;
    }
    
    .villa-search-info p {
        font-size: 13px;
    }
}