/* Rentisphere Property Search Component Styles */

/* CSS Variables for Theming */
:root {
  --rentisphere-blue: #007bff;
  --rentisphere-blue-dark: #0056b3;
  --rentisphere-blue-light: #e3f2fd;
  --rentisphere-light-gray: #f8f9fa;
  --rentisphere-border: #ced4da;
  --rentisphere-border-light: #e9ecef;
  --rentisphere-dark: #343a40;
  --rentisphere-gray: #6c757d;
  --rentisphere-white: #ffffff;
  --rentisphere-success: #28a745;
  --rentisphere-danger: #dc3545;
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 300ms ease-in-out;
}

/* Component Container */
.rentisphere-search-wrapper {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.rentisphere-search-form {
  background: var(--rentisphere-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
}

/* Main Search Bar */
.search-main {
  padding: var(--spacing-lg);
  background: var(--rentisphere-white);
}

.search-input-group {
  display: flex;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

@media (max-width: 640px) {
  .search-input-group {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
}

/* Location Input Field */
.location-field {
  flex: 1;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: var(--spacing-md);
  color: var(--rentisphere-gray);
  z-index: 2;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: var(--spacing-md) var(--spacing-md) var(--spacing-md) 3rem;
  border: 2px solid var(--rentisphere-border-light);
  border-radius: var(--radius-md);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--rentisphere-dark);
  background: var(--rentisphere-white);
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--rentisphere-blue);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-input::placeholder {
  color: var(--rentisphere-gray);
}

/* Search Button */
.search-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--rentisphere-blue);
  color: var(--rentisphere-white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.search-button:hover {
  background: var(--rentisphere-blue-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.search-button:active {
  transform: translateY(0);
}

.search-button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3);
}

@media (max-width: 640px) {
  .search-button {
    width: 100%;
    justify-content: center;
  }
  
  .search-text {
    display: block;
  }
}

/* Filter Toggle */
.filter-toggle {
  display: flex;
  justify-content: center;
}

.toggle-button {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: transparent;
  border: 1px solid var(--rentisphere-border-light);
  border-radius: var(--radius-sm);
  color: var(--rentisphere-gray);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toggle-button:hover {
  background: var(--rentisphere-light-gray);
  border-color: var(--rentisphere-border);
}

.toggle-button.active {
  background: var(--rentisphere-blue-light);
  border-color: var(--rentisphere-blue);
  color: var(--rentisphere-blue);
}

.toggle-button.active .icon-chevron {
  transform: rotate(180deg);
}

.icon-chevron {
  transition: transform var(--transition-fast);
}

/* Advanced Filters Section */
.advanced-filters {
  max-height: 0;
  overflow: hidden;
  background: var(--rentisphere-light-gray);
  border-top: 1px solid var(--rentisphere-border-light);
  transition: all var(--transition-normal);
  opacity: 0;
}

.advanced-filters.expanded {
  max-height: 600px;
  opacity: 1;
  padding: var(--spacing-lg);
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

@media (max-width: 768px) {
  .filters-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
}

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

.filter-group.price-range {
  grid-column: span 2;
}

@media (max-width: 768px) {
  .filter-group.price-range {
    grid-column: span 1;
  }
}

.filter-group.checkbox-group {
  justify-content: center;
}

.filter-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--rentisphere-dark);
  margin-bottom: var(--spacing-sm);
}

/* Select Inputs */
.select-wrapper {
  position: relative;
}

.filter-select {
  width: 100%;
  padding: var(--spacing-sm) 2.5rem var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--rentisphere-border);
  border-radius: var(--radius-sm);
  background: var(--rentisphere-white);
  color: var(--rentisphere-dark);
  font-size: 0.875rem;
  cursor: pointer;
  appearance: none;
  transition: all var(--transition-fast);
}

.filter-select:focus {
  outline: none;
  border-color: var(--rentisphere-blue);
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.select-icon {
  position: absolute;
  right: var(--spacing-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--rentisphere-gray);
  pointer-events: none;
}

/* Price Range Inputs */
.price-inputs {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.price-input-wrapper {
  position: relative;
  flex: 1;
}

.currency-symbol {
  position: absolute;
  left: var(--spacing-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--rentisphere-gray);
  font-size: 0.875rem;
  pointer-events: none;
}

.price-input {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md) var(--spacing-sm) 2rem;
  border: 1px solid var(--rentisphere-border);
  border-radius: var(--radius-sm);
  background: var(--rentisphere-white);
  font-size: 0.875rem;
  color: var(--rentisphere-dark);
  transition: all var(--transition-fast);
}

.price-input:focus {
  outline: none;
  border-color: var(--rentisphere-blue);
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.price-input::placeholder {
  color: var(--rentisphere-gray);
}

.price-separator {
  color: var(--rentisphere-gray);
  font-size: 0.875rem;
  white-space: nowrap;
}

/* Custom Checkbox */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--rentisphere-dark);
}

.checkbox-input {
  position: absolute;
  opacity: 0;
}

.checkbox-input:checked + .checkbox-custom {
  background: var(--rentisphere-blue);
  border-color: var(--rentisphere-blue);
}

.checkbox-input:checked + .checkbox-custom .checkbox-icon {
  opacity: 1;
  transform: scale(1);
}

.checkbox-input:focus + .checkbox-custom {
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.3);
}

.checkbox-custom {
  position: relative;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--rentisphere-border);
  border-radius: var(--radius-sm);
  background: var(--rentisphere-white);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.checkbox-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  color: var(--rentisphere-white);
  opacity: 0;
  transition: all var(--transition-fast);
}

.checkbox-text {
  user-select: none;
}

/* Filter Actions */
.filter-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-md);
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--rentisphere-border-light);
}

@media (max-width: 640px) {
  .filter-actions {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
}

.clear-filters {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-md);
  background: transparent;
  border: 1px solid var(--rentisphere-border);
  border-radius: var(--radius-sm);
  color: var(--rentisphere-gray);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.clear-filters:hover {
  background: var(--rentisphere-light-gray);
  color: var(--rentisphere-dark);
}

@media (max-width: 640px) {
  .clear-filters {
    width: 100%;
    justify-content: center;
  }
}

.apply-filters {
  padding: var(--spacing-sm) var(--spacing-lg);
  background: var(--rentisphere-blue);
  color: var(--rentisphere-white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.apply-filters:hover {
  background: var(--rentisphere-blue-dark);
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .apply-filters {
    width: 100%;
  }
}

/* Error states and indicators */
.price-error-message {
  color: var(--rentisphere-danger);
  font-size: 0.75rem;
  margin-top: var(--spacing-xs);
  display: none;
}

.search-input.error,
.price-input.error {
  border-color: var(--rentisphere-danger);
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
}

.filter-indicator {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: var(--rentisphere-blue);
  border-radius: 50%;
  border: 2px solid white;
}

.toggle-button.has-active-filters {
  background: var(--rentisphere-blue-light);
  border-color: var(--rentisphere-blue);
  color: var(--rentisphere-blue);
}

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

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Animation for mobile responsiveness */
@media (max-width: 640px) {
  .rentisphere-search-form {
    margin: var(--spacing-md);
  }
  
  .filters-grid {
    gap: var(--spacing-md);
  }
  
  .filter-group.price-range .price-inputs {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-group.price-range .price-separator {
    text-align: center;
    padding: var(--spacing-xs) 0;
  }
}

/* Loading and hover states */
.rentisphere-search-form:hover {
  box-shadow: var(--shadow-lg);
}

/* Focus management for accessibility */
.rentisphere-search-form:focus-within {
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1), var(--shadow-lg);
}

/* Animation keyframes */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.advanced-filters.expanded {
  animation: slideDown var(--transition-normal) ease-out;
}