/**
 * ETHICAL BUSINESS FINDER
 * Find worker cooperatives and ethical businesses in your area
 * Created: January 23, 2025
 */

/* Section Container */
.ethical-business-section {
  background: var(--section-business);
  padding: 4rem 0;
  min-height: 60vh;
}

/* Mobile Section Spacing */
@media (max-width: 768px) {
  .ethical-business-section {
    padding: 2rem 0;
    min-height: 100vh; /* Ensure section takes full viewport on mobile */
  }

  .ethical-business-container {
    padding: 0 1rem;
  }
}

.ethical-business-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header */
.ethical-business-header {
  text-align: center;
  margin-bottom: 3rem;
}

.ethical-business-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  color: #ffffff;
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.ethical-business-badge i {
  font-size: 1.1rem;
}

.ethical-business-title {
  font-size: 2.75rem;
  font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 1rem;
  line-height: 1.2;
}

.ethical-business-subtitle {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin: 0 0 1rem;
  font-weight: 500;
}

.ethical-business-description {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Personalization Prompt (shows when not enabled) */
.ethical-business-prompt {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 3rem;
  text-align: center;
  max-width: 700px;
  margin: 2rem auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.ethical-business-prompt-icon {
  font-size: 4rem;
  color: #48bb78;
  margin-bottom: 1.5rem;
}

.ethical-business-prompt h3 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 1rem;
}

.ethical-business-prompt p {
  font-size: 1.1rem;
  color: #4a5568;
  margin: 0 0 2rem;
  line-height: 1.6;
}

.ethical-business-prompt-features {
  background: #f7fafc;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2rem 0;
  text-align: left;
}

.ethical-business-prompt-features h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #2d3748;
  margin: 0 0 1rem;
  text-align: center;
}

.ethical-business-prompt-features ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ethical-business-prompt-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 0;
  font-size: 0.95rem;
  color: #4a5568;
}

.ethical-business-prompt-features li i {
  color: #48bb78;
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.ethical-business-prompt-button {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  color: #ffffff;
  padding: 1rem 2rem;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.ethical-business-prompt-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

.ethical-business-prompt-privacy {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: #718096;
}

.ethical-business-prompt-privacy i {
  color: #48bb78;
}

/* Search Interface (shows when enabled) */
.ethical-business-interface {
  display: none;
}

.ethical-business-interface.active {
  display: block;
}

.ethical-business-search {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.ethical-business-search h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ethical-business-search h3 i {
  color: #48bb78;
}

.search-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.search-input-group {
  position: relative;
}

.search-input-group input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.search-input-group input:focus {
  outline: none;
  border-color: #48bb78;
  box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.1);
}

.search-input-group i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #718096;
}

.search-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.75rem;
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.search-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.search-filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 0.5rem 1rem;
  background: #f7fafc;
  border: 2px solid #e2e8f0;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #4a5568;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip:hover {
  border-color: #48bb78;
  background: #f0fff4;
  color: #38a169;
}

.filter-chip.active {
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  color: #ffffff;
  border-color: #38a169;
}

/* Current Location Display */
.current-location {
  background: #f0fff4;
  border: 1px solid #c6f6d5;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.current-location-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.current-location-info i {
  color: #48bb78;
  font-size: 1.25rem;
}

.current-location-info span {
  font-size: 0.95rem;
  color: #2f855a;
  font-weight: 500;
}

.change-location {
  background: transparent;
  border: 1px solid #48bb78;
  color: #38a169;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.change-location:hover {
  background: #f0fff4;
}

/* Results Grid */
.ethical-business-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.business-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.75rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.business-card:hover {
  border-color: #48bb78;
  box-shadow: 0 8px 24px rgba(72, 187, 120, 0.15);
  transform: translateY(-4px);
}

.business-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.business-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.business-icon.cooperative {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.business-icon.ethical {
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.business-icon.community {
  background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
}

.business-icon.social {
  background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}

.business-card-title {
  flex: 1;
}

.business-card-title h4 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 0.25rem;
}

.business-type {
  font-size: 0.85rem;
  font-weight: 500;
  color: #718096;
}

.business-card-content p {
  font-size: 0.95rem;
  color: #4a5568;
  line-height: 1.6;
  margin: 0 0 1rem;
}

.business-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.business-location {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #718096;
}

.business-location i {
  color: #48bb78;
}

.business-actions {
  display: flex;
  gap: 0.5rem;
}

.business-action-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #718096;
}

.business-action-btn:hover {
  background: #f7fafc;
  border-color: #48bb78;
  color: #48bb78;
}

/* No Results State */
.no-results {
  text-align: center;
  padding: 4rem 2rem;
}

.no-results-icon {
  font-size: 4rem;
  color: #cbd5e0;
  margin-bottom: 1.5rem;
}

.no-results h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2d3748;
  margin: 0 0 0.75rem;
}

.no-results p {
  font-size: 1rem;
  color: #718096;
  margin: 0 0 1.5rem;
  line-height: 1.6;
}

.submit-business-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  background: #ffffff;
  border: 2px solid #48bb78;
  color: #38a169;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.submit-business-btn:hover {
  background: #f0fff4;
  transform: translateY(-2px);
}

/* Loading State */
.loading-state {
  text-align: center;
  padding: 3rem;
}

.loading-spinner {
  width: 3rem;
  height: 3rem;
  border: 4px solid #e2e8f0;
  border-top-color: #48bb78;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

.loading-state p {
  color: #718096;
  font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .ethical-business-section {
    padding: 3rem 0;
  }

  .ethical-business-container {
    padding: 0 1.5rem;
  }

  .ethical-business-title {
    font-size: 2rem;
  }

  .ethical-business-subtitle {
    font-size: 1.1rem;
  }

  .ethical-business-prompt {
    padding: 2rem 1.5rem;
  }

  .ethical-business-prompt-icon {
    font-size: 3rem;
  }

  .ethical-business-prompt h3 {
    font-size: 1.5rem;
  }

  .search-controls {
    grid-template-columns: 1fr;
  }

  .search-button {
    width: 100%;
    justify-content: center;
  }

  .current-location {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .change-location {
    width: 100%;
  }

  .ethical-business-results {
    grid-template-columns: 1fr;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .business-card,
  .search-button,
  .ethical-business-prompt-button,
  .submit-business-btn {
    transition: none;
  }

  .business-card:hover {
    transform: none;
  }

  .loading-spinner {
    animation: none;
  }
}

/* AI Chat Widget */
/* Ethical Business Chat Widget - Now using standardized inline-chat-widget.css */
/* Chat widget styling moved to inline-chat-widget.css for consistency with civic and jobs chats */

/* Keep only ethical-business-specific message styling if needed */
.ethical-business-section .message-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.ethical-business-section .typing-dots {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.ethical-business-section .typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FF9A56;
  animation: bounce 1.4s infinite ease-in-out;
}

.ethical-business-section .typing-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.ethical-business-section .typing-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Responsive Chat Widget */
@media (max-width: 768px) {
  .ethical-business-chat-widget {
    margin-top: 2rem;
    border-radius: 12px;
  }

  .chat-widget-body {
    height: 350px; /* Shorter on mobile */
    padding: 1rem;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .chat-widget-header {
    padding: 1rem;
  }

  .chat-widget-title {
    font-size: 1rem;
    flex-wrap: wrap;
  }

  .chat-widget-title i {
    font-size: 1.25rem;
  }

  .chat-widget-subtitle {
    font-size: 0.75rem;
    flex-wrap: wrap;
  }

  .chat-widget-footer {
    padding: 0.75rem;
  }

  .chat-input-container {
    gap: 0.5rem;
  }

  .chat-input {
    font-size: 0.9rem;
    padding: 0.75rem;
  }

  .chat-send-btn {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
  }

  .chat-widget-actions {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
    margin-top: 0.5rem;
  }

  .chat-action-btn {
    justify-content: center;
    font-size: 0.85rem;
    padding: 0.75rem;
  }

  .chat-privacy-badge {
    justify-content: center;
    font-size: 0.8rem;
  }

  /* Reduce message spacing on mobile - SPECIFIC SELECTOR to avoid conflicts */
  .ethical-business-section .chat-messages {
    gap: 0.75rem;
  }

  .message-avatar {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
  }

  .message-content {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    color: #2d3748; /* Dark text on mobile */
  }

  .message-content ul {
    margin: 0.5rem 0 0.5rem 1rem;
    padding-left: 0.5rem;
    list-style-position: inside;
  }

  .message-content li {
    margin: 0.25rem 0;
    line-height: 1.5;
    padding-left: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .chat-message {
    align-items: flex-start;
  }
}

/* Focus Visible */
.search-button:focus-visible,
.filter-chip:focus-visible,
.business-action-btn:focus-visible,
.ethical-business-prompt-button:focus-visible,
.change-location:focus-visible,
.submit-business-btn:focus-visible,
.chat-send-btn:focus-visible,
.chat-action-btn:focus-visible {
  outline: 3px solid #48bb78;
  outline-offset: 2px;
}

.chat-input:focus-visible {
  outline: none;
}
