/* style.css — Density | חישוב צפיפות | lendover.co.il */
@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@300;400;500;600;700;800&display=swap');

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

:root {
  --copper:      #B8743D;
  --copper-dark: #9A5F2E;
  --copper-light:#F5E9DC;
  --teal:        #5BC8C4;
  --charcoal:    #3C3C3C;
  --text:        #2C2C2C;
  --text-muted:  #777777;
  --bg:          #F0EDE6;
  --bg-white:    #FFFFFF;
  --border:      #E2DDD6;
  --red:         #C0392B;
  --red-light:   #FEF0F0;
  --green:       #2E7D52;
  --radius:      4px;
  --shadow:      0 2px 12px rgba(0,0,0,0.08);
}

html { font-size: 16px; }

body {
  font-family: 'Heebo', 'Arial Hebrew', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  min-height: 100vh;
  padding-bottom: 48px;
}

/* ── Hero ────────────────────────────────── */
.hero {
  background: var(--charcoal);
  color: #fff;
  text-align: center;
  padding: 28px 24px 24px;
}
.hero h1 { font-size: 1.7rem; font-weight: 700; margin-bottom: 8px; }
.hero p  { font-size: 1rem; color: rgba(255,255,255,0.75); font-weight: 300; }

/* ── Container ───────────────────────────── */
.container { max-width: 880px; margin: 36px auto 0; padding: 0 16px; }

/* ── Section heading ─────────────────────── */
.section-title {
  font-size: 1.15rem; font-weight: 700; color: var(--charcoal);
  margin-bottom: 20px; padding-bottom: 10px; position: relative;
}
.section-title::after {
  content: ''; position: absolute; bottom: 0; right: 0;
  width: 40px; height: 2px; background: var(--copper);
}

/* ── Card ────────────────────────────────── */
.card {
  background: var(--bg-white);
  border-top: 3px solid var(--copper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 32px;
  margin-bottom: 20px;
}

/* ── Parcel rows ─────────────────────────── */
.parcel-row {
  display: grid;
  grid-template-columns: 1fr 1fr 36px;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group label { font-size: 0.85rem; font-weight: 600; color: var(--charcoal); }
.field-group input[type="text"] {
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Heebo', sans-serif;
  font-size: 1.05rem;
  color: var(--text);
  background: var(--bg-white);
  transition: border-color 0.2s;
  text-align: right;
}
.field-group input[type="text"]:focus { outline: none; border-color: var(--copper); }
.btn-remove-row {
  height: 42px; width: 36px;
  border: 1.5px solid var(--border);
  background: var(--bg-white);
  color: var(--text-muted);
  border-radius: var(--radius);
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}
.btn-remove-row:hover { background: var(--red-light); border-color: var(--red); color: var(--red); }

.row-actions {
  display: flex; justify-content: space-between; align-items: center;
  margin: 12px 0 20px; gap: 12px; flex-wrap: wrap;
}
.btn-secondary {
  background: transparent;
  border: 1.5px solid var(--copper);
  color: var(--copper);
  padding: 8px 18px;
  border-radius: var(--radius);
  font-family: 'Heebo', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover:not(:disabled) { background: var(--copper-light); }
.btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }
.rows-counter { font-size: 0.85rem; color: var(--text-muted); }

/* ── Submit button ───────────────────────── */
#lookup-btn {
  display: block; width: 100%;
  padding: 13px;
  background: var(--copper);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: 'Heebo', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  letter-spacing: 0.02em;
}
#lookup-btn:hover:not(:disabled) { background: var(--copper-dark); }
#lookup-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Spinner ─────────────────────────────── */
#spinner { display: none; text-align: center; padding: 18px 0 4px; }
#spinner .spin {
  display: inline-block; width: 36px; height: 36px;
  border: 3px solid var(--copper-light);
  border-top-color: var(--copper);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
#spinner p { margin-top: 10px; font-size: 0.88rem; color: var(--text-muted); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error box ───────────────────────────── */
#error-box {
  display: none;
  background: var(--red-light);
  border: 1px solid #F5BCBC;
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--red);
  font-size: 0.88rem;
  margin-top: 16px;
  font-weight: 600;
}

/* ── Not-found card ──────────────────────── */
#not-found-card { display: none; }
.not-found-msg { text-align: center; padding: 10px 0 16px; }
.not-found-icon { font-size: 2rem; display: block; margin-bottom: 10px; }
.not-found-msg p { color: var(--text-muted); font-size: 0.97rem; }

/* ── Result card ─────────────────────────── */
#result-card { display: none; }

/* Aggregate box */
#aggregate-box { display: none; margin-bottom: 20px; }
.agg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  background: var(--copper-light);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.agg-item { display: flex; flex-direction: column; gap: 4px; }
.agg-item label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}
.agg-item span {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--charcoal);
  line-height: 1.2;
}
.agg-item small { font-size: 0.7rem; color: var(--text-muted); margin-top: -2px; }
.agg-item.agg-highlight span { color: var(--copper-dark); font-size: 1.85rem; }
.agg-note {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--red);
  font-weight: 500;
  display: none;
}

/* Per-parcel table */
.table-wrap { overflow-x: auto; margin-bottom: 20px; }
#results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}
#results-table thead th {
  background: var(--charcoal);
  color: #fff;
  padding: 10px 12px;
  text-align: right;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}
#results-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  vertical-align: middle;
}
#results-table tbody tr:last-child td { border-bottom: none; }
#results-table tbody tr:nth-child(even) { background: #FAFAF7; }
.cell-locality { color: var(--text-muted); font-size: 0.86rem; max-width: 220px; }
.cell-zero { color: var(--text-muted); font-style: italic; }
.row-missing { background: var(--red-light) !important; }
.row-missing .missing-cell { color: var(--red); font-weight: 600; text-align: center; }

/* Map */
#map {
  height: 420px;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
.leaflet-popup-content { margin: 12px 16px; }

/* Reset button */
#reset-btn, #reset-btn-2 {
  display: block; width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: transparent;
  color: var(--copper);
  border: 1.5px solid var(--copper);
  border-radius: var(--radius);
  font-family: 'Heebo', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
#reset-btn:hover, #reset-btn-2:hover { background: var(--copper-light); }

/* Privacy */
.privacy-note { text-align: center; font-size: 0.78rem; color: var(--text-muted); margin-top: 8px; }

/* ── Responsive ──────────────────────────── */
@media (max-width: 640px) {
  nav { padding: 4px 12px; }
  .nav-app-logo { height: 52px; }
  .nav-site-logo { height: 30px; }
  .hero { padding: 24px 16px 22px; }
  .hero h1 { font-size: 1.35rem; }
  .card { padding: 20px 16px; }
  .parcel-row {
    grid-template-columns: 1fr 1fr 36px;
    gap: 8px;
  }
  .agg-grid { grid-template-columns: 1fr; gap: 8px; padding: 12px 14px; }
  .agg-item span { font-size: 1.3rem; }
  .agg-item.agg-highlight span { font-size: 1.5rem; }
  #map { height: 320px; }
  #results-table { font-size: 0.85rem; }
  #results-table thead th, #results-table tbody td { padding: 8px 6px; }
  .cell-locality { max-width: 120px; font-size: 0.78rem; }
}
