/* ============================================================
   TISAKENYUMBA — UI IMPROVEMENTS
   All 13 fixes from the UX audit
   Load AFTER screens.css so rules take precedence.
============================================================ */

/* ============================================================
   FIX 1: OFFLINE BAR — only shows when actually offline
   (toggled by setupOffline() via .show class, not by default)
============================================================ */
#offline-bar {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  background: var(--night);
  color: var(--sky-light);
  font-size: 12px; font-weight: 600;
  padding: 10px 16px;
  text-align: center;
  border-bottom: 2px solid var(--sky);
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
#offline-bar.show { display: flex; }

/* ============================================================
   FIX 2: NAVIGATION — screen nav bar + modal back buttons
============================================================ */
.screen-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(10, 22, 40, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #7DD3FC;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 7px 14px;
  transition: all 0.2s;
  cursor: pointer;
}
.nav-back-btn:hover {
  background: rgba(14, 165, 233, 0.2);
  border-color: rgba(14, 165, 233, 0.4);
  color: #BAE6FD;
}
.nav-back-btn svg { flex-shrink: 0; }

.screen-nav-title {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  color: #E0F2FE;
  letter-spacing: -0.3px;
}

/* Modal internal nav bar */
.modal-nav-bar {
  display: flex;
  align-items: center;
  padding: 8px 0 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.modal-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--subtext);
  background: var(--sky-pale);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 13px;
  transition: all 0.2s;
  cursor: pointer;
}
.modal-back-btn:hover {
  color: var(--sky);
  border-color: var(--sky);
  background: var(--sky-pale);
}
[data-theme="dark"] .modal-back-btn {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
  color: #7DD3FC;
}
[data-theme="dark"] .modal-back-btn:hover {
  background: rgba(14,165,233,.15);
  border-color: rgba(14,165,233,.4);
  color: #BAE6FD;
}

/* ============================================================
   FIX 3: LANDING — top bar and hero improvements
============================================================ */
.land-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(10, 22, 40, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.land-topbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: #E0F2FE;
}
.land-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.land-nav-link {
  font-size: 12px;
  font-weight: 600;
  color: #7DD3FC;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px;
  padding: 7px 14px;
  transition: all 0.2s;
  cursor: pointer;
}
.land-nav-link:hover {
  background: rgba(255,255,255,.12);
  color: #E0F2FE;
}
.land-nav-link.land-nav-pri {
  background: linear-gradient(135deg, var(--sky), var(--sky-dark));
  border-color: transparent;
  color: white;
  box-shadow: 0 3px 12px rgba(14,165,233,.35);
}
.land-nav-link.land-nav-pri:hover {
  box-shadow: 0 6px 20px rgba(14,165,233,.5);
}

/* Hero block — hero section on landing page */
.land-hero-block {
  text-align: center;
  padding: 40px 0 32px;
}

/* ============================================================
   FIX 4: ICONOGRAPHY — SVG theme toggle, status icons
============================================================ */
.theme-toggle {
  /* override: no emoji content, rely on inline SVG */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Success icon in pending screen */
.si-success {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, #059669, #10B981);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin: 0 auto 20px;
  box-shadow: 0 8px 24px rgba(5, 150, 105, 0.4);
}

/* ============================================================
   FIX 5: HOW IT WORKS section
============================================================ */
.how-section {
  padding: 32px 0 24px;
  position: relative;
  z-index: 1;
}
.how-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: #E0F2FE;
  text-align: center;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}
.how-tabs {
  display: flex;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 20px;
}
.how-tab {
  flex: 1;
  padding: 9px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: #7DD3FC;
  transition: all 0.2s;
  cursor: pointer;
}
.how-tab.active {
  background: rgba(14,165,233,.25);
  color: #E0F2FE;
  box-shadow: 0 2px 8px rgba(14,165,233,.15);
}
.how-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.how-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
}
.how-num {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--sky), var(--sky-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(14,165,233,.35);
}
.how-text strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #E0F2FE;
  margin-bottom: 3px;
}
.how-text p {
  font-size: 12px;
  color: #7DD3FC;
  line-height: 1.5;
}
.how-connector {
  width: 2px;
  height: 16px;
  background: rgba(14,165,233,.3);
  margin-left: 30px;
}

/* ============================================================
   FIX 6: TYPOGRAPHY HIERARCHY
============================================================ */
.auth-title {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.15;
  letter-spacing: -0.5px;
}
.auth-sub {
  font-size: 13px;
  color: var(--subtext);
  margin-bottom: 20px;
  line-height: 1.6;
}

/* ============================================================
   FIX 7: PAYMENT INSTRUCTIONS — step-by-step mpamba steps
============================================================ */
.mpamba-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.mpamba-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: #7DD3FC;
  line-height: 1.5;
}
.mpamba-num {
  width: 22px; height: 22px;
  background: rgba(14,165,233,.25);
  border: 1px solid rgba(14,165,233,.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #38BDF8;
  flex-shrink: 0;
}
.mpamba-step strong { color: #BAE6FD; }
.mpamba-step .till { font-size: 15px; font-weight: 700; color: #BAE6FD; }

/* Placeholder styling when till number is loading */
.till-loading {
  display: inline-block;
  background: rgba(14,165,233,.15);
  border-radius: 6px;
  padding: 2px 10px;
  font-style: italic;
  color: rgba(186,230,253,.5);
}

/* ============================================================
   FIX 8: LANDING PRICING TABLE
============================================================ */
.land-pricing-section {
  padding: 32px 0 24px;
  position: relative;
  z-index: 1;
}
.land-pricing-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: #E0F2FE;
  text-align: center;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}
.land-pricing-sub {
  font-size: 12px;
  color: #4A7FA5;
  text-align: center;
  margin-bottom: 20px;
}
.pricing-cols {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (min-width: 480px) {
  .pricing-cols { flex-direction: row; gap: 10px; }
}
.pricing-col {
  flex: 1;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px;
  padding: 20px 16px;
  position: relative;
  transition: border-color 0.2s;
}
.pricing-col:hover { border-color: rgba(14,165,233,.35); }
.pricing-col-pop {
  border-color: var(--sky) !important;
  background: rgba(14,165,233,.1);
  box-shadow: 0 0 0 1px var(--sky), 0 8px 32px rgba(14,165,233,.2);
}
.pricing-popular-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--sky), var(--sky-dark));
  color: white;
  font-size: 9px;
  font-weight: 800;
  padding: 3px 11px;
  border-radius: 10px;
  white-space: nowrap;
  letter-spacing: 0.3px;
  box-shadow: 0 3px 10px rgba(14,165,233,.4);
}
.pricing-tier-name {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  color: #E0F2FE;
  margin-bottom: 4px;
}
.pricing-tier-price {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--sky-light);
  margin-bottom: 2px;
  line-height: 1.1;
}
.pricing-tier-price span {
  font-size: 12px;
  font-weight: 400;
  color: #4A7FA5;
  font-family: var(--sans);
}
.pricing-tier-limit {
  font-size: 10px;
  font-weight: 700;
  color: #4A7FA5;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}
.pricing-feat-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
  padding: 0;
}
.pricing-feat-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #7DD3FC;
  line-height: 1.4;
}
.pricing-feat-list .feat-no { color: rgba(125,211,252,.35); }
.chk {
  width: 14px; height: 14px;
  flex-shrink: 0;
}
.chk-yes { stroke: #10B981; }
.chk-no  { stroke: rgba(255,255,255,.25); }
.pricing-cta {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px;
  color: #E0F2FE;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.pricing-cta:hover {
  background: rgba(14,165,233,.2);
  border-color: rgba(14,165,233,.4);
}
.pricing-cta-pop {
  background: linear-gradient(135deg, var(--sky), var(--sky-dark));
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 14px rgba(14,165,233,.35);
}
.pricing-cta-pop:hover {
  box-shadow: 0 6px 22px rgba(14,165,233,.5);
  background: linear-gradient(135deg, var(--sky-light), var(--sky));
}

/* ============================================================
   FIX 9: LISTING FORM — cleaner upload, area select, rent field
============================================================ */
.upload-hint {
  font-size: 11px;
  color: var(--subtext);
  margin-top: 4px;
}

/* Required field star */
.req-star {
  color: var(--danger);
  font-weight: 700;
  margin-left: 2px;
}

/* Requirements notice */
.listing-req-notice {
  background: #FEF3C7 !important;
  border-color: #FCD34D !important;
  color: #92400E !important;
}
[data-theme="dark"] .listing-req-notice {
  background: rgba(217,119,6,.15) !important;
  border-color: rgba(252,211,77,.25) !important;
  color: #FCD34D !important;
}

/* MK rent prefix */
.rent-input-wrap {
  position: relative;
}
.rent-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-weight: 700;
  color: var(--subtext);
  pointer-events: none;
  z-index: 1;
}
.rent-input-wrap input {
  padding-left: 42px !important;
}

/* ============================================================
   FIX 10: EMPTY STATE (injected by listings.js)
   These styles support the empty-state div rendered by JS.
============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 12px;
}
.empty-state-icon {
  width: 64px; height: 64px;
  background: var(--sky-pale);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sky-dark);
}
.empty-state h4 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.empty-state p {
  font-size: 13px;
  color: var(--subtext);
  line-height: 1.6;
  max-width: 280px;
}
.empty-state .empty-cta {
  margin-top: 4px;
  padding: 10px 22px;
  background: var(--sky-pale);
  border: 1px solid var(--border2);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--sky-dark);
  cursor: pointer;
  transition: all 0.2s;
}
.empty-state .empty-cta:hover {
  background: var(--sky);
  color: white;
  border-color: transparent;
}

/* ============================================================
   FIX 11: BUDGET FILTER — section labels above selects
============================================================ */
.filter-section-label-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.fsl {
  font-size: 10px;
  font-weight: 700;
  color: rgba(125, 211, 252, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================================
   FIX 12: NRC TOOLTIP with padlock icon
============================================================ */
.nrc-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
  letter-spacing: 0.2px;
  position: relative;
}
#agent-auth .nrc-label { color: #E0F2FE; }

.nrc-tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
}
.nrc-lock-icon {
  color: var(--sky);
  opacity: 0.8;
  transition: opacity 0.2s;
}
.nrc-tooltip-wrap:hover .nrc-lock-icon { opacity: 1; }

.nrc-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 230px;
  background: var(--navy);
  border: 1px solid rgba(14,165,233,.3);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 400;
  color: #7DD3FC;
  line-height: 1.5;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  white-space: normal;
  pointer-events: none;
}
/* Tooltip arrow */
.nrc-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--navy);
}
.nrc-tooltip-wrap:hover .nrc-tooltip { display: block; }

/* ============================================================
   FIX 13: PLAN COMPARISON TABLE (tenant + agent auth screens)
============================================================ */
.plan-compare-table {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.1);
  margin-bottom: 4px;
}
.pct-head, .pct-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.pct-row:last-child { border-bottom: none; }
.pct-head {
  background: rgba(14,165,233,.15);
}
.pct-head > div,
.pct-row > div {
  padding: 7px 6px;
  font-size: 10px;
  text-align: center;
}
.pct-feat {
  text-align: left !important;
  font-weight: 600;
  color: rgba(224,242,254,.85);
  padding-left: 10px !important;
}
.pct-head .pct-feat { color: #E0F2FE; font-weight: 700; }
.pct-head > div {
  font-size: 10px;
  font-weight: 700;
  color: #BAE6FD;
  line-height: 1.3;
}
.pct-pop {
  background: rgba(14,165,233,.12) !important;
}
.pct-head .pct-pop {
  background: rgba(14,165,233,.25) !important;
  color: #38BDF8 !important;
}
.pct-head .pct-pop small,
.pct-head > div small {
  display: block;
  font-size: 9px;
  font-weight: 700;
  color: #38BDF8;
  margin-top: 1px;
}

/* Table check icons */
.ti {
  width: 13px; height: 13px;
  display: inline-block;
  vertical-align: middle;
}
.ti.yes { stroke: #10B981; }
.ti.no  { stroke: rgba(255,255,255,.25); }

/* WhatsApp notice box in premium modal */
.wa-notice-box {
  background: linear-gradient(135deg,#0B1E13,#0E2008) !important;
  border-color: rgba(37,211,102,.2) !important;
  color: #90C090 !important;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* ============================================================
   DASHBOARD — misc icon cleanups
============================================================ */
.add-listing-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}
.sub-required {
  padding: 16px 18px;
}

/* ============================================================
   DARK MODE OVERRIDES for new components
============================================================ */
[data-theme="dark"] .screen-nav {
  background: rgba(11, 30, 56, 0.97);
  border-color: rgba(255,255,255,.06);
}
[data-theme="dark"] .nrc-tooltip {
  background: #0F2340;
  border-color: rgba(14,165,233,.25);
}
[data-theme="dark"] .empty-state-icon {
  background: var(--surface2);
  border-color: var(--border);
}
[data-theme="dark"] .plan-compare-table {
  border-color: rgba(255,255,255,.08);
}
[data-theme="dark"] .pricing-col {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.08);
}
[data-theme="dark"] .how-step {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.07);
}
