/* 
 * Property Listings - Specific Styles
 * For Sale and For Rent pages
 */

/* ===== PROPERTY CARD STYLES ===== */
.property-card {
  background: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  overflow: hidden;
  border: 1px solid var(--medium-gray);
}

.property-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

/* ===== PROPERTY IMAGE CONTAINER ===== */
.property-image-container {
  position: relative;
  overflow: hidden;
}

.property-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.property-card:hover .property-image {
  transform: scale(1.05);
}

.property-badges {
  position: absolute;
  top: 15px;
  left: 15px;
  z-index: 2;
}

.property-badges .badge {
  font-size: 0.75rem;
  font-weight: var(--font-weight-semibold);
  padding: 0.5rem 0.75rem;
  border-radius: var(--border-radius-sm);
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  display: inline-block;
}

.property-actions {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.property-card:hover .property-actions {
  opacity: 1;
}

.property-actions .btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: none;
  box-shadow: var(--shadow-sm);
}

.property-actions .btn:hover {
  background: white;
  transform: scale(1.1);
}

/* ===== PROPERTY CONTENT ===== */
.property-content {
  padding: 1.5rem;
}

.property-price {
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold);
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.property-title {
  font-size: 1.25rem;
  font-weight: var(--font-weight-semibold);
  color: var(--dark-gray);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.property-location {
  color: var(--secondary-color);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.property-location i {
  margin-right: 0.5rem;
}

/* ===== PROPERTY FEATURES ===== */
.property-features {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--medium-gray);
}

.feature-item {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  color: var(--secondary-color);
  font-weight: var(--font-weight-medium);
}

.feature-item i {
  margin-right: 0.5rem;
  color: var(--primary-color);
  font-size: 1rem;
}

/* ===== RENTAL SPECIFIC FEATURES ===== */
.rental-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.rental-tag {
  background: var(--light-gray);
  color: var(--secondary-dark);
  padding: 0.25rem 0.75rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
  font-weight: var(--font-weight-medium);
  display: flex;
  align-items: center;
}

.rental-tag i {
  margin-right: 0.5rem;
  color: var(--primary-color);
  font-size: 0.9rem;
}

/* ===== PROPERTY DESCRIPTION ===== */
.property-description {
  margin-bottom: 1.5rem;
}

.property-description p {
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 0;
}

/* ===== PROPERTY FOOTER ===== */
.property-footer {
  border-top: 1px solid var(--medium-gray);
  padding-top: 1rem;
}

.property-agent {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.agent-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 0.75rem;
}

.agent-name {
  font-weight: var(--font-weight-semibold);
  color: var(--dark-gray);
  font-size: 0.9rem;
  line-height: 1.2;
}

.agent-title {
  font-size: 0.8rem;
  color: var(--secondary-color);
  line-height: 1.2;
}

.property-actions-footer {
  display: flex;
  gap: 0.75rem;
}

.property-actions-footer .btn {
  flex: 1;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
}

/* ===== SEARCH FILTERS ===== */
.search-filters {
  border: 1px solid var(--medium-gray);
}

.search-filters .form-label {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.search-filters .form-control,
.search-filters .form-select {
  font-size: 0.9rem;
  padding: 0.6rem 0.75rem;
}

/* ===== VIEW TOGGLE BUTTONS ===== */
.btn-group .btn {
  border-color: var(--medium-gray);
}

.btn-group .btn.active {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* ===== LIST VIEW STYLES ===== */
.property-grid.list-view .property-card {
  display: flex;
  flex-direction: row;
  height: auto;
}

.property-grid.list-view .property-image-container {
  flex: 0 0 300px;
  height: 200px;
}

.property-grid.list-view .property-image {
  height: 100%;
}

.property-grid.list-view .property-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.property-grid.list-view .property-features {
  border-bottom: none;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
}

.property-grid.list-view .property-footer {
  border-top: none;
  padding-top: 0;
  margin-top: auto;
}

.property-grid.list-view .property-actions-footer {
  justify-content: flex-end;
}

.property-grid.list-view .property-actions-footer .btn {
  flex: none;
  min-width: 120px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .property-features {
    gap: 0.75rem;
  }

  .feature-item {
    font-size: 0.85rem;
  }

  .property-actions-footer {
    flex-direction: column;
  }

  .property-actions-footer .btn {
    width: 100%;
  }

  .search-filters .row {
    --bs-gutter-x: 0.75rem;
  }

  .search-filters .form-control,
  .search-filters .form-select {
    font-size: 0.85rem;
    padding: 0.5rem 0.6rem;
  }

  /* Disable list view on mobile */
  .property-grid.list-view .property-card {
    flex-direction: column;
  }

  .property-grid.list-view .property-image-container {
    flex: none;
    height: 250px;
  }
}

@media (max-width: 576px) {
  .property-content {
    padding: 1rem;
  }

  .property-price {
    font-size: 1.25rem;
  }

  .property-title {
    font-size: 1.1rem;
  }

  .rental-features {
    gap: 0.25rem;
  }

  .rental-tag {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
  }

  .search-filters {
    padding: 1rem !important;
  }

  .search-filters .col-md-3,
  .search-filters .col-md-2,
  .search-filters .col-md-1 {
    margin-bottom: 1rem;
  }
}

/* ===== LOADING STATES ===== */
.property-card.loading {
  opacity: 0.6;
  pointer-events: none;
}

.property-card.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid var(--light-gray);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ===== FAVORITES FUNCTIONALITY ===== */
.property-actions .btn.favorited {
  background: var(--primary-color);
  color: white;
}

.property-actions .btn.favorited:hover {
  background: var(--primary-dark);
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */
.property-card:focus-within {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.property-actions .btn:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
  .property-actions,
  .search-filters,
  .pagination {
    display: none !important;
  }

  .property-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
    margin-bottom: 1rem;
  }

  .property-image {
    height: 150px;
  }
}
