/* =====================================================
   SVIBI - Variant A: Premium Map-First
   Full RTL Hebrew UI
   ===================================================== */

:root {
  --navy: #0f2037;
  --navy-mid: #162d4e;
  --navy-light: #1e3a5f;
  --gold: #e8a83e;
  --gold-light: #f5c76a;
  --gold-pale: #fef3d8;
  --surface: #f8fafc;
  --surface-2: #f1f5f9;
  --muted: #64748b;
  --muted-light: #94a3b8;
  --text: #1e293b;
  --text-light: #475569;
  --border: #e2e8f0;
  --white: #ffffff;

  --cat-event: #3b82f6;
  --cat-help: #ef4444;
  --cat-service-offer: #8b5cf6;
  --cat-service-request: #0ea5e9;
  --cat-giveaway: #22c55e;
  --cat-sale: #e8a83e;
  --cat-sponsored: #e8a83e;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.15), 0 4px 8px rgba(0,0,0,.08);
  --shadow-xl: 0 20px 60px rgba(0,0,0,.20), 0 8px 16px rgba(0,0,0,.10);

  --nav-h: 68px;
  --drawer-peek: 220px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Heebo', sans-serif;
  background: var(--navy);
  color: var(--text);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy); text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; direction: rtl; }

/* ===== DESKTOP WRAPPER ===== */
#desktop-wrapper {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--navy) 0%, #1a3a5c 50%, var(--navy-mid) 100%);
  padding: 0;
}

/* ===== PHONE FRAME ===== */
#phone-frame {
  position: relative;
  width: 100%;
  max-width: 390px;
  height: 100vh;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#phone-status-bar {
  display: none;
  background: var(--white);
  padding: 10px 20px 6px;
  font-size: 12px;
  font-weight: 600;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  z-index: 100;
}

#app-root {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ===== SCREENS ===== */
.screen {
  position: absolute;
  inset: 0;
  background: var(--surface);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.screen.active { display: flex; }

/* Fade transition */
.screen.entering {
  animation: screenFadeIn 0.28s ease forwards;
}
@keyframes screenFadeIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.screen-with-nav {
  padding-bottom: var(--nav-h);
}

.screen-map {
  background: #e8e0d8;
}

/* ===== MAP CONTAINER ===== */
.map-container {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* ===== SCREEN HEADER ===== */
.screen-header {
  background: var(--white);
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 10;
}
.screen-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
}
.screen-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.screen-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 16px;
  -webkit-overflow-scrolling: touch;
}

/* ===== MAP TOP BAR ===== */
.map-top-bar {
  position: absolute;
  top: 12px;
  right: 12px;
  left: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.map-location-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  padding: 8px 14px;
  border-radius: 24px;
  box-shadow: var(--shadow-md);
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  flex: 1;
  pointer-events: all;
  cursor: pointer;
}
.map-location-pill i:last-child { margin-right: auto; margin-left: 0; color: var(--muted); font-size: 11px; }
.map-location-pill i:first-child { color: var(--gold); }
.map-icon-btn {
  width: 40px; height: 40px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--navy);
  position: relative;
  pointer-events: all;
  transition: background var(--transition);
}
.map-icon-btn:hover { background: var(--surface-2); }
.notif-dot {
  position: absolute; top: 8px; left: 8px;
  width: 8px; height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid white;
}

/* ===== MAP FILTER BAR ===== */
.map-filter-bar {
  position: absolute;
  top: 12px;
  right: 12px;
  left: 12px;
  z-index: 10;
  pointer-events: all;
}

/* ===== BOTTOM DRAWER ===== */
.bottom-drawer {
  position: absolute;
  bottom: 0;
  right: 0; left: 0;
  z-index: 20;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 30px rgba(0,0,0,0.18);
  transform: translateY(calc(100% - var(--drawer-peek)));
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: calc(100% - 60px);
  display: flex;
  flex-direction: column;
  padding-bottom: var(--nav-h);
}
.bottom-drawer.open {
  transform: translateY(0);
}

.drawer-handle-area {
  padding: 10px 0 6px;
  display: flex; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.drawer-handle {
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: 2px;
}

.drawer-content {
  overflow-y: auto;
  flex: 1;
  padding: 0 0 8px;
  -webkit-overflow-scrolling: touch;
}

.drawer-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
}
.see-all-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  background: none;
  border: none;
  cursor: pointer;
}

/* ===== FILTER CHIPS ===== */
.filter-chips-scroll {
  display: flex;
  flex-direction: row-reverse;
  gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: var(--white);
}
.filter-chips-scroll::-webkit-scrollbar { display: none; }

.filter-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--text-light);
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  flex-shrink: 0;
}
.filter-chip.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.filter-chip i { font-size: 11px; }

/* ===== HOT STRIP ===== */
.hot-strip {
  display: flex;
  flex-direction: row-reverse;
  gap: 12px;
  padding: 4px 16px 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.hot-strip::-webkit-scrollbar { display: none; }

.hot-card {
  flex-shrink: 0;
  width: 180px;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 14px 14px 12px;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  border: 1.5px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.hot-card:active { transform: scale(0.97); }
.hot-card.urgency-urgent { border-color: #ef4444; }
.hot-card.urgency-high { border-color: #f97316; }
.hot-card.sponsored { border-color: var(--gold); }

.hot-card-rank {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 20px; height: 20px;
  background: var(--navy);
  color: white;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.hot-card-cat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 6px;
}
.hot-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hot-card-meta {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.urgent-pulse {
  width: 7px; height: 7px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse 1.4s infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

/* ===== NEARBY LIST ===== */
.nearby-list {
  padding: 4px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ===== ITEM CARD ===== */
.item-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.item-card:active { transform: scale(0.98); box-shadow: var(--shadow-md); }
.item-card.urgency-urgent { border-right: 4px solid #ef4444; }
.item-card.urgency-high { border-right: 4px solid #f97316; }
.item-card.sponsored {
  border-color: var(--gold);
  background: linear-gradient(135deg, var(--white) 0%, var(--gold-pale) 100%);
}

.item-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 6px;
}
.item-card-cat-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 10px;
  letter-spacing: 0.3px;
}
.cat-badge.event { background: #eff6ff; color: var(--cat-event); }
.cat-badge.help { background: #fef2f2; color: var(--cat-help); }
.cat-badge.service-offer { background: #f5f3ff; color: var(--cat-service-offer); }
.cat-badge.service-request { background: #f0f9ff; color: var(--cat-service-request); }
.cat-badge.giveaway { background: #f0fdf4; color: var(--cat-giveaway); }
.cat-badge.sale { background: var(--gold-pale); color: #92400e; }

.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 8px;
}
.source-badge.whatsapp { background: #dcfce7; color: #15803d; }
.source-badge.facebook { background: #dbeafe; color: #1d4ed8; }
.source-badge.auto { background: #f5f3ff; color: #7c3aed; }
.source-badge.sponsored { background: var(--gold-pale); color: #92400e; font-weight: 700; }

.item-card-urgency-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
}

.item-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 4px;
}
.item-card-desc {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}
.item-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
}
.item-meta-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.meta-chip {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.meta-chip i { font-size: 10px; }

.item-author-row {
  display: flex;
  align-items: center;
  gap: 5px;
}
.author-avatar-sm {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-light), var(--navy));
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.author-name-sm {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px; height: 14px;
  background: #0d9488;
  color: white;
  border-radius: 50%;
  font-size: 8px;
}

/* ===== HOT LIST (screen) ===== */
.hot-list-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}
.hot-list-item:active { background: var(--surface-2); }
.hot-list-item.urgency-urgent { border-right: 4px solid #ef4444; }
.hot-list-item.urgency-high { border-right: 4px solid #f97316; }
.hot-list-item.sponsored { background: linear-gradient(135deg, var(--white) 0%, var(--gold-pale) 100%); }

.hot-rank-badge {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  font-size: 12px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.hot-rank-badge.rank-1 { background: var(--gold); color: var(--navy); }
.hot-rank-badge.rank-2 { background: var(--muted); }
.hot-rank-badge.rank-3 { background: #cd7f32; }

.hot-item-body { flex: 1; }
.hot-item-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 3px; line-height: 1.3; }
.hot-item-desc { font-size: 12px; color: var(--text-light); line-height: 1.4; margin-bottom: 6px; }
.hot-item-score {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.score-factor {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 8px;
}
.score-factor.urgency { background: #fef2f2; color: #dc2626; }
.score-factor.dist { background: #f0fdf4; color: #16a34a; }
.score-factor.fresh { background: #eff6ff; color: #2563eb; }

/* ===== ITEM DETAIL ===== */
.item-detail-header {
  background: var(--white);
  padding: 12px 16px 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.back-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: background 0.2s;
}
.back-btn:hover { background: var(--border); }
.back-btn.inline { display: inline-flex; }

.item-cat-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 12px;
}

.item-detail-body {
  padding: 16px;
}
.item-detail-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.25;
  margin-bottom: 8px;
}
.item-detail-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.item-detail-desc {
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 20px;
}
.item-detail-section {
  margin-bottom: 20px;
}
.item-detail-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 8px;
}
.item-detail-author-card {
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.author-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-light), var(--navy));
  color: white;
  font-size: 18px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.author-info { flex: 1; }
.author-name { font-size: 14px; font-weight: 700; color: var(--text); }
.author-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.item-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
  padding: 16px;
  background: var(--white);
  border-top: 1px solid var(--border);
}

.item-stat-row {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}
.item-stat {
  text-align: center;
}
.item-stat-num { font-size: 22px; font-weight: 800; color: var(--navy); }
.item-stat-label { font-size: 11px; color: var(--muted); margin-top: 1px; }

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}
.btn-primary:hover { background: var(--navy-mid); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary.gold { background: var(--gold); color: var(--navy); }
.btn-primary.gold:hover { background: var(--gold-light); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--surface-2);
  color: var(--navy);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  border: 1.5px solid var(--border);
  cursor: pointer;
}
.btn-secondary:hover { background: var(--border); }

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: #fef2f2;
  color: #dc2626;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  border: 1.5px solid #fecaca;
  cursor: pointer;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

.btn-full { width: 100%; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }

/* ===== LANDING ===== */
.landing-hero {
  position: relative;
  background: linear-gradient(160deg, var(--navy) 0%, #1a3a5c 60%, var(--navy-mid) 100%);
  padding: 60px 24px 40px;
  overflow: hidden;
}
.landing-bg-gradient {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(232,168,62,0.15) 0%, transparent 60%);
  pointer-events: none;
}
.landing-content { position: relative; }

.landing-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.logo-mark {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--gold) 0%, #f5a623 100%);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  font-weight: 900;
  color: var(--navy);
  box-shadow: 0 4px 20px rgba(232,168,62,0.4);
}
.logo-mark.sm { width: 40px; height: 40px; font-size: 20px; border-radius: 10px; }
.brand-name {
  font-size: 32px;
  font-weight: 900;
  color: var(--white);
  letter-spacing: -0.5px;
}
.brand-name.sm { font-size: 24px; }

.landing-tagline {
  font-size: 18px;
  font-weight: 400;
  color: rgba(255,255,255,0.8);
  line-height: 1.5;
  margin-bottom: 28px;
}

.landing-categories {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.lc-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.9);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(8px);
}
.lc-chip i { font-size: 12px; color: var(--gold); }

.landing-how {
  padding: 28px 20px;
  background: var(--white);
}
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 16px;
}
.how-steps { display: flex; flex-direction: column; gap: 14px; }
.how-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.step-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.step-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.step-desc { font-size: 13px; color: var(--text-light); line-height: 1.4; }

.landing-cta-section {
  padding: 24px 20px 32px;
  background: var(--surface);
}
.landing-note {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 10px;
}

/* ===== LOGIN ===== */
.login-wrap {
  padding: 48px 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
  background: var(--white);
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}
.login-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  text-align: center;
  margin-bottom: 8px;
}
.login-sub {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 32px;
  line-height: 1.5;
}
.login-providers {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
}
.btn-google {
  background: var(--white);
  color: var(--text);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-google:hover { background: var(--surface-2); }
.btn-phone {
  background: var(--navy);
  color: var(--white);
  border: none;
}
.btn-phone:hover { background: var(--navy-mid); }
.btn-phone i { color: var(--gold); }

.login-terms {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}
.login-terms a { color: var(--navy); text-decoration: underline; }

/* ===== ONBOARDING ===== */
.onboard-wrap {
  padding: 40px 24px 32px;
  min-height: 100%;
  background: var(--white);
  display: flex;
  flex-direction: column;
}
.onboard-progress {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 40px;
}
.progress-dot {
  width: 8px; height: 8px;
  border-radius: 4px;
  background: var(--border);
  transition: all 0.3s;
}
.progress-dot.active {
  background: var(--navy);
  width: 24px;
}
.onboard-step { display: none; flex-direction: column; flex: 1; }
.onboard-step.active { display: flex; }

.onboard-hero-icon {
  width: 80px; height: 80px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  color: var(--gold);
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
}
.onboard-hero-icon.loc {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white;
}

.onboard-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 12px;
}
.onboard-desc {
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 20px;
}
.onboard-features { display: flex; flex-direction: column; gap: 10px; }
.of-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.of-item i { color: #22c55e; font-size: 16px; }

.cat-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}
.cat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid var(--border);
  background: var(--surface-2);
  color: var(--text-light);
  transition: all 0.2s;
}
.cat-chip.selected {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.location-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 8px;
}
.location-preview > i { font-size: 24px; color: var(--gold); }
.loc-name { font-size: 15px; font-weight: 700; color: var(--text); }
.loc-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ===== LIST VIEW ===== */
.list-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sort-toggle {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 3px;
}
.sort-btn {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; gap: 4px;
}
.sort-btn.active {
  background: var(--white);
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}

#list-content {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ===== CREATE ===== */
.create-step-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  padding: 16px 16px 8px;
}
.create-cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 8px 16px 16px;
}
.create-cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 12px;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}
.create-cat-card:active { transform: scale(0.97); border-color: var(--navy); }
.create-cat-card i { font-size: 24px; }
.create-cat-card:hover { border-color: var(--navy); }

.create-form { padding: 0 16px; }
.form-field {
  margin-bottom: 14px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s;
  text-align: right;
}
.form-input:focus { border-color: var(--navy); }
textarea.form-input { resize: vertical; min-height: 80px; }

.create-success {
  padding: 40px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.success-icon { font-size: 56px; color: #22c55e; margin-bottom: 16px; }
.create-success h3 { font-size: 22px; font-weight: 800; color: var(--navy); margin-bottom: 8px; }
.create-success p { font-size: 14px; color: var(--text-light); line-height: 1.5; }

/* ===== RESPONDERS ===== */
.responder-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.responder-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-light), var(--navy));
  color: white;
  font-size: 20px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.responder-info { flex: 1; }
.responder-name { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.responder-meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.responder-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
  background: #f0fdf4;
  color: #15803d;
}

/* ===== SETTINGS ===== */
.settings-section {
  margin-bottom: 0;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}
.settings-section:first-child { margin-top: 8px; }
.settings-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 14px;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--surface-2);
}
.settings-row:last-child { border-bottom: none; }
.sr-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.sr-label i { width: 16px; text-align: center; color: var(--muted); }
.source-wa i { color: #25d366; }
.source-fb i { color: #1877f2; }

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px; height: 24px;
}
.toggle-switch input { display: none; }
.ts-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: 0.3s;
}
.ts-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 9px;
  background: white;
  right: 3px; top: 3px;
  transition: 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .ts-slider { background: var(--navy); }
.toggle-switch input:checked + .ts-slider::before { transform: translateX(-20px); }

/* Range Slider */
.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.range-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
  direction: ltr;
}
.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--navy);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.range-slider-sm {
  width: 100%;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
  direction: ltr;
  margin-top: 4px;
}
.range-slider-sm::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--navy);
  cursor: pointer;
}

.slider-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin-top: 8px;
}
.cat-weight-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.cat-weight-row input { flex: 1; }

.urgency-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.urg-btn {
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  border: 2px solid var(--border);
  background: var(--surface-2);
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
}
.urg-btn.active {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
}

.view-pref-btns {
  display: flex;
  gap: 10px;
}
.view-btn {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  border: 2px solid var(--border);
  background: var(--surface-2);
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.view-btn.active {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
}

/* ===== PROFILE ===== */
.profile-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  padding: 32px 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.profile-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, #f5a623 100%);
  color: var(--navy);
  font-size: 28px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(232,168,62,0.4);
  flex-shrink: 0;
}
.profile-info { flex: 1; }
.profile-name {
  font-size: 20px;
  font-weight: 800;
  color: white;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.profile-area {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 12px;
}
.profile-area i { color: var(--gold); font-size: 11px; }
.profile-stats {
  display: flex;
  gap: 16px;
}
.pstat { text-align: center; }
.pstat-num { font-size: 18px; font-weight: 800; color: white; display: block; }
.pstat-label { font-size: 11px; color: rgba(255,255,255,0.6); display: block; }

.profile-menu { background: var(--white); }
.pm-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.pm-item:active { background: var(--surface-2); }
.pm-item i:first-child { color: var(--muted); width: 18px; text-align: center; }
.pm-item span { flex: 1; }
.pm-arrow { color: var(--muted-light); font-size: 12px; }
.pm-danger { color: #dc2626; }
.pm-danger i:first-child { color: #dc2626; }

/* ===== MY POSTS ===== */
.my-post-card {
  margin: 12px 16px 0;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.my-post-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.my-post-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 10px;
}
.my-post-status.active { background: #f0fdf4; color: #16a34a; }
.my-post-status.expired { background: #fef2f2; color: #dc2626; }
.my-post-body { padding: 12px 14px; }
.my-post-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.my-post-desc { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.my-post-stats { display: flex; gap: 16px; margin-bottom: 12px; }
.mps { font-size: 12px; color: var(--text-light); display: flex; align-items: center; gap: 4px; }
.mps i { color: var(--muted); }
.my-post-actions { display: flex; gap: 8px; }
.my-post-actions button { flex: 1; }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: absolute;
  bottom: 0; right: 0; left: 0;
  height: var(--nav-h);
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,.06);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  cursor: pointer;
  color: var(--muted);
  transition: color 0.2s;
  font-size: 10px;
  font-weight: 600;
}
.nav-item i { font-size: 20px; transition: transform 0.2s; }
.nav-item.active {
  color: var(--navy);
}
.nav-item.active i { transform: translateY(-2px); }

.nav-fab {
  flex: 0 0 68px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
}
.fab-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: white;
  font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(15,32,55,0.4);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 3px solid white;
}
.fab-btn:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(15,32,55,0.5); }
.fab-btn:active { transform: scale(0.96); }

/* ===== HOT ICON ===== */
.hot-icon { color: #f97316; }
.nearby-icon { color: var(--gold); }

/* ===== INLINE HEADER LAYOUT ===== */
.inline-title {
  display: inline;
  font-size: 18px;
  vertical-align: middle;
}
.back-btn.inline {
  display: inline-flex;
  margin-left: 8px;
  vertical-align: middle;
}

/* ===== INLINE TITLE HEADER ===== */
.screen-header {
  display: flex;
  flex-direction: column;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color: white;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
  max-width: 90%;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}
.empty-state i { font-size: 40px; margin-bottom: 12px; color: var(--border); }
.empty-state p { font-size: 15px; font-weight: 600; margin-bottom: 6px; color: var(--text-light); }
.empty-state span { font-size: 13px; }

/* ===== LEAFLET OVERRIDES ===== */
.leaflet-container { font-family: 'Heebo', sans-serif; }
.leaflet-popup-content-wrapper {
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 0 !important;
  overflow: hidden;
}
.leaflet-popup-content { margin: 0 !important; }
.map-popup {
  padding: 12px 14px;
  min-width: 180px;
}
.map-popup-title { font-size: 14px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.map-popup-meta { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.map-popup-btn {
  display: block;
  width: 100%;
  padding: 8px;
  background: var(--navy);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  font-family: 'Heebo', sans-serif;
}

/* ===== DESKTOP SIDE PANEL ===== */
#side-panel {
  display: none;
  width: 340px;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255,255,255,0.1);
  height: 100vh;
  overflow-y: auto;
  padding: 28px 20px;
  position: sticky;
  top: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}
#side-panel::-webkit-scrollbar { width: 4px; }
#side-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

.sp-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.sp-brand {
  font-size: 22px;
  font-weight: 900;
  color: white;
}

.sp-variant-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 24px;
  letter-spacing: 0.3px;
}

.sp-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sp-section:last-child { border-bottom: none; }
.sp-section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--gold);
  margin-bottom: 10px;
}
.sp-text {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  line-height: 1.6;
}
.sp-text-muted { color: rgba(255,255,255,0.5); font-size: 12px; margin-top: 4px; }

.sp-variant-desc { display: flex; flex-direction: column; gap: 8px; }
.sp-vd-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  line-height: 1.4;
}
.sp-vd-row i { flex-shrink: 0; margin-top: 1px; }

.sp-cats { display: flex; flex-direction: column; gap: 6px; }
.sp-cat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.8);
}
.sp-cat-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sp-sources { display: flex; flex-direction: column; gap: 8px; }
.sp-source-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.8);
}
.src-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 8px;
  flex-shrink: 0;
}
.src-badge.native { background: #dcfce7; color: #15803d; }
.src-badge.whatsapp { background: #dcfce7; color: #15803d; }
.src-badge.facebook { background: #dbeafe; color: #1d4ed8; }
.src-badge.auto { background: #f5f3ff; color: #7c3aed; }
.src-badge.sponsored { background: var(--gold-pale); color: #92400e; }

.sp-trust-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  margin-bottom: 6px;
}

.sp-flows { display: flex; flex-direction: column; gap: 10px; }
.sp-flow {
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 10px 12px;
}
.sp-flow-title { font-size: 12px; font-weight: 700; color: var(--gold); margin-bottom: 4px; }
.sp-flow-steps { font-size: 12px; color: rgba(255,255,255,0.7); line-height: 1.5; }

.sp-footer { margin-top: 8px; text-align: center; }
.sp-footer-text { font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.5); }
.sp-footer-sub { font-size: 11px; color: rgba(255,255,255,0.3); margin-top: 2px; }

/* ===== BADGE NEW ===== */
.badge-new {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: #dcfce7;
  color: #15803d;
  letter-spacing: 0.3px;
}

/* ===== NOTIFICATIONS ===== */
.notif-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.notif-row:active { background: var(--surface-2); }
.notif-row.unread { background: #f0f6ff; }
.notif-icon-wrap {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 16px;
}
.notif-body { flex: 1; }
.notif-text { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.4; margin-bottom: 3px; }
.notif-time { font-size: 11px; color: var(--muted); }
.notif-unread-dot {
  width: 9px; height: 9px;
  background: #3b82f6;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

/* ===== DESKTOP LAYOUT (> 768px) ===== */
@media (min-width: 769px) {
  #desktop-wrapper {
    flex-direction: row-reverse;
    justify-content: center;
    align-items: stretch;
    gap: 0;
    overflow: hidden;
  }

  #phone-frame {
    width: 390px;
    flex-shrink: 0;
    height: 100vh;
    border-radius: 0;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
  }

  #phone-status-bar {
    display: flex;
  }

  #side-panel {
    display: block;
    flex: 0 0 340px;
  }

  .toast {
    left: calc(50% - 170px);
    transform: translateX(-50%) translateY(20px);
  }
  .toast.show {
    transform: translateX(-50%) translateY(0);
  }
}

@media (min-width: 1200px) {
  #side-panel { width: 380px; flex: 0 0 380px; padding: 32px 28px; }
}
