/**
 * Property Filters Styles
 * Styling for property filters section and form elements
 */

/* Filter Section */
.property-filters {
    background-color: #f8fafc;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
}

/* Filter Form */
.filter-form {
    width: 100%;
}

.filter-form__grid {
    display: grid;
    grid-template-columns: 3fr 0.6fr 0.6fr 0.8fr 1fr;
    gap: 15px;
    align-items: end;
}

/* Filter Fields */
.filter-form__field {
    display: flex;
    flex-direction: column;
}

/* Ensure all form elements have the same height and alignment */
.filter-form__field input,
.filter-form__field select,
.filter-form__field button {
    height: 42px;
    box-sizing: border-box;
    margin-top: 6px; /* Consistent spacing from label */
}

.filter-form__field label {
    font-size: 14px;
    color: #4b5563;
    margin-bottom: 6px;
    font-weight: 500;
    text-align: center;
    width: 100%;
}

.filter-form__field select {
    height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 0 32px 0 12px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-form__field select:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.25);
}

.filter-form__field select.active-filter {
    border-color: #1e3a8a;
    background-color: #f0f5ff;
}

/* Filter Actions */
.filter-form__field--action {
    display: flex;
    gap: 10px;
    align-items: flex-end; /* Align button with bottom of other fields */
}

.filter-form__field--action button,
.filter-form__field--action a {
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    padding: 0 16px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    margin-top: 0; /* Override the margin-top for action buttons */
}

.button--primary {
    background-color: #1e3a8a;
    color: white;
    border: none;
}

.button--primary:hover {
    background-color: #1e40af;
}

.button--secondary {
    background-color: #f3f4f6;
    color: #4b5563;
    border: 1px solid #d1d5db;
}

.button--secondary:hover {
    background-color: #e5e7eb;
}

.button:active {
    transform: translateY(1px);
}

/* No Search Performed State */
.no-search-performed {
    text-align: center;
    padding: 60px 20px;
    background-color: #f8fafc;
    border-radius: 8px;
    margin: 40px 0;
}

.no-search-performed h2 {
    color: #1e3a8a;
    font-size: 24px;
    margin-bottom: 12px;
    font-weight: 600;
}

.no-search-performed p {
    color: #6b7280;
    font-size: 16px;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

.no-search-performed strong {
    color: #1e3a8a;
    font-weight: 600;
}

/* Mobile Toggle Button */
.filter-toggle-button {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    margin-bottom: 15px;
}

.filter-toggle-button svg {
    width: 18px;
    height: 18px;
}

.filter-toggle-button.active {
    background-color: #e5e7eb;
}

/* Responsive Styles */
@media (max-width: 1100px) {
    .filter-form__grid {
        grid-template-columns: 3fr 0.8fr 0.8fr;
    }
    
    .filter-form__field--action {
        grid-column: span 3;
    }
}

@media (max-width: 768px) {
    .filter-toggle-button {
        display: flex;
    }
    
    .filter-form {
        display: none;
    }
    
    .filters-expanded .filter-form {
        display: block;
    }
    
    .filter-form__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .filter-form__field--action {
        grid-column: span 2;
    }
}

@media (max-width: 480px) {
    .filter-form__grid {
        grid-template-columns: 1fr;
    }
    
    .filter-form__field--action {
        grid-column: span 1;
        flex-direction: column;
    }
    
    .filter-form__field--action button,
    .filter-form__field--action a {
        width: 100%;
    }
}

/* Guest Selector Integration - Ensure proper styling in filter form */
.filter-form__field .guest-selector {
    width: 100%;
}

.filter-form__field .guest-selector__trigger {
    height: 42px;
    box-sizing: border-box;
    margin-top: 6px;
}

/* Override any input/select styles that might affect guest selector */
.filter-form__field .guest-selector__trigger:not(select):not(input) {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff !important;
    cursor: pointer;
    font-size: 13px;
}

.filter-form__field .guest-selector__trigger:hover {
    border-color: #93c5fd !important;
}

.filter-form__field .guest-selector__trigger:focus {
    outline: none;
    border-color: #93c5fd !important;
    box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.25);
}

/* Ensure guest selector buttons maintain circular shape but use blue color on properties page */
.filter-form__field .guest-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 50% !important;
    border: 2px solid #1e3a8a !important;
    background-color: #fff !important;
    color: #1e3a8a !important;
    font-size: 1.1rem;
}

.filter-form__field .guest-btn:hover:not(:disabled) {
    background-color: #1e3a8a !important;
    color: #fff !important;
}

.filter-form__field .guest-btn:disabled,
.filter-form__field .guest-btn.disabled {
    border-color: #bdc3c7 !important;
    color: #bdc3c7 !important;
    background-color: #f8f9fa !important;
}

/* Ensure guest selector popup has proper z-index in filter form context */
.filter-form__field .guest-selector__popup {
    z-index: 99999999;
}