/* styles.css */

:root {
  --bg: #f2f2f2;
  --surface: #ffffff;
  --surface2: #fafafa;
  --text: #111;
  --muted: #555;
  --border: #cfcfcf;
  --border2: #e6e6e6;
  --link: #0000cc;
  --linkHover: #0000ff;
  --btn: #f3f3f3;
  --btnHover: #e9e9e9;
  --pill: #f7f7f7;
}

body.dark {
  --bg: #111315;
  --surface: #1a1d21;
  --surface2: #20242a;
  --text: #e8e8e8;
  --muted: #a7adb7;
  --border: #323844;
  --border2: #2a303a;
  --link: #7fb3ff;
  --linkHover: #a8ccff;
  --btn: #262b33;
  --btnHover: #313844;
  --pill: #2a3038;
}


body.dark .input {
  background: #14181d;
  color: var(--text);
}

body.dark .input::placeholder {
  color: var(--muted);
}


/* ========================================
   Theme Switch
======================================== */

.themeSwitch {
  position: relative;
  display: inline-block;
  width: 54px;
  height: 30px;
  flex: 0 0 auto;
}

.themeSwitch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.themeSlider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: var(--btn);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.themeSlider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 50%;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.themeSwitch input:checked + .themeSlider {
  background: #355e3b;
  border-color: #355e3b;
}

.themeSwitch input:checked + .themeSlider::before {
  transform: translateX(24px);
}

.themeSwitch input:focus + .themeSlider {
  box-shadow: 0 0 0 3px rgba(127, 179, 255, 0.18);
}

/* optional icons */
.themeSlider::after {
  content: "☀";
  position: absolute;
  right: 8px;
  top: 5px;
  font-size: 12px;
  line-height: 1;
  color: #c28a00;
}

.themeSwitch input:checked + .themeSlider::after {
  content: "🌙";
  left: 8px;
  right: auto;
  color: #d8e6ff;
}


/* ========================================
   Base
======================================== */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.35;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--linkHover);
  text-decoration: underline;
}

/* ========================================
   Layout
======================================== */

.wrap {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 12px 0 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

/* ========================================
   Buttons
======================================== */

.btn {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--btn);
  color: var(--text);   /* FIXED */
}

.btn:hover { background: var(--btnHover); }

.btn.ghost {
  background: var(--surface); 
}

.btn.danger {
  background: #b00020;
  color: #fff;
}

/* ========================================
   Top Header (MAIN SYSTEM)
======================================== */

.topHeader {
  display: grid;
  grid-template-columns: 240px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.topHeaderHome {
  background: var(--surface);
}

.topHeaderInner {
  background: linear-gradient(180deg, #355e3b 0%, #4e7b53 100%);
  color: #fff;
}

.topHeaderLogo {
  display: flex;
  flex-direction: column;
}

.topHeaderLogo .sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.topHeaderInner .sub {
  color: rgba(255,255,255,0.9);
}

.logo {
  height: 52px;
}

.logoHome {
  width: 100%;
  max-width: 220px;
  height: auto;
}

.topHeaderBanner {
  text-align: center;
}

.topHeaderBanner h1 {
  margin: 0 0 6px;
  font-size: 26px;
}

.topHeaderBanner p {
  margin: 0;
  font-size: 14px;
}

.topHeaderInner .topHeaderBanner h1,
.topHeaderInner .topHeaderBanner p {
  color: #fff;
}

.topHeaderActions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow-x: auto;
}

.topHeaderActions .btn,
.topHeaderActions .themeSwitch {
  flex-shrink: 0;
}

.topHeaderInner .btn:hover {
  background: var(--btnHover);
}

.topHeaderInner .btn.current {
  background: var(--btnHover);
  color: var(--text);
}

/* ========================================
   Hero (used on index)
======================================== */

.hero {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.heroCtas {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.fineprint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

/* ========================================
   Forms
======================================== */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.input {
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);   /* ADD THIS */
  color: var(--text);           /* ADD THIS */
}

/* ========================================
   Category Tiles
======================================== */

.catTiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.tile {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 10px;
}

.tile.active {
  outline: 2px solid #4caf50;
}

/* ========================================
   Listings
======================================== */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.card {
  padding: 8px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.price {
  font-weight: bold;
}

.thumb {
  width: 180px;
  height: 260px;
  border-radius: 10px;
}

.meta {
  font-size: 12px;
  color: var(--muted);
}

.tag {
  font-size: 11px;
  background: var(--pill);
  padding: 3px 6px;
  border-radius: 999px;
}


/* Center the whole form */
form {
  max-width: 800px;
  margin: 0 auto; /* centers the form */
}

/* Each row = label + input */
.form-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

/* Labels on the left */
.form-row label {
  width: 200px;
  text-align: left;
  font-weight: bold;
}

/* Inputs on the right */
.form-row input,
.form-row textarea,
.form-row select {
  flex: 1; /* fills remaining space */
  padding: 10px;
  font-size: 14px;
}



/* ========================================
   Footer
======================================== */

.footerNote {
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
}

/* ========================================
   Responsive
======================================== */

@media (max-width: 980px) {
  .topHeader {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .topHeaderActions {
    justify-content: center;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}





/* ========================================
  City Navigation
======================================== */
.layout {
  display: flex;
  align-items: flex-start;
  width: 100%;
  gap: 18px;
}

.sidebar {
  width: 240px;
  min-width: 240px;
  padding: 14px 18px 14px 8px;
  border-right: 1px solid var(--border);
  margin-left: 8px;
}

.sidebarTitle {
  font-size: 14px;
  font-weight: 800;
  margin: 0 0 12px 0;
}

.cityLink {
  display: block;
  padding: 8px 10px;
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--text);
  border-radius: 8px;
  line-height: 1.2;
}

.cityLink:hover {
  background: var(--surface2);
}

.cityLink.active {
  background: #355e3b;
  color: #fff;
  font-weight: 700;
}

.content {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.contentInner {
  width: 100%;
  max-width: 1450px;
  padding: 0 24px 0 10px;
}