/* ==========================================================================
   Buzzline Uganda — Design System
   Palette: Dodger Blue (primary), Dark Red (alerts), white base, dark gray text
  Type: Helvetica for headings and body/UI
   ========================================================================== */

:root {
  --blue: #1e78ff;
  --blue-dark: #0f5fd6;
  --blue-tint: #eaf2ff;
  --red: #a11313;
  --red-tint: #fbeaea;
  --ink: #16181d;
  --ink-soft: #565c66;
  --ink-faint: #8a909b;
  --line: #e2e5ea;
  --line-soft: #eef0f3;
  --bg: #ffffff;
  --bg-sunken: #f7f8fa;
  --gold: #d9a441; /* small accent for price / featured touches, used sparingly */

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(22, 24, 29, 0.06), 0 1px 1px rgba(22, 24, 29, 0.04);
  --shadow-md: 0 8px 24px rgba(22, 24, 29, 0.08);
  --shadow-lg: 0 20px 48px rgba(22, 24, 29, 0.14);

  --font-display: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Helvetica Neue", Helvetica, Arial, sans-serif;

  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.4em;
  color: var(--ink);
}
h1 { font-size: clamp(2rem, 4vw, 3.1rem); font-weight: 500; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; color: var(--ink-soft); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-outline { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn-outline:hover { background: var(--blue-tint); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { color: var(--ink); background: var(--bg-sunken); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #7f0f0f; }
.btn-danger-outline { background: transparent; color: var(--red); border-color: var(--red); }
.btn-danger-outline:hover { background: var(--red-tint); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
}
.brand .brand-mark { color: var(--blue); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.nav-links a:hover, .nav-links a.active { color: var(--blue); background: var(--blue-tint); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  transition: 0.2s;
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links, .nav-actions.auth-only, .nav-actions.guest-only {
    position: fixed;
    inset: 62px 0 auto 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 20px 20px;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    display: none;
  }
  .nav-links.open, .nav-actions.open { display: flex; }
  .nav-links a { padding: 12px 14px; }
  .nav-actions { flex-direction: column; }
}

/* ---------- Hero / Search ---------- */
.hero {
  background: linear-gradient(180deg, var(--blue-tint) 0%, #fff 78%);
  padding: 64px 0 40px;
  border-bottom: 1px solid var(--line-soft);
}
.hero-eyebrow { color: var(--blue); font-weight: 600; font-size: 0.9rem; margin-bottom: 10px; }
.hero h1 { max-width: 720px; }
.hero-sub { max-width: 560px; font-size: 1.08rem; }

.search-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 18px;
  margin-top: 28px;
  display: grid;
  grid-template-columns: 2fr 1.2fr auto;
  gap: 12px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); }
.field input, .field select {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
.field input:focus, .field select:focus { border-color: var(--blue); }

@media (max-width: 760px) {
  .search-card { grid-template-columns: 1fr; }
}

/* ---------- Type chips ---------- */
.type-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 6px;
}
.chip {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: 0.12s;
}
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---------- Filters bar ---------- */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 26px;
}
.filters-bar .field { min-width: 150px; }
.filters-bar .field.grow { flex: 1; min-width: 200px; }

/* ---------- Section ---------- */
.section { padding: 44px 0; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 22px;
}
.section-head p { margin: 0; }

/* ---------- Property grid & cards ---------- */
.property-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
@media (max-width: 980px) { .property-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .property-grid { grid-template-columns: 1fr; } }

.property-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
}
.property-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg-sunken);
  overflow: hidden;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.card-media img.show { opacity: 1; }
.card-type-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(22, 24, 29, 0.72);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
}
.card-dots {
  position: absolute;
  bottom: 10px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 5px;
}
.card-dots span {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
}
.card-dots span.on { background: #fff; }
.card-body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-family: var(--font-display); font-size: 1.08rem; font-weight: 600; margin: 0; }
.card-location { font-size: 0.85rem; color: var(--ink-faint); display: flex; gap: 6px; align-items: center; }
.card-desc { font-size: 0.88rem; color: var(--ink-soft); margin: 4px 0 0; flex: 1; }
.card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.card-price { font-weight: 700; color: var(--ink); }
.card-price span { font-weight: 500; color: var(--ink-faint); font-size: 0.78rem; }

/* ---------- Empty / loading / error states ---------- */
.state-block {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}
.state-block h3 { margin-bottom: 8px; }
.spinner {
  width: 22px; height: 22px;
  border: 3px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.inline-loading { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 0.9rem; }
.inline-loading .spinner { width: 14px; height: 14px; border-width: 2px; margin: 0; }

.banner {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.9rem;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.banner-error { background: var(--red-tint); color: var(--red); border-color: #f0caca; }
.banner-success { background: #e9f7ee; color: #1e6b3a; border-color: #c9ebd4; }
.banner-info { background: var(--blue-tint); color: var(--blue-dark); border-color: #cfe2ff; }

/* ---------- Forms ---------- */
.auth-shell {
  min-height: calc(100vh - 66px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--bg-sunken);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 36px 32px;
}
.auth-card h1 { font-size: 1.7rem; margin-bottom: 6px; }
.auth-card .sub { margin-bottom: 22px; }
.form-group { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.86rem; font-weight: 600; }
.form-group input, .form-group select, .form-group textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 0.95rem;
  font-family: inherit;
  width: 100%;
  color: var(--ink);
  background: #fff;
}
.form-group textarea { resize: vertical; min-height: 90px; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--blue); }
.form-hint { font-size: 0.78rem; color: var(--ink-faint); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.form-links { display: flex; justify-content: space-between; font-size: 0.86rem; margin-top: 6px; }
.form-links a { color: var(--blue); font-weight: 500; }
.auth-foot { text-align: center; margin-top: 20px; font-size: 0.9rem; color: var(--ink-soft); }
.auth-foot a { color: var(--blue); font-weight: 600; }

/* ---------- Card panel (dashboard/listing forms) ---------- */
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.panel + .panel { margin-top: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.panel-head h2 { margin: 0; font-size: 1.15rem; }

/* ---------- Dashboard stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
@media (max-width: 860px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}
.stat-num { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; color: var(--blue); }
.stat-label { font-size: 0.84rem; color: var(--ink-soft); }

/* ---------- Listing management rows ---------- */
.listing-row {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  background: #fff;
}
.listing-row img {
  width: 88px; height: 68px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: var(--bg-sunken);
}
.listing-row .info { flex: 1; min-width: 0; }
.listing-row .info h3 { margin: 0 0 4px; font-size: 1rem; }
.listing-row .meta { font-size: 0.82rem; color: var(--ink-faint); display: flex; gap: 10px; flex-wrap: wrap; }
.listing-row .row-actions { display: flex; gap: 8px; flex-shrink: 0; }

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.status-active { background: #e9f7ee; color: #1e6b3a; }
.status-draft { background: #f1f2f4; color: var(--ink-soft); }
.status-inactive { background: #f1f2f4; color: var(--ink-faint); }
.status-expired { background: var(--red-tint); color: var(--red); }

/* ---------- Plans (accommodation add/remove rows) ---------- */
.plan-row {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
  background: var(--bg-sunken);
}
.plan-row .remove-plan {
  position: absolute;
  top: 10px; right: 10px;
}

/* ---------- Image upload grid ---------- */
.image-drop {
  border: 2px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 26px;
  text-align: center;
  color: var(--ink-soft);
  cursor: pointer;
  background: var(--bg-sunken);
}
.image-drop:hover { border-color: var(--blue); color: var(--blue); }
.image-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 14px; }
.image-thumb { position: relative; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 1; }
.image-thumb img { width: 100%; height: 100%; object-fit: cover; }
.image-thumb .remove-img {
  position: absolute; top: 6px; right: 6px;
  background: rgba(22,24,29,0.7);
  color: #fff;
  border: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  font-size: 0.8rem;
  line-height: 1;
}
.image-thumb .uploading-overlay {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.75);
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Property details page ---------- */
.detail-header { padding: 34px 0 18px; }
.detail-type { color: var(--blue); font-weight: 600; font-size: 0.86rem; margin-bottom: 8px; }
.detail-loc { color: var(--ink-faint); font-size: 0.95rem; margin-top: 6px; }

.gallery {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 0;
  height: 300px;
  max-height: 300px;
  grid-auto-rows: 140px;
}
.gallery img { width: 100%; height: 100%; max-height: 300px; object-fit: cover; cursor: pointer; }
.gallery a:first-child { grid-row: 1 / 3; }
@media (max-width: 760px) {
  .gallery {
    grid-template-columns: 1.25fr 1fr;
    grid-template-rows: none;
    grid-auto-rows: 1fr;
    height: min(330px, 82vw);
    max-height: none;
  }
  .gallery a:first-child { grid-row: 1 / 3; }
  .gallery img { height: 100%; max-height: none; aspect-ratio: auto; }
}

.detail-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 34px; margin-top: 30px; }
@media (max-width: 900px) { .detail-layout { grid-template-columns: 1fr; } }

.feature-list { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; list-style: none; margin: 14px 0; }
.feature-list li {
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.plan-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 12px;
}
.plan-card .price { font-weight: 700; color: var(--blue-dark); float: right; }

.sticky-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: sticky;
  top: 90px;
  box-shadow: var(--shadow-sm);
}
.contact-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; font-size: 0.92rem; }

.lightbox {
  position: fixed; inset: 0;
  background: rgba(10, 11, 14, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 30px;
}
.lightbox.open { display: flex; }
.lightbox img { max-height: 88vh; max-width: 100%; border-radius: 6px; }
.lightbox .lb-close { position: absolute; top: 20px; right: 24px; color: #fff; font-size: 1.6rem; background: none; border: none; }
.lightbox .lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.4rem;
  cursor: pointer;
}
.lightbox .lb-nav:hover { background: rgba(255,255,255,0.28); }
.lightbox .lb-prev { left: 24px; }
.lightbox .lb-next { right: 24px; }
@media (max-width: 760px) {
  .lightbox { padding: 20px 58px; }
  .lightbox .lb-prev { left: 10px; }
  .lightbox .lb-next { right: 10px; }
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(22,24,29,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 150;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 420px;
  width: 100%;
  padding: 26px;
  box-shadow: var(--shadow-lg);
}
.modal-box h3 { margin-bottom: 10px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: #cfd3da;
  padding: 46px 0 26px;
  margin-top: 60px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 { color: #fff; font-family: var(--font-body); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px; }
.footer-grid .brand { color: #fff; margin-bottom: 10px; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: #cfd3da; font-size: 0.9rem; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 20px;
  font-size: 0.82rem;
  color: #8b909b;
}

/* ---------- Misc ---------- */
.page-shell { min-height: calc(100vh - 66px); }
.skeleton {
  background: linear-gradient(90deg, var(--bg-sunken) 25%, var(--line-soft) 37%, var(--bg-sunken) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.badge-demo {
  display: inline-block;
  background: var(--gold);
  color: #3a2c05;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
}
