/* Businesses Page Styles */

/* Page Header */
.page-header {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
  color: var(--white);
  padding: 120px 0 80px;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

.page-header .container {
  position: relative;
  z-index: 2;
}

.header-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.header-content h1 {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-content p {
  font-size: 1.25rem;
  line-height: 1.6;
  margin-bottom: 3rem;
  opacity: 0.9;
}

.header-stats {
  display: flex;
  justify-content: center;
  gap: 4rem;
  margin-top: 3rem;
}

.header-stats .stat {
  text-align: center;
}

.header-stats .stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.5rem;
}

.header-stats .stat-label {
  font-size: 0.9rem;
  color: var(--white);
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Search Section */
.search-section {
  background: var(--white);
  padding: 60px 0;
  border-bottom: 1px solid var(--light-gray);
}

.search-container {
  max-width: 1200px;
  margin: 0 auto;
}

.search-filters {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  border: 1px solid var(--light-gray);
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
}

.filter-group label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.filter-input,
.filter-select {
  padding: 0.75rem 1rem;
  border: 2px solid var(--light-gray);
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: all 0.3s ease;
  background: var(--white);
}

.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.price-range {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.price-range .filter-input {
  flex: 1;
}

.range-separator {
  color: var(--text-secondary);
  font-weight: 500;
}

.filter-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.search-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  border: none;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.search-button.primary {
  background: var(--primary-blue);
  color: var(--white);
}

.search-button.primary:hover {
  background: var(--secondary-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.search-button.secondary {
  background: var(--white);
  color: var(--text-primary);
  border: 2px solid var(--light-gray);
}

.search-button.secondary:hover {
  border-color: var(--primary-blue);
  color: var(--primary-blue);
}

/* Results Section */
.results-section {
  background: var(--off-white);
  padding: 60px 0;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.results-info h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.results-count {
  color: var(--text-secondary);
  font-size: 1rem;
}

.view-controls {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.view-toggle {
  display: flex;
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 0.25rem;
  border: 1px solid var(--light-gray);
}

.view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-secondary);
}

.view-btn.active {
  background: var(--primary-blue);
  color: var(--white);
}

.view-btn:hover:not(.active) {
  background: var(--light-gray);
  color: var(--text-primary);
}



/* Business Cards Grid */
.businesses-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}

.listing-card {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid var(--light-gray);
}

.listing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-blue);
}

.listing-image {
  position: relative;
  height: 200px;
  background: var(--light-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.listing-featured-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.listing-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.5rem 1rem;
  background: var(--primary-blue);
  color: var(--white);
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.image-placeholder {
  width: 80px;
  height: 80px;
  background: var(--primary-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 2rem;
}

.business-badges {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.badge {
  padding: 0.25rem 0.75rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.featured {
  background: var(--primary-blue);
  color: var(--white);
}

.badge.verified {
  background: var(--success);
  color: var(--white);
}

.badge.new {
  background: var(--secondary-blue);
  color: var(--white);
}

.badge.hot {
  background: var(--warning);
  color: var(--white);
}

.badge.premium {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: var(--white);
}

.badge.organic {
  background: var(--success);
  color: var(--white);
}

.business-price {
  text-align: right;
}

.business-price .price {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-blue);
}

.business-price .price-note {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.listing-content {
  padding: 1.5rem;
}

.listing-content h4 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.listing-location {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.listing-description {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.listing-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.listing-stats .stat {
  padding: 0.25rem 0.75rem;
  background: var(--pale-blue);
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--light-gray);
}

.listing-stats .stat-label {
  display: inline;
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-right: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.listing-stats .stat-value {
  display: inline;
  font-weight: 600;
  color: var(--primary-blue);
  font-size: 0.8rem;
}

.business-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tag {
  padding: 0.25rem 0.75rem;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
}

.listing-price {
  margin-bottom: 1.5rem;
}

.listing-price .price {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-blue);
  margin-bottom: 0.25rem;
}

.listing-price .price-note {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.card-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--light-gray);
  display: flex;
}

.btn-primary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-blue);
  color: var(--white);
  flex: 1;
}

.btn-primary:hover {
  background: var(--secondary-blue);
  transform: translateY(-2px);
}



/* Load More Button */
.load-more-container {
  text-align: center;
  margin-top: 3rem;
}

.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2.5rem;
  background: var(--white);
  color: var(--primary-blue);
  border: 2px solid var(--primary-blue);
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.load-more-btn:hover {
  background: var(--primary-blue);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* List View Styles */
.businesses-grid.list-view {
  grid-template-columns: 1fr;
}

.businesses-grid.list-view .listing-card {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  gap: 1.5rem;
}

.businesses-grid.list-view .listing-image {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.businesses-grid.list-view .listing-content {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.businesses-grid.list-view .card-footer {
  grid-column: 3;
  flex-direction: column;
  justify-content: center;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .header-stats {
    gap: 2rem;
  }
  
  .header-stats .stat-number {
    font-size: 2rem;
  }
  
  .businesses-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .page-header {
    padding: 100px 0 60px;
  }
  
  .header-content h1 {
    font-size: 2.5rem;
  }
  
  .header-content p {
    font-size: 1.1rem;
  }
  
  .header-stats {
    gap: 1.5rem;
  }
  
  .header-stats .stat-number {
    font-size: 2rem;
  }
  .header-stats .stat-label {
    font-size: 0.7rem;
  }

  .search-section {
    padding: 40px 0;
  }
  
  .search-filters {
    padding: 1.5rem;
  }
  
  .filter-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .filter-actions {
    flex-direction: column;
  }
  
  .results-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .view-controls {
    width: 100%;
    justify-content: space-between;
  }
  
  .businesses-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  .business-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .businesses-grid.list-view .listing-card {
    grid-template-columns: 1fr;
  }
  
  .businesses-grid.list-view .listing-image,
  .businesses-grid.list-view .listing-content,
  .businesses-grid.list-view .card-footer {
    grid-column: 1;
  }
}

@media (max-width: 480px) {
  .header-content h1 {
    font-size: 2rem;
  }
  
  .header-content p {
    font-size: 1rem;
  }
  
  .search-filters {
    padding: 1rem;
  }
  
  .businesses-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .listing-image {
    padding: 0;
  }
  
  .listing-content,
  .card-footer {
    padding: 1rem;
  }
  
  .listing-stats {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .card-footer {
    flex-direction: column;
  }
  
  .btn-primary {
    width: 100%;
  }
}

/* Animation Classes */
.listing-card {
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
  transform: translateY(30px);
}

.business-card:nth-child(1) { animation-delay: 0.1s; }
.business-card:nth-child(2) { animation-delay: 0.2s; }
.business-card:nth-child(3) { animation-delay: 0.3s; }
.business-card:nth-child(4) { animation-delay: 0.4s; }
.business-card:nth-child(5) { animation-delay: 0.5s; }
.business-card:nth-child(6) { animation-delay: 0.6s; }
.business-card:nth-child(7) { animation-delay: 0.7s; }
.business-card:nth-child(8) { animation-delay: 0.8s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading States */
.business-card.loading {
  pointer-events: none;
  opacity: 0.6;
}

.load-more-btn.loading {
  pointer-events: none;
  opacity: 0.6;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.empty-state p {
  font-size: 1rem;
  line-height: 1.6;
}

/* Compact Search Toolbar */
.search-toolbar {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  background: var(--off-white);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--light-gray);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: var(--border-radius);
  padding: 0.5rem 0.75rem;
}

.toolbar-group i {
  color: var(--text-secondary);
}

.toolbar-input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 0.95rem;
  background: transparent;
}

.toolbar-select {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.toolbar-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--light-gray);
  background: var(--white);
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toolbar-button.primary {
  background: var(--primary-blue);
  color: var(--white);
  border-color: var(--primary-blue);
}

.toolbar-button.primary:hover {
  background: var(--secondary-blue);
}

.toolbar-button.ghost:hover {
  border-color: var(--primary-blue);
  color: var(--primary-blue);
}

/* Advanced Filters Collapse */
.advanced-filters {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  transition: max-height 0.3s ease, opacity 0.25s ease, transform 0.25s ease, padding 0.3s ease;
}

.advanced-filters.expanded {
  max-height: 800px;
  opacity: 1;
  transform: translateY(0);
  padding-top: 1rem;
}

/* Responsive for toolbar */
@media (max-width: 1024px) {
  .search-toolbar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .search-toolbar {
    grid-template-columns: 1fr;
  }
  .toolbar-actions {
    justify-content: stretch;
  }
  .toolbar-button {
    width: 100%;
  }
}

/* Adjust grid to fit 4 controls nicely on desktop */
.search-toolbar {
  grid-template-columns: 1.2fr 1fr 1fr 1fr auto;
}

@media (max-width: 1024px) {
  .search-toolbar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .search-toolbar {
    grid-template-columns: 1fr;
  }
}

/* Loading and Error States */
.loading-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  grid-column: 1 / -1;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loading-content i {
  font-size: 48px;
  color: var(--primary-blue);
  animation: spin 1s linear infinite;
}

.loading-content p {
  color: var(--text-secondary);
  font-size: 16px;
}

.error-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 60px 20px;
  text-align: center;
  grid-column: 1 / -1;
}

.error-message i {
  font-size: 48px;
  color: var(--error);
}

.error-message h3 {
  font-size: 24px;
  font-weight: 600;
  margin: 0;
}

.error-message p {
  color: var(--text-secondary);
  margin: 0;
}

.retry-btn {
  padding: 12px 24px;
  background: var(--primary-blue);
  color: var(--white);
  border: none;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.retry-btn:hover {
  background: var(--secondary-blue);
  transform: translateY(-2px);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Pagination Styles */
.pagination {
  display: flex;
  justify-content: center;
  margin-top: 40px;
  padding: 20px 0;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination-btn {
  padding: 12px 16px;
  border: 1px solid var(--light-gray);
  background: var(--white);
  color: var(--text-primary);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 44px;
  justify-content: center;
}

.pagination-btn:hover {
  background: var(--pale-blue);
  border-color: var(--primary-blue);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pagination-btn.prev,
.pagination-btn.next {
  min-width: 100px;
}

.pagination-page {
  padding: 12px 16px;
  background: var(--primary-blue);
  color: var(--white);
  border-radius: var(--border-radius);
  font-weight: 600;
  min-width: 44px;
  text-align: center;
}

.page-btn {
  padding: 12px 16px;
  border: 1px solid var(--light-gray);
  background: var(--white);
  color: var(--text-primary);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.page-btn:hover {
  background: var(--pale-blue);
  border-color: var(--primary-blue);
}

.page-btn.active {
  background: var(--primary-blue);
  color: var(--white);
  border-color: var(--primary-blue);
}

/* No Results State */
.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 80px 20px;
  text-align: center;
  grid-column: 1 / -1;
}

.no-results i {
  font-size: 64px;
  color: var(--text-secondary);
  opacity: 0.5;
}

.no-results h3 {
  font-size: 28px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

.no-results p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 16px;
  max-width: 400px;
  line-height: 1.6;
}

.no-results .btn-primary {
  margin-top: 16px;
}
