/**
 * ==========================================
 * WORKLY - ESTILOS PRINCIPAIS
 * ==========================================
 *
 * Este arquivo contém todos os estilos para a página de listagem de espaços.
 *
 * Estrutura:
 * 1. Reset e configurações base
 * 2. Componentes reutilizáveis (botões, containers)
 * 3. Seção Hero
 * 4. Seção de filtros
 * 5. Seção de listagem de espaços
 * 6. Estados especiais (loading, sem resultados)
 * 7. Notificações
 * 8. Responsividade
 * 9. Paginação
 * 10. Responsividade para Paginação
 */

/* ==========================================
   1. RESET E CONFIGURAÇÕES BASE
   ========================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", "Arial", "Helvetica", sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f9fafb;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ==========================================
   2. COMPONENTES REUTILIZÁVEIS
   ========================================== */

/* Botões base */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

/* Botão primário */
.btn-primary {
  background-color: #1e40af;
  color: white;
}

.btn-primary:hover {
  background-color: #1d4ed8;
}

/* Botão com contorno */
.btn-outline {
  background-color: transparent;
  color: #1e40af;
  border: 1px solid #1e40af;
}

.btn-outline:hover {
  background-color: #1e40af;
  color: white;
}

/* Botão pequeno */
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

/* ==========================================
   3. SEÇÃO HERO (TÍTULO PRINCIPAL)
   ========================================== */

.hero {
  position: relative;
  padding: 6rem 0;
  background: linear-gradient(135deg, #1e40af 0%, rgba(30, 64, 175, 0.95) 50%, rgba(30, 64, 175, 0.9) 100%);
  overflow: hidden;
}

/* Fundo decorativo do hero */
.hero-background {
  position: absolute;
  inset: 0;
  opacity: 0.1;
}

/* Padrões decorativos */
.hero-pattern::before,
.hero-pattern::after {
  content: "";
  position: absolute;
  width: 24rem;
  height: 24rem;
  background-color: white;
  border-radius: 50%;
  filter: blur(3rem);
}

.hero-pattern::before {
  top: -12rem;
  left: -12rem;
}

.hero-pattern::after {
  bottom: -12rem;
  right: -12rem;
}

/* Conteúdo do hero */
.hero-content {
  position: relative;
  text-align: center;
  z-index: 10;
}

.hero-title {
  font-size: 4rem;
  font-weight: bold;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero-title-gradient {
  background: linear-gradient(to right, #bfdbfe, white, #dbeafe);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-divider {
  width: 6rem;
  height: 0.25rem;
  background: linear-gradient(to right, transparent, white, transparent);
  margin: 0 auto 1.5rem;
  border-radius: 9999px;
}

.hero-subtitle {
  font-size: 1.5rem;
  color: #bfdbfe;
  max-width: 64rem;
  margin: 0 auto;
  font-weight: 300;
}

/* ==========================================
   4. SEÇÃO DE CONTEÚDO
   ========================================== */

.content-section {
  padding: 3rem 0;
}

/* ==========================================
   5. SEÇÃO DE FILTROS
   ========================================== */

.filters-section {
  background-color: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Cabeçalho dos filtros */
.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.filters-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
}

/* Grid de filtros */
.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

/* Grupo de filtro individual */
.filter-group {
  display: flex;
  flex-direction: column;
}

.filter-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

/* Campo de busca */
.search-input-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
}

.search-input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}

.search-input:focus {
  outline: none;
  border-color: #1e40af;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* Seletores (dropdowns) */
.filter-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background-color: white;
}

.filter-select:focus {
  outline: none;
  border-color: #1e40af;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* ==========================================
   6. FILTROS AVANÇADOS (DROPDOWN)
   ========================================== */

.advanced-filters-container {
  position: relative;
  display: flex;
  align-items: flex-end;
}

/* Botão para abrir filtros avançados */
.btn-advanced-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  border: 1px solid #d1d5db;
  background-color: white;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  height: 38px;
}

.btn-advanced-filters:hover {
  background-color: #f3f4f6;
  border-color: #d1d5db;
}

/* Dropdown dos filtros avançados */
.dropdown-advanced-filters {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  padding: 1.5rem;
  width: 320px;
  z-index: 10;
  max-height: 500px;
  overflow-y: auto;
}

.dropdown-advanced-filters.show {
  display: block;
}

.dropdown-advanced-filters h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #111827;
}

/* Seções dentro do dropdown */
.filter-section-dropdown {
  margin-bottom: 1.25rem;
}

.filter-section-dropdown h5 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.75rem;
}

/* Grupo de checkboxes */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 8px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  padding: 4px 0;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.checkbox-group label:hover {
  background-color: #f9fafb;
  padding-left: 4px;
}

.checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #1e40af;
}

/* Filtros de recursos com ícones */
.resource-filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.resource-filter-icon {
  font-size: 14px;
  color: #6b7280;
  width: 16px;
  text-align: center;
}

/* Controle de range (preço) */
.range-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.range-container input[type="range"] {
  width: 100%;
  height: 8px;
  background: #d1d5db;
  border-radius: 5px;
  outline: none;
  opacity: 0.7;
  transition: opacity .2s;
}

.range-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1e40af;
  cursor: pointer;
}

.range-container input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1e40af;
  cursor: pointer;
}

.range-container span {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e40af;
  text-align: center;
}

/* Ações do dropdown */
.dropdown-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.dropdown-actions .btn {
  flex: 1;
}

/* ==========================================
   7. SEÇÃO DE LISTAGEM DE ESPAÇOS
   ========================================== */

.spaces-section {
  margin-top: 2rem;
}

/* Cabeçalho da listagem */
.spaces-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.spaces-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #111827;
}

.spaces-count {
  color: #6b7280;
  font-size: 0.875rem;
}

/* ==========================================
   8. ESTADOS ESPECIAIS
   ========================================== */

/* Estado de carregamento */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: #6b7280;
}

.loading i {
  margin-right: 0.5rem;
}

/* Estado sem resultados */
.no-results {
  text-align: center;
  padding: 3rem;
}

.no-results-content {
  max-width: 400px;
  margin: 0 auto;
}

.no-results-icon {
  font-size: 3rem;
  color: #d1d5db;
  margin-bottom: 1rem;
}

.no-results h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}

.no-results p {
  color: #6b7280;
  margin-bottom: 1.5rem;
}

/* ==========================================
   9. GRID DE CARDS DOS ESPAÇOS
   ========================================== */

.spaces-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* Card individual do espaço */
.space-card {
  background-color: white;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
  cursor: pointer;
}

.space-card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

/* Container da imagem */
.space-image-container {
  position: relative;
  height: 12rem;
  overflow: hidden;
}

.space-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.space-card:hover .space-image {
  transform: scale(1.05);
}

/* Ações do card (favoritar, compartilhar) */
.space-actions {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.space-card:hover .space-actions {
  opacity: 1;
}

.action-btn {
  width: 2rem;
  height: 2rem;
  background-color: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

.action-btn:hover {
  background-color: white;
}

/* Badge de categoria */
.category-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Cores das categorias */
.category-co-working {
  background-color: #dcfce7;
  color: #166534;
}

.category-reunioes {
  background-color: #dbeafe;
  color: #1e40af;
}

.category-eventos {
  background-color: #f3e8ff;
  color: #7c3aed;
}

.category-estudio {
  background-color: #fef3c7;
  color: #92400e;
}

/* Conteúdo do card */
.space-content {
  padding: 1rem;
}

/* Cabeçalho do card (nome e preço) */
.space-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.space-name {
  font-weight: 600;
  color: #111827;
  font-size: 0.875rem;
  line-height: 1.25;
  flex: 1;
  margin-right: 0.5rem;
}

/* Preço do espaço */
.space-price {
  text-align: right;
  flex-shrink: 0;
}

.price-negotiable {
  color: #2563eb;
  border: 1px solid #2563eb;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
}

.price-value {
  font-weight: 600;
  color: #111827;
  font-size: 0.875rem;
}

.price-type {
  font-size: 0.75rem;
  color: #6b7280;
}

/* Informações do espaço (localização, capacidade) */
.space-info {
  display: flex;
  align-items: center;
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.space-info i {
  margin-right: 0.25rem;
}

.space-info-separator {
  margin: 0 0.25rem;
}

/* Informações de localização */
.location-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.location-info .cidade {
  font-weight: 600;
  color: #374151;
}

.location-info .endereco {
  font-size: 11px;
  color: #9ca3af;
  line-height: 1.2;
}

/* Descrição do espaço */
.space-description {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Recursos/comodidades do espaço */
.space-resources {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  min-height: 28px; /* Garante espaço mesmo sem recursos */
}

.resource-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background-color: #f3f4f6;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.resource-item:hover {
  background-color: #1e40af;
  transform: scale(1.1);
}

.resource-item:hover .resource-icon {
  color: white;
}

.resource-icon {
  font-size: 12px;
  color: #6b7280;
  transition: color 0.2s ease;
}

.resource-more {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 500;
  background-color: #f3f4f6;
  padding: 2px 6px;
  border-radius: 12px;
  margin-left: 4px;
}

.no-resources {
  font-size: 0.75rem;
  color: #9ca3af;
  font-style: italic;
}

/* Avaliação do espaço */
.space-rating {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.rating-stars {
  display: flex;
}

.star {
  width: 0.75rem;
  height: 0.75rem;
}

.star-filled {
  color: #fbbf24;
}

.star-empty {
  color: #d1d5db;
}

.rating-text {
  font-size: 0.75rem;
  color: #6b7280;
}

/* ==========================================
   10. CLASSES UTILITÁRIAS
   ========================================== */

.hidden-data {
  display: none !important;
}

.text-red-500 {
  color: #ef4444;
}

.text-gray-600 {
  color: #6b7280;
}

/* ==========================================
   11. NOTIFICAÇÕES
   ========================================== */

.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 16px;
  z-index: 1000;
  min-width: 300px;
  animation: slideIn 0.3s ease-out;
}

.notification-success {
  border-left: 4px solid #10b981;
}

.notification-error {
  border-left: 4px solid #ef4444;
}

.notification-info {
  border-left: 4px solid #3b82f6;
}

.notification-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification-success .notification-content i {
  color: #10b981;
}

.notification-error .notification-content i {
  color: #ef4444;
}

.notification-info .notification-content i {
  color: #3b82f6;
}

.notification-content span {
  font-size: 14px;
  color: #374151;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ==========================================
   12. RESPONSIVIDADE
   ========================================== */

/* Tablets */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.125rem;
  }

  .filters-grid {
    grid-template-columns: 1fr;
  }

  .spaces-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .spaces-grid {
    grid-template-columns: 1fr;
  }

  .dropdown-advanced-filters {
    width: 100%;
    left: 0;
    right: 0;
  }
}

/* Smartphones */
@media (max-width: 480px) {
  .container {
    padding: 0 0.75rem;
  }

  .hero {
    padding: 4rem 0;
  }

  .hero-title {
    font-size: 2rem;
  }

  .content-section {
    padding: 2rem 0;
  }

  .filters-section {
    padding: 1rem;
  }

  .notification {
    right: 10px;
    left: 10px;
    min-width: auto;
  }
}

/* ==========================================
   13. PAGINAÇÃO
   ========================================== */

.pagination-container {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination-numbers {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  background-color: white;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.pagination-btn:hover {
  background-color: #f3f4f6;
  border-color: #9ca3af;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-btn:disabled:hover {
  background-color: white;
  border-color: #d1d5db;
}

/* Botão da página ativa */
.pagination-number.active {
  background-color: #1e40af;
  border-color: #1e40af;
  color: white;
}

.pagination-number.active:hover {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
}

/* Botões de navegação (anterior/próximo) */
.pagination-prev,
.pagination-next {
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
}

.pagination-prev i,
.pagination-next i {
  font-size: 0.75rem;
}

/* Reticências */
.pagination-ellipsis {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  color: #6b7280;
  font-weight: 500;
}

/* Informações da paginação */
.pagination-info {
  font-size: 0.875rem;
  color: #6b7280;
  text-align: center;
}

/* ==========================================
   14. RESPONSIVIDADE PARA PAGINAÇÃO
   ========================================== */

@media (max-width: 768px) {
  .pagination {
    gap: 0.25rem;
  }

  .pagination-btn {
    min-width: 2.25rem;
    height: 2.25rem;
    font-size: 0.8125rem;
  }

  .pagination-prev,
  .pagination-next {
    padding: 0.5rem;
  }

  .pagination-prev span,
  .pagination-next span {
    display: none;
  }
}

@media (max-width: 480px) {
  .pagination-container {
    margin-top: 1.5rem;
  }

  .pagination {
    gap: 0.125rem;
  }

  .pagination-btn {
    min-width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
  }

  .pagination-info {
    font-size: 0.8125rem;
  }
}
