/**
 * Listings Styles
 * Filter badges, grid layout, and listing cards
 */

/* ============================================================
   Listings Section
   ============================================================ */
.listings-section {
  padding: 60px 0;
  background: #ffffff;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  width: 100vw;
}

.listings-header {
  text-align: center;
  padding: 80px 20px;
  margin-bottom: 0;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  width: 100vw;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.5) 0%, rgba(29, 78, 216, 0.5) 100%);
  background-color: #2563EB;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.listings-header h2 {
  font-size: 2.5rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 12px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.listings-header p {
  font-size: 1.125rem;
  color: #ffffff;
  opacity: 0.95;
}

/* ============================================================
   Filter Badges
   ============================================================ */
.filters-container {
  margin-bottom: 40px;
}

.filter-group {
  margin-bottom: 20px;
}

.filter-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.filter-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-badge {
  display: inline-block;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid #D1D5DB;
  background: #E5E7EB;
  color: #1F2937;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filter-badge:hover {
  background: #DBEAFE;
  border-color: #93C5FD;
  transform: scale(1.02);
}

.filter-badge.active {
  background: #3B82F6;
  color: white;
  border-color: #3B82F6;
}

.filter-badge.active:hover {
  background: #2563EB;
  border-color: #2563EB;
}

/* ============================================================
   Listings Grid
   ============================================================ */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}

@media (max-width: 1024px) {
  .listings-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .listings-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Single listing - full width with proportional image height */
.listing-card:only-child {
  grid-column: 1 / -1; /* Span all columns to match header width */
}

.listing-card:only-child .listing-card-image {
  height: 400px; /* Proportional height for wider card */
}

.listing-card:only-child .listing-card-content {
  text-align: center; /* Center-align content for better balance */
}

.listing-card:only-child .listing-card-badges {
  justify-content: center; /* Center badges */
}

.listing-card:only-child .listing-card-location {
  justify-content: center; /* Center location */
}

.listing-card:only-child .listing-card-cta {
  margin: 0 auto; /* Center CTA button */
}

/* ============================================================
   Listing Card
   ============================================================ */
.listing-card {
  background: white;
  border-radius: 12px;
  border: 1px solid #E5E7EB;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

.listing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.listing-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3rem;
}

.listing-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listing-card-badge.media {
  background: transparent;
  padding: 4px 4px;
  font-size: 1.1rem;
}

.listing-card-content {
  padding: 20px;
}

.listing-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.listing-card-badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.listing-card-badge.category {
  background: #DBEAFE;
  color: #1E40AF;
}

.listing-card-badge.buy,
.listing-card-badge.sale {
  background: #D1FAE5;
  color: #065F46;
}

.listing-card-badge.lease {
  background: #FEF3C7;
  color: #92400E;
}

.listing-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1F2937;
  margin-bottom: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 48px;
}

.listing-card-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 8px;
}

.listing-card-location {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #6B7280;
  font-size: 0.875rem;
  margin-bottom: 16px;
}

.listing-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: #3B82F6;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
  text-decoration: none;
}

.listing-card-cta:hover {
  background: #2563EB;
}

/* ============================================================
   Empty State
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #9CA3AF;
  grid-column: 1 / -1;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.empty-state-message {
  font-size: 1.125rem;
  margin-bottom: 8px;
}

.empty-state-hint {
  font-size: 0.875rem;
  color: #D1D5DB;
}

/* ============================================================
   Loading State
   ============================================================ */
.loading-state {
  text-align: center;
  padding: 60px 20px;
  color: #9CA3AF;
  grid-column: 1 / -1;
}
