/**
 * profile-modal.css — Profil pengguna (modal shared index + rekomendasi)
 */

#profileModal .modal-dialog {
  max-width: 640px;
}

#profileModal .modal-content {
  border: none;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

#profileModal .modal-header {
  border-bottom: 1px solid var(--border-soft);
  padding: 1rem 1.25rem;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.profile-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.profile-btn-edit {
  border: 1px solid rgba(224, 134, 0, 0.35);
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
  line-height: 1.2;
}

.profile-btn-edit:hover {
  background: #FFE8C7;
  color: var(--primary-dark);
}

#profile-view-panel,
#profile-edit-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.profile-view-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.profile-view-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.profile-view-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.profile-view-value {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  word-break: break-word;
}

.profile-view-value--empty {
  color: var(--muted);
  font-weight: 500;
  font-style: italic;
}

#profileModal.is-edit-mode .modal-title::after {
  content: ' · Edit';
  font-weight: 600;
  color: var(--muted);
  font-size: 0.85rem;
}

#profileModal .modal-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

#profileModal .modal-body {
  padding: 0;
  background: var(--bg-alt);
}

#profileModal .modal-footer {
  border-top: 1px solid var(--border-soft);
  padding: 0.85rem 1.25rem;
  background: var(--surface);
  gap: 0.5rem;
}

/* ─── Hero ─── */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.35rem 1.25rem 1.15rem;
  background: linear-gradient(135deg, #FFF8ED 0%, #FFF4E6 48%, #FCE9C7 100%);
  border-bottom: 1px solid rgba(224, 134, 0, 0.12);
}

.profile-hero__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(170, 76, 10, 0.22);
  letter-spacing: 0.02em;
}

.profile-hero__meta {
  min-width: 0;
  flex: 1;
}

.profile-hero__name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-hero__email {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-hero__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.45rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(224, 134, 0, 0.18);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ─── Content stack ─── */
.profile-modal__content {
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.profile-section {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 1rem 1rem 0.85rem;
  box-shadow: var(--shadow-xs);
}

.profile-section-head {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}

.profile-section-head__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.profile-section-head__text {
  flex: 1;
  min-width: 0;
}

.profile-section-head__text h6 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.profile-section-head__text p {
  margin: 0.15rem 0 0;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.4;
}

.profile-section-count {
  min-width: 26px;
  height: 26px;
  padding: 0 0.45rem;
  border-radius: var(--radius-pill);
  background: var(--bg-alt);
  border: 1px solid var(--border-soft);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-section-count.is-active {
  background: var(--primary-light);
  border-color: rgba(224, 134, 0, 0.2);
  color: var(--primary-dark);
}

/* ─── Form fields ─── */
.profile-field {
  margin-bottom: 0.75rem;
}

.profile-section--harga {
  padding: 1.15rem 1.1rem 1.3rem;
}

.profile-section--harga .profile-section-head {
  margin-bottom: 1rem;
}

.profile-section--harga .profile-field {
  margin-bottom: 0;
}

#p-harga-widget.price-input-wrap,
#f-harga-widget.price-input-wrap {
  margin-top: 0.15rem;
}

.profile-field:last-child {
  margin-bottom: 0;
}

#profileModal .form-label {
  font-weight: 600;
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  letter-spacing: 0.02em;
}

#profileModal .form-control,
#profileModal .form-select {
  border-radius: 10px;
  border-color: var(--border-soft);
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
  min-height: 42px;
}

#profileModal .form-control:focus,
#profileModal .form-select:focus {
  border-color: rgba(224, 134, 0, 0.45);
  box-shadow: 0 0 0 3px rgba(224, 134, 0, 0.12);
}

.profile-rp {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  min-height: 42px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.profile-rp:focus-within {
  border-color: rgba(224, 134, 0, 0.45);
  box-shadow: 0 0 0 3px rgba(224, 134, 0, 0.12);
}

.profile-rp__prefix {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-rp__input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  padding: 0;
  min-height: auto;
}

.profile-rp__input::placeholder {
  color: #d6d3d1;
}

.profile-preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.profile-preset-chip {
  border: 1px solid var(--border-soft);
  background: var(--bg-alt);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  padding: 0.28rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  line-height: 1.3;
}

.profile-preset-chip:hover {
  border-color: rgba(224, 134, 0, 0.35);
  color: var(--primary-dark);
  background: #fff;
}

.profile-preset-chip.active {
  background: var(--primary-light);
  border-color: rgba(224, 134, 0, 0.35);
  color: var(--primary-dark);
}

.profile-account-email {
  font-size: 0.88rem;
  color: var(--text-secondary);
  padding: 0.55rem 0.75rem;
  background: var(--bg-alt);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  min-height: 42px;
  display: flex;
  align-items: center;
}

/* ─── Liked houses ─── */
.profile-liked-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.profile-liked-item {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 0.6rem;
  background: var(--bg-alt);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  font-family: inherit;
}

.profile-liked-item:hover {
  border-color: rgba(224, 134, 0, 0.28);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.profile-liked-thumb {
  width: 76px;
  height: 76px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #e7e5e4;
}

.profile-liked-meta {
  flex: 1;
  min-width: 0;
}

.profile-liked-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.profile-liked-loc {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-liked-price {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--primary);
  margin-top: 0.2rem;
  letter-spacing: -0.01em;
}

.profile-liked-badges {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}

.profile-liked-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-pill);
  background: #DCFCE7;
  color: #15803D;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.profile-liked-stars {
  color: #E08600;
  font-size: 0.78rem;
  letter-spacing: -0.04em;
  display: inline-flex;
  align-items: center;
  gap: 0.05rem;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-pill);
  background: #FFF4E6;
}

.profile-liked-chevron {
  color: #d6d3d1;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.profile-liked-toggle {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.25rem 0;
  border: none;
  background: none;
  color: var(--primary-dark);
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.profile-liked-toggle:hover {
  color: var(--primary);
  text-decoration: none;
}

.profile-liked-empty {
  text-align: center;
  padding: 1.35rem 0.75rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
  border: 1px dashed var(--border-soft);
  border-radius: 12px;
  background: var(--bg-alt);
}

.profile-liked-empty__icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 0.65rem;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #d6d3d1;
}

.profile-liked-empty a {
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: none;
}

.profile-liked-empty a:hover {
  text-decoration: underline;
}

/* ─── Footer buttons ─── */
#profileModal .btn-profile-cancel {
  border: 1px solid var(--border-soft);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  padding: 0.55rem 1.1rem;
  font-weight: 700;
  font-family: inherit;
  min-height: 44px;
}

#profileModal .btn-profile-cancel:hover {
  background: var(--bg-alt);
  color: var(--ink);
}

#profileModal .btn-save-modal {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.55rem 1.35rem;
  font-weight: 700;
  font-family: inherit;
  min-height: 44px;
  box-shadow: 0 4px 12px rgba(224, 134, 0, 0.25);
}

#profileModal .btn-save-modal:hover {
  background: var(--primary-dark);
  color: #fff;
}

/* ─── Mobile overrides (app-mobile hides profile header — restore) ─── */
@media (max-width: 991px) {
  #profileModal .modal-dialog {
    margin: 0;
    max-width: 100%;
    height: 100%;
  }

  #profileModal .modal-content {
    border-radius: 0;
    min-height: 100%;
  }

  #profileModal .modal-header {
    display: flex !important;
    padding-top: max(0.85rem, env(safe-area-inset-top));
  }

  #profileModal .modal-body {
    padding: 0 !important;
  }

  #profileModal .modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding-bottom: max(0.85rem, env(safe-area-inset-bottom));
  }

  #profileModal .modal-footer .btn {
    flex: 1;
    min-height: 48px;
  }

  .profile-hero {
    padding-top: 1.1rem;
  }
}
