/* ==========================================================================
   COMPONENTS DESIGN SYSTEM
   ========================================================================== */

/* Desktop Header Navigation */
.desktop-header {
  display: none;
  background: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 990;
}

@media (min-width: 992px) {
  .desktop-header {
    display: block;
  }
}

.nav-wrapper {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary-color);
  letter-spacing: -0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

.nav-link {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.9rem;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary-color);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  min-height: 44px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #FFFFFF;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: #FFFFFF;
}

.btn-accent {
  background-color: var(--accent-color);
  color: #FFFFFF;
}

.btn-outline {
  border-color: var(--border-color);
  background: var(--surface-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-color);
  border-color: var(--text-muted);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn-lg {
  min-height: 52px;
  padding: 14px 28px;
  font-size: 1.05rem;
}

/* Property Cards */
.property-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.property-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--border-light);
}

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

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

.card-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  z-index: 2;
}

.badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-jual {
  background: var(--primary-color);
  color: #FFFFFF;
}

.badge-sewa {
  background: #2563EB;
  color: #FFFFFF;
}

.badge-featured {
  background: var(--accent-color);
  color: #FFFFFF;
}

.favorite-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  z-index: 2;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.favorite-btn:hover, .favorite-btn.active {
  color: #EF4444;
  background: #FFFFFF;
  transform: scale(1.1);
}

.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.card-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 4px;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.6em;
}

.card-location {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.card-specs {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.spec-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Category Quick Card */
.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 90px;
  padding: 16px 12px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: all 0.2s ease;
}

.category-card:hover, .category-card.active {
  border-color: var(--primary-color);
  background: #F0FDF4;
  transform: translateY(-2px);
}

.category-card .cat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
}

/* City Card */
.city-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  min-width: 140px;
  height: 100px;
  box-shadow: var(--shadow-sm);
}

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

.city-card .city-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
  display: flex;
  align-items: flex-end;
  padding: 10px;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.9rem;
}

/* Responsive Table Wrapper for Comparisons & Admin */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface-color);
  text-align: left;
}

.table th, .table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  white-space: nowrap;
}

.table th {
  background: var(--bg-color);
  font-weight: 700;
}

/* Redesigned Property Card Styles - Compact & Simple */
.property-card.compact {
  display: flex;
  flex-direction: column;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.property-card.compact:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.property-card.compact .card-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--border-light);
}

.property-card.compact .card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.property-card.compact:hover .card-image-wrap img {
  transform: scale(1.05);
}

.card-badges-top {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 2;
}

.card-badges-top .badge-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-badges-top .badge-type.jual { background: var(--primary-color); color: #fff; }
.card-badges-top .badge-type.sewa { background: #2563EB; color: #fff; }

.card-badges-top .badge-cat {
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
  display: table;
}

.property-card.compact .favorite-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
  color: var(--text-muted);
}

.property-card.compact .favorite-btn:hover {
  background: #fff;
  transform: scale(1.1);
}

.property-card.compact .card-body {
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.property-card.compact .card-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: #000;
  margin-bottom: 2px;
}

.property-card.compact .card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1F2937;
  text-decoration: none;
  margin-bottom: 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.property-card.compact .card-title:hover {
  color: var(--primary-color);
}

.property-card.compact .card-location {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: #6B7280;
  margin-bottom: 2px;
}

.property-card.compact .card-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
  padding-top: 4px;
  border-top: 1px solid #E5E7EB;
}

.property-card.compact .spec-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: #4B5563;
  font-weight: 600;
}

.property-card.compact .spec-item svg {
  color: #9CA3AF;
}

.property-card.compact .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: #F9FAFB;
  border-top: 1px solid #E5E7EB;
}

.agent-compact {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.agent-compact img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #E5E7EB;
}

.agent-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  white-space: nowrap;
}

.agent-info .agent-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #111827;
  text-overflow: ellipsis;
  overflow: hidden;
}

.agent-info .agent-agency {
  font-size: 0.7rem;
  color: #6B7280;
  text-overflow: ellipsis;
  overflow: hidden;
}

.btn-wa-icon {
  width: 36px;
  height: 36px;
  background: #25D366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(37,211,102,0.3);
}

.btn-wa-icon:hover {
  background: #128C7E;
  transform: scale(1.05);
  color: #fff;
}

/* --- Mobile View Adjustments for Property Card --- */
@media (max-width: 576px) {
  .property-card.compact .card-body {
    padding: 6px !important;
  }
  .property-card.compact .card-price {
    font-size: 0.95rem !important;
  }
  .property-card.compact .card-title {
    font-size: 0.8rem !important;
    -webkit-line-clamp: 1 !important;
  }
  .property-card.compact .card-location {
    font-size: 0.65rem !important;
    margin-bottom: 4px !important;
  }
  .property-card.compact .spec-item {
    font-size: 0.65rem !important;
  }
  .property-card.compact .spec-item svg {
    width: 12px !important;
    height: 12px !important;
  }
  .property-card.compact .badge-custom {
    font-size: 0.55rem !important;
    padding: 2px 4px !important;
  }
  /* Sembunyikan info agen text */
  .property-card.compact .agent-info {
    display: none !important;
  }
  .property-card.compact .card-footer {
    padding: 4px 6px !important;
  }
  .property-card.compact .btn-wa-icon {
    width: 28px !important;
    height: 28px !important;
  }
  .property-card.compact .btn-wa-icon svg {
    width: 16px !important;
    height: 16px !important;
  }
}
