@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500&family=Plus+Jakarta+Sans:wght@600;700&display=swap');
@import "map.css";
@import "houses.css";
@import "house-detail.css";
@import "fab.css";
@import "components/carousel.css";
@import "components/form.css";

/* ════════════════════════════════════════════════════════════
   1. DESIGN TOKENS
   All raw values live here. Change a token and it ripples
   everywhere. Never hardcode a color, radius, or spacing
   value outside this block.
   ════════════════════════════════════════════════════════════ */

:root {
  /* — Palette — */
  --cyan:      #51e2f5;
  --cyan-soft: #9df9ef;
  --yellow:    #edf756;
  --pink:      #ffa8b6;
  --mauve:     #a28089;

  /* — Surfaces — */
  --bg:        #eef7f7;
  --surface:   #ffffff;
  --surface-2: #e0f9f7;

  /* — Borders — */
  --border:      #c4eaed;
  --border-dark: #8fd6dc;

  /* — Semantic status — */
  --success:     #00c4aa;
  --success-bg:  #d0f5f0;
  --warn:        #c8ce00;
  --warn-bg:     #f4f7b8;
  --danger:      #f07088;
  --danger-bg:   #fcd8df;

  /* — Text — */
  --text:       #1f2933;
  --text-2:     #52606d;
  --text-3:     #7b8794;
  --text-4:     var(--cyan);

  /* — Typography — */
  --font-display: 700 2rem/1.2 "Plus Jakarta Sans", sans-serif;
  --font-heading: 600 1.25rem/1.35 "Plus Jakarta Sans", sans-serif;
  --font-body:    400 1rem/1.6 "Inter", sans-serif;
  --font-small:   400 0.875rem/1.5 "Inter", sans-serif;

  /* — Shape — */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  /* — App chrome — */
  --nav-height:    68px;
  --header-height: 56px;

  /* — Motion — */
  --ease: 0.18s ease;
  --slide: 0.3s;
}


/* ════════════════════════════════════════════════════════════
   2. RESET & BASE
   Minimal normalization. Sets the page foundation.
   ════════════════════════════════════════════════════════════ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font: var(--font-body);
  color: var(--text);
  background-color: var(--bg);
  min-height: 100vh;
}

/* Auth pages center their card */
body.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
}

h2 { font: var(--font-display); color: var(--text); }
h3 { font: var(--font-heading); color: var(--text); }

a {
  display: block;
  text-align: center;
  font: var(--font-small);
  color: var(--text-2);
  text-decoration: none;
  transition: color var(--ease);
}
a:hover { color: var(--text); }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.25rem 0;
}
svg {
  width: 18px;
  height: 18px;
}

input {
  width: 100%;
}

/* ════════════════════════════════════════════════════════════
   3. FORM CONTROLS
   Inputs, checkboxes, labels. Used on auth and modal forms.
   ════════════════════════════════════════════════════════════ */

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 0.6875rem 0.875rem;
  font: var(--font-body);
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
  appearance: none;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder { color: var(--text-3); }

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(81, 226, 245, 0.18);
  background: var(--surface);
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--cyan);
  cursor: pointer;
  flex-shrink: 0;
}

/* Inline label + checkbox row (e.g. "Remember Me") */
.field-row--check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font: var(--font-small);
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}

/* Two inputs side by side (first + last name) */
.field-row--split {
  display: flex;
  gap: 0.5rem;
}
.field-row--split input { width: 50%; }


/* ════════════════════════════════════════════════════════════
   4. BUTTONS
   Primary and secondary variants. Width is full by default;
   use a wrapper or flex layout to constrain width.
   ════════════════════════════════════════════════════════════ */

button {
  width: 100%;
  padding: 0.6875rem 1rem;
  font: var(--font-body);
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--ease), transform var(--ease), box-shadow var(--ease);
}

button:active { transform: scale(0.98); }

/* .btn-primary — filled cyan action */
.btn-primary,
button[onclick*="login"],
button[onclick*="register"] {
  background: var(--cyan);
  color: var(--text);
  border-color: transparent;
}

.btn-primary:hover,
button[onclick*="login"]:hover,
button[onclick*="register"]:hover {
  background: var(--cyan-soft);
  box-shadow: 0 2px 10px rgba(81, 226, 245, 0.30);
}

/* .btn-secondary — ghost / outlined */
.btn-secondary {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border-dark);
}

/* .btn-secondary:hover,
button + button:hover {
  background: var(--surface-2);
  color: var(--text);
} */

/* .btn-danger — destructive actions */
.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
}

/* .btn-icon — small borderless icon button (delete, close, etc.) */
.btn-icon {
  background: none;
  border: none;
  width: auto;
  padding: 0;
  color: var(--text-3);
  cursor: pointer;
  font-size: 1rem;
  transform: none;
  transition: color var(--ease);
}
.btn-icon:active { transform: none; }
.btn-icon:hover  { color: var(--danger); }


/* ════════════════════════════════════════════════════════════
   5. FEEDBACK — Inline messages & badges
   ════════════════════════════════════════════════════════════ */

/* Inline form message (login/register errors) */
#msg {
  display: none;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-sm);
  font: var(--font-small);
  font-weight: 500;
}

#msg.success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success); }
#msg.error   { background: var(--danger-bg);  color: var(--danger);  border: 1px solid var(--danger); }
#msg.warn    { background: var(--warn-bg);    color: var(--warn);    border: 1px solid var(--warn); }

/* Small inline badges */
.badge {
  display: inline-block;
  padding: 0.2em 0.6em;
  border-radius: var(--radius-sm);
  font: var(--font-small);
  font-weight: 500;
}

.badge--success { background: var(--success-bg); color: var(--success); }
.badge--warn    { background: var(--warn-bg);    color: var(--warn); }
.badge--danger  { background: var(--danger-bg);  color: var(--danger); }
.badge--muted   { background: var(--surface-2);  color: var(--text-2); }


/* ════════════════════════════════════════════════════════════
   6. AUTH LAYOUT
   The centered card used on /login and /register.
   ════════════════════════════════════════════════════════════ */

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 4px 16px rgba(81, 226, 245, 0.10);
}

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2.5rem 2rem; width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 0.875rem; box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 16px rgba(81,226,245,0.10); }


/* ════════════════════════════════════════════════════════════
   7. APP SHELL
   Fixed header + scrolling content area + fixed bottom nav.
   This is the chrome that wraps every app page.
   ════════════════════════════════════════════════════════════ */

#app-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ── Top header bar ── */
#app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 1001;
}

#app-header h2 {
  font: var(--font-heading);
  color: var(--text);
}

/* ── Scrollable page body ── */
#page-content {
  flex: 1;
  overflow-y: auto;
  padding: calc(var(--header-height) + 1.5rem) 1.25rem calc(var(--nav-height) + 1.5rem);
  background: var(--bg);
  min-height: 100vh;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  /* disable scroll wheel for Firefox + MS Edge */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.scroll-area {

  top: var(--header-height);
  bottom: var(--nav-height);

  overflow-y: auto;

  /* disable scroll wheel for Firefox + MS Edge */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* dissable scoll wheel for Chrome + Safari */
.scroll-area::-webkit-scrollbar {
  display: none;
}

/* ── Bottom nav bar ── */
#app-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 0.25rem;
  z-index: 1001;
  /* subtle top shadow so it lifts off the page */
  box-shadow: 0 -2px 12px rgba(81, 226, 245, 0.10);
}

/* Nav tab buttons */
.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  padding: 0.45rem 0 0.35rem;
  font: var(--font-small);
  font-weight: 500;
  color: var(--text-3);
  background: none;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    color 0.15s ease,
    background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

/* Icon wrapper — fixed size so labels stay aligned */
.nav-tab .nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: var(--radius-sm);
  transition:
    background 0.15s ease,
    transform  0.15s ease;
}

.nav-tab .nav-icon svg {
  width:  1.25rem;
  height: 1.25rem;
  stroke: currentColor;
  transition: stroke 0.15s ease;
}

.nav-tab .nav-label {
  font-size: 0.65rem;
  letter-spacing: 0.01em;
  line-height: 1;
}

/* ── Active state ── */
.nav-tab.active {
  color: var(--text);
}

.nav-tab.active .nav-icon {
  background: var(--surface-2);
  /* pill shape matches the slider pill on the home page */
  border-radius: var(--radius);
}

.nav-tab.active .nav-icon svg {
  stroke: var(--cyan);
}

/* ── Press feedback ── */
.nav-tab:active .nav-icon {
  transform: scale(0.88);
}

/* ════════════════════════════════════════════════════════════
   8. SURFACE COMPONENTS
   Reusable card/panel primitives used inside page content.
   ════════════════════════════════════════════════════════════ */

/* Generic content panel (white box with border) */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

/* Stat card — one quarter of the stats grid */
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.metric-val {
  font: var(--font-display);
  font-size: 1.5rem;
  color: var(--text);
  display: flex;
  flex-direction: row;
}

.metric-val--positive { color: var(--success); }
.metric-val--negative { color: var(--danger); }
.metric-val--accent   { color: var(--cyan); }

.metric-val-input {
  border: none;
  font: inherit;
  color: inherit;
}

.metric-val-input:focus {
  outline: none;
}

.metric-val-input::placeholder {
  color: inherit;
}

.metric-label {
  font: var(--font-small);
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

/* 2-column grid for stat cards */
.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}


/* ════════════════════════════════════════════════════════════
   9. PAGE COMPONENTS
   One section per feature/page. Add new pages at the bottom.
   ════════════════════════════════════════════════════════════ */


/* ── Welcome banner (home page) ── */
.welcome {
  margin-bottom: 1.25rem;
}

.welcome h2 {
  font: var(--font-heading);
  color: var(--text);
}

.welcome p {
  font: var(--font-small);
  color: var(--text-2);
  margin-top: 0.25rem;
}

/* ── content slider ──   */
.content-slider {
  position: relative;
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 3px;
  margin-bottom: 1.25rem;
  user-select: none;
  touch-action: pan-y;
}

/* Sliding highlight pill */
.content-slider__track {
  position: absolute;
  top: 3px;
  left: 3px;
  height: calc(100% - 6px);
  border-radius: calc(var(--radius-xl) - 3px);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
  transition: transform 0.22s cubic-bezier(.4,0,.2,1), width 0.22s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
  z-index: 0;
}

/* Individual segment label */
.content-slider__seg {
  flex: 1;
  text-align: center;
  padding: 0.45rem 0.25rem;
  font: var(--font-small);
  font-weight: 500;
  color: var(--text-2);
  border-radius: calc(var(--radius-xl) - 3px);
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.content-slider__seg.active { color: var(--text); font-weight: 600; }


/* ── Stats carousel (home page) ──
   Wraps all four stat pages side by side. Overflow is hidden
   so only the active page is visible. The belt slides via
   transform — no JS width calculations needed.              */
.stats-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;       /* clips the carousel belt at rounded corners */
  margin-bottom: 0.75rem;
}

/* Slider sits inside the panel — give it internal padding */
.stats-panel .content-slider {
  margin: 0.75rem 0.75rem 0.75rem;
}

.stats-carousel {
  overflow: hidden;
  padding: 1rem;
  border-top: 1px solid var(--border);
}

.stats-carousel__belt {
  display: flex;
  /* Each page is exactly one carousel width wide */
  will-change: transform;
}

.stats-carousel__page {
  min-width: 100%;
  /* Prevents pages from collapsing if content is short */
  box-sizing: border-box;
  margin-right: 1rem;
}


/* ── Goal / task list items ── */
.goal-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  margin-bottom: 0.625rem;
}

.goal-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.goal-item__text {
  flex: 1;
  font: var(--font-body);
  color: var(--text);
  transition: color var(--ease);
}

.goal-item.done .goal-item__text {
  text-decoration: line-through;
  color: var(--text-3);
}


/* ── Tabs (within a page section) ── */
.tab-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.tab-btn {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem;
  font: var(--font-small);
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background var(--ease);
  width: auto;
  transform: none;
}

.tab-btn:active { transform: none; }
.tab-btn.active { background: var(--cyan); border-color: transparent; }


/* ════════════════════════════════════════════════════════════
   10. OVERLAYS
   Modals and floating action buttons.
   ════════════════════════════════════════════════════════════ */

/* Modal backdrop */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.open { display: flex; }

/* Modal panel */
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: 90%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.modal__actions {
  display: flex;
  gap: 0.5rem;
}
.modal__actions button { flex: 1; }

/* ════════════════════════════════════════════════════════════
   11. UTILITY CLASSES
   Single-purpose helpers. Use sparingly — prefer named
   component classes above for anything more than one-offs.
   ════════════════════════════════════════════════════════════ */

.text-muted    { color: var(--text-2); }
.text-hint     { color: var(--text-3); font: var(--font-small); }
.text-center   { text-align: center; }
.text-success  { color: var(--success); }
.text-danger   { color: var(--danger); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.empty-state {
  color: var(--text-3);
  font: var(--font-small);
  text-align: center;
  margin-top: 3rem;
}
