/**
 * public-layout.css — shell & navbar bersama halaman publik RumahKu
 */

body.page-shell {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg-alt);
  color: var(--text);
}

/* ─── Navbar ─── */
.navbar.m-topnav {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

body.page-explore .navbar.m-topnav,
body.index-on-explore .navbar.m-topnav {
  background: var(--page-explore-bg, var(--bg-alt));
  border-bottom: none;
}

.navbar-brand {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--ink) !important;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.03em;
}

.navbar-brand i {
  color: var(--primary);
}

/* ─── Logged-in account (selaras tombol Masuk / Daftar) ─── */
.nav-account {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-account__who {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  margin-right: 0.15rem;
  padding: 0.25rem 0.65rem 0.25rem 0.25rem;
  min-width: 0;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.nav-account__who:hover,
.nav-account__who:focus-visible {
  background: var(--bg-alt);
  box-shadow: var(--shadow-sm);
  outline: none;
}

.nav-account__avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: var(--shadow-xs);
}

.nav-account__text {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 11rem;
}

.nav-account__text strong {
  color: var(--ink);
  font-weight: 700;
}

.btn-logout-nav {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-logout-nav:hover,
.btn-logout-nav:focus-visible {
  background: var(--danger-light);
  color: var(--danger);
  outline: none;
}

/* Legacy hooks */
.btn-logout {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-logout:hover {
  background: var(--danger-light);
  color: var(--danger);
}

.btn-profile {
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface);
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  padding: 0.45rem 1rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: var(--shadow-xs);
}

.btn-profile:hover {
  color: var(--ink);
}

.user-greeting {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.user-greeting strong {
  color: var(--ink);
  font-weight: 700;
}

.btn-login-nav {
  background: var(--surface);
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  padding: 0.45rem 1rem;
  text-decoration: none;
  transition: all 0.2s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: var(--shadow-xs);
}

.btn-login-nav:hover {
  color: var(--ink);
}

.btn-register-nav {
  background: var(--ink);
  border: none;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  padding: 0.45rem 1.05rem;
  text-decoration: none;
  transition: all 0.2s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: var(--shadow-xs);
}

.btn-register-nav:hover {
  background: #292524;
  color: #fff;
}

/* ─── Page title (daftar rumah & rekomendasi) ─── */
.page-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 1.25rem;
}

/* ─── Explore page shell ─── */
body.page-explore,
body.index-on-explore {
  background: var(--page-explore-bg, var(--bg-alt));
}

.page-explore .page-content,
.index-on-explore .index-explore {
  padding-top: 1rem;
  padding-bottom: 2.5rem;
}

.page-explore .container,
.index-on-explore .index-explore .container {
  max-width: 1140px;
}

/* ─── Pagination ─── */
.pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.page-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  min-width: 38px;
  height: 38px;
  padding: 0 0.75rem;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(224, 134, 0, 0.28);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ─── Empty & loading ─── */
.empty-state {
  background: var(--surface);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-xl);
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted);
}

.empty-state > i {
  font-size: 3.5rem;
  color: var(--primary-light);
  display: block;
  margin-bottom: 1rem;
}

.empty-state h5 {
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.empty-state p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.empty-state .btn-save-modal,
.empty-state .btn.btn-save-modal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.85rem;
  white-space: nowrap;
  width: auto;
  height: auto;
  min-height: 2.5rem;
  border-radius: var(--radius-pill);
  padding: 0.55rem 1.25rem;
  line-height: 1.2;
}

.empty-state .btn-save-modal i,
.empty-state .btn.btn-save-modal i {
  font-size: 1rem !important;
  display: inline !important;
  margin: 0 !important;
  color: inherit !important;
  line-height: 1;
}

.spinner-wrap {
  text-align: center;
  padding: 4rem 1rem;
}

.spinner-wrap .spinner-border {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--primary) !important;
}

.toast-container {
  position: fixed;
  bottom: max(1rem, env(safe-area-inset-bottom));
  right: 1.5rem;
  z-index: 9999;
}
