/* property-card.css - Modern Property Cards */
.property-card {
  background: var(--bg-primary);
  border-radius: var(--border-radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-color-light);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 420px;
  position: relative;
}

.property-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--bg-gradient);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  z-index: 1;
}

.property-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(99, 102, 241, 0.2);
}

.property-card:hover::before {
  transform: scaleX(1);
}

.property-image {
  position: relative;
  overflow: hidden;
  line-height: 0;
  padding-top: 60%;
  background: linear-gradient(
    135deg,
    var(--bg-secondary) 0%,
    var(--bg-tertiary) 100%
  );
  flex-shrink: 0;
}

.property-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(
    135deg,
    var(--bg-secondary) 0%,
    var(--bg-tertiary) 100%
  );
}

/* Handle broken or missing images */
.property-image img[src=''],
.property-image img:not([src]) {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="%23f8f8f8"/><text x="50" y="50" text-anchor="middle" dy=".3em" fill="%23777" font-family="Arial" font-size="12">No Image</text></svg>');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100px 100px;
}

.property-card:hover .property-image img {
  transform: scale(1.08);
}

.property-image .label {
  position: absolute;
  top: var(--spacing-md);
  padding: 6px 12px;
  border-radius: var(--border-radius-pill);
  font-size: var(--font-size-xs);
  font-weight: 600;
  z-index: 2;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.2;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-family: var(--font-accent);
}

.property-image .label.featured {
  left: var(--spacing-md);
  background: rgba(99, 102, 241, 0.9);
  color: var(--text-on-primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.property-image .label.for-sale {
  right: var(--spacing-md);
  background: rgba(245, 158, 11, 0.9);
  color: var(--text-light);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* Optional Image Overlay (Example) */
.property-image .image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.6) 0%,
    rgba(0, 0, 0, 0) 100%
  );
  padding: var(--spacing-sm);
  color: var(--text-light);
  font-size: var(--font-size-sm);
  z-index: 1;
  display: flex;
  justify-content: flex-end; /* Align icons right */
  gap: var(--spacing-md);
  opacity: 0; /* Hidden by default */
  transition: opacity 0.3s ease;
}

.property-card:hover .image-overlay {
  opacity: 1; /* Show on hover */
}

.image-overlay i {
  margin-right: 4px;
}

.property-details {
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-height: 0;
  justify-content: space-between;
  background: var(--bg-primary);
  position: relative;
}

.property-details h3 {
  color: var(--secondary-color);
  font-size: var(--font-size-xl);
  margin-top: 0;
  margin-bottom: var(--spacing-sm);
  line-height: var(--line-height-heading);
  font-family: var(--font-primary);
  font-weight: 600;
  letter-spacing: -0.01em;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: calc(1.2em * 2);
  max-height: calc(1.2em * 2);
  flex-shrink: 0;
}

.property-details .address {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  margin-bottom: var(--spacing-md);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 500;
}

.property-details .address i {
  color: var(--primary-color);
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.1);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-xs);
}

.property-details .specs {
  list-style: none;
  padding: var(--spacing-md) 0;
  margin: 0 0 var(--spacing-md) 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: var(--spacing-md);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  text-align: left;
  border-top: 1px solid var(--border-color-light);
  border-bottom: 1px solid var(--border-color-light);
  flex-shrink: 0;
  background: rgba(248, 250, 252, 0.5);
  border-radius: var(--border-radius-md);
  margin-left: calc(-1 * var(--spacing-lg));
  margin-right: calc(-1 * var(--spacing-lg));
  padding-left: var(--spacing-lg);
  padding-right: var(--spacing-lg);
}

.property-details .specs li {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--spacing-sm);
  font-weight: 500;
}

.property-details .specs i {
  font-size: var(--font-size-sm);
  color: var(--primary-color);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.1);
  border-radius: var(--border-radius-sm);
  flex-shrink: 0;
}

/* Content wrapper to organize layout */
.property-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-height: 0;
}

/* Price and Actions - Push to bottom */
.price-actions {
  margin-top: auto;
  padding-top: var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-lg);
  flex-shrink: 0;
}

.price {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.price .original-price {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-decoration: line-through;
  margin-bottom: var(--spacing-xs);
  font-family: var(--font-accent);
}

.price .current-price {
  font-size: var(--font-size-2xl);
  background: var(--bg-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  font-family: var(--font-primary);
  letter-spacing: -0.02em;
}

.actions {
  display: flex;
  gap: var(--spacing-sm);
  flex-shrink: 0;
}

.actions .action-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-md);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--primary-color);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.actions .action-btn:hover {
  background: var(--bg-gradient);
  color: var(--text-on-primary);
  border-color: transparent;
  transform: scale(1.1);
  box-shadow: var(--shadow-colored);
}

/* .actions button, .actions a moved to global.css as .action-btn */

/* Optional Agent Profile (If added later) */
/* .agent-profile { ... } */

/* Responsive Adjustments */
@media (max-width: 480px) {
  .property-details h3 {
    font-size: var(--font-size-md); /* Slightly smaller title */
    min-height: calc(1.3em * 2); /* Adjust min height */
  }
  .property-details .specs {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on small mobile */
    font-size: var(--font-size-xs); /* Smaller text */
  }
  .price .current-price {
    font-size: var(--font-size-md); /* Smaller price */
  }
  .actions .action-btn {
    width: 32px;
    height: 32px;
  }
  .actions .action-btn i {
    font-size: var(--font-size-xs);
  }
}
