/**
 * Dynamic Listings System - Frontend Styles
 *
 * @package Dynamic_Listings_System
 */

/* Container */
#dls-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Loading */
.dls-loading {
  text-align: center;
  padding: 40px 20px;
  font-size: 16px;
  color: #555;
}

.dls-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: #0073aa;
  border-radius: 50%;
  animation: dls-spin 0.8s linear infinite;
  margin-right: 10px;
  vertical-align: middle;
}

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

/* Error */
.dls-error {
  background-color: #f8d7da;
  color: #721c24;
  padding: 15px;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  margin: 20px 0;
}

/* Listings Grid */
.dls-listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 30px;
}

/* Listing Card */
.dls-listing-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.dls-listing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Card Image */
.dls-card-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
  background-color: #f5f5f5;
}

/* Listing Type Badge */
.dls-listing-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 5;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.dls-badge-rent {
  background-color: rgba(33, 150, 243, 0.5);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.dls-badge-sale {
  background-color: rgba(76, 175, 80, 0.5);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.dls-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.dls-listing-card:hover .dls-card-image img {
  transform: scale(1.05);
}

.dls-card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
  color: #999;
  font-size: 14px;
}

/* Card Content */
.dls-card-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dls-card-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 8px 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dls-card-location {
  font-size: 14px;
  color: #666;
  margin: 0 0 16px 0;
}

/* Property Details */
.dls-property-details {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.dls-detail-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #333;
}

.dls-detail-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dls-detail-icon svg {
  width: 100%;
  height: 100%;
  fill: #666;
}

/* Card Footer */
.dls-card-footer {
  border-top: 1px dashed #e0e0e0;
  padding-top: 16px;
  padding-right: 60px;
  display: flex;
  align-items: center;
  margin-top: auto;
}

.dls-card-price {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
}

/* Card Button - Positioned in bottom right */
.dls-card-button {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: #1a1a1a;
  border: none;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, transform 0.2s ease;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.dls-card-button:hover {
  background-color: #333;
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dls-card-button:active {
  transform: scale(0.95);
}

.dls-card-button svg {
  width: 22px;
  height: 22px;
  fill: #ffffff;
}

/* No Results */
.dls-no-results {
  text-align: center;
  padding: 60px 20px;
  color: #666;
  font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
  .dls-listings-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .dls-card-title {
    font-size: 16px;
  }

  .dls-card-price {
    font-size: 18px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .dls-listings-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Pagination */
.dls-pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
  padding: 20px 0;
}

.dls-pagination-info {
  font-size: 14px;
  color: #666;
}

.dls-pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dls-page-numbers {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dls-page-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  background-color: #ffffff !important;
  border: 1px solid #e0e0e0 !important;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500 !important;
  color: #333 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.dls-page-btn:hover:not(:disabled) {
  background-color: #f5f5f5 !important;
  border-color: #ccc !important;
}

.dls-page-btn:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

.dls-page-btn.dls-page-active {
  background-color: #1a1a1a !important;
  border-color: #1a1a1a !important;
  color: #ffffff !important;
}

.dls-page-btn svg {
  fill: currentColor;
}

.dls-page-prev,
.dls-page-next {
  font-weight: 500;
}

.dls-page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  color: #999;
  font-size: 14px;
}

/* Responsive pagination */
@media (max-width: 768px) {
  .dls-pagination {
    margin-top: 30px;
  }

  .dls-pagination-controls {
    flex-wrap: wrap;
    justify-content: center;
  }

  .dls-page-numbers {
    order: 2;
    width: 100%;
    justify-content: center;
    margin-top: 8px;
  }

  .dls-page-prev {
    order: 1;
  }

  .dls-page-next {
    order: 3;
  }

  .dls-page-btn {
    min-width: 36px;
    height: 36px;
    font-size: 13px;
  }
}