/* Martin Farmstead Garden — styles */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: #0d1117;
  color: #e6edf3;
  -webkit-font-smoothing: antialiased;
}
a { color: #4ade80; text-decoration: none; }

/* ── Layout ────────────────────────────────────────────────────────── */
.app-layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  background: #161b22;
  border-right: 1px solid #21262d;
  padding: 16px 12px;
  display: flex; flex-direction: column; gap: 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.brand-icon { font-size: 28px; }
.brand-text { font-weight: 800; font-size: 14px; }
.brand-sub { font-size: 12px; color: #8b949e; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-section-label {
  font-size: 11px; text-transform: uppercase; color: #8b949e;
  padding: 8px 10px 4px; letter-spacing: 0.5px;
}
.nav-divider { height: 1px; background: #21262d; margin: 8px 4px; }
.nav-item {
  background: transparent; border: none; color: #c9d1d9;
  text-align: left; padding: 9px 10px; border-radius: 6px;
  font-size: 14px; cursor: pointer; display: flex; align-items: center; gap: 10px;
  transition: background 0.12s;
}
.nav-item:hover { background: #21262d; }
.nav-item.active { background: #1f3a2a; color: #4ade80; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.main-content { display: flex; flex-direction: column; }

.header {
  position: sticky; top: 0; z-index: 5;
  background: #0d1117; border-bottom: 1px solid #21262d;
  padding: 12px 20px; display: flex; align-items: center; gap: 12px;
}
.hamburger { display: none; background: none; border: none; color: #c9d1d9; font-size: 22px; cursor: pointer; }
.header-title { font-size: 18px; font-weight: 700; flex: 1; }
.header-weather { font-size: 13px; color: #8b949e; }

.view { display: none; padding: 20px; }
.view.active { display: block; }
.view-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.view-header h2 { margin: 0; font-size: 22px; }

.section-title { font-size: 16px; font-weight: 700; margin: 20px 0 10px; color: #c9d1d9; }
.muted { color: #8b949e; font-size: 14px; }

/* ── Cards ─────────────────────────────────────────────────────────── */
.card {
  background: #161b22; border: 1px solid #21262d; border-radius: 10px;
  padding: 16px; margin-bottom: 12px;
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.grid { display: grid; gap: 12px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.stat-card { text-align: center; padding: 18px; }
.stat-num { font-size: 32px; font-weight: 800; color: #4ade80; }
.stat-label { font-size: 12px; color: #8b949e; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }

/* ── Buttons / inputs ──────────────────────────────────────────────── */
.btn {
  background: #21262d; color: #c9d1d9; border: 1px solid #30363d;
  padding: 8px 14px; border-radius: 6px; cursor: pointer; font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.12s;
}
.btn:hover { background: #30363d; }
.btn-primary { background: #16a34a; color: white; border-color: #15803d; }
.btn-primary:hover { background: #15803d; }
.btn-danger { background: #dc2626; color: white; border-color: #b91c1c; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

input, select, textarea {
  background: #0d1117; color: #e6edf3; border: 1px solid #30363d;
  padding: 8px 10px; border-radius: 6px; font-size: 14px;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #16a34a; }
input[type="file"] { padding: 6px; }

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field > span { font-size: 12px; color: #8b949e; text-transform: uppercase; letter-spacing: 0.4px; }
.field > input, .field > select, .field > textarea { width: 100%; }

.loading { color: #8b949e; padding: 12px; text-align: center; }

/* ── Category tabs / checks / cards ────────────────────────────────── */
.cat-tabs { display: inline-flex; gap: 4px; background: #161b22; border: 1px solid #21262d; padding: 4px; border-radius: 8px; }
.cat-tab {
  background: transparent; color: #c9d1d9; border: none; padding: 6px 10px;
  border-radius: 6px; cursor: pointer; font-size: 13px; font-family: inherit;
}
.cat-tab:hover { background: #21262d; }
.cat-tab.active { background: #1f3a2a; color: #4ade80; }

.cat-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-check {
  display: inline-flex; align-items: center; gap: 6px;
  background: #0d1117; border: 1px solid #30363d; padding: 6px 10px;
  border-radius: 999px; font-size: 13px; cursor: pointer; user-select: none;
}
.cat-check input { accent-color: #16a34a; }
.cat-check:has(input:checked) { background: #1f3a2a; border-color: #16a34a; color: #4ade80; }

.cat-card.cat-herb   .stat-num { color: #4ade80; }
.cat-card.cat-flower .stat-num { color: #f472b6; }
.cat-card.cat-veg    .stat-num { color: #fbbf24; }

.badge-herb   { background: #1f3a2a; color: #4ade80; }
.badge-flower { background: #3a1f2e; color: #f472b6; }
.badge-veg    { background: #3a2f1f; color: #fbbf24; }

/* ── Plant / Garden cards ──────────────────────────────────────────── */
.plant-card, .garden-card {
  background: #161b22; border: 1px solid #21262d; border-radius: 10px;
  padding: 14px; display: flex; flex-direction: column; gap: 6px;
}
.plant-card h3, .garden-card h3 { margin: 0; font-size: 16px; color: #e6edf3; }
.plant-meta { font-size: 12px; color: #8b949e; }
.plant-photo { width: 100%; height: 140px; object-fit: cover; border-radius: 8px; margin-bottom: 8px; background: #0d1117; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; background: #1f3a2a; color: #4ade80;
}
.badge-warn { background: #3a2a1f; color: #fbbf24; }
.badge-danger { background: #3a1f1f; color: #f87171; }

/* ── Watering suggestion rows ──────────────────────────────────────── */
.suggest-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid #21262d;
}
.suggest-row:last-child { border-bottom: none; }
.suggest-rec { font-weight: 700; min-width: 80px; }
.suggest-rec.water { color: #38bdf8; }
.suggest-rec.wait { color: #fbbf24; }
.suggest-rec.skip { color: #8b949e; }

/* ── Modal ────────────────────────────────────────────────────────── */
.modal {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  z-index: 100; align-items: center; justify-content: center; padding: 16px;
}
.modal.open { display: flex; }
.modal-content {
  background: #161b22; border: 1px solid #21262d; border-radius: 12px;
  padding: 20px; max-width: 500px; width: 100%; max-height: 90vh; overflow-y: auto;
}
.modal-content h3 { margin: 0 0 12px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

/* ── AI result panels ─────────────────────────────────────────────── */
.result-box {
  background: #161b22; border: 1px solid #21262d; border-radius: 10px;
  padding: 16px; margin-top: 16px;
}
.result-box h3 { margin: 0 0 8px; color: #4ade80; }
.result-box .preview-img { max-width: 100%; max-height: 240px; border-radius: 8px; margin-bottom: 12px; }
.result-list { padding-left: 20px; margin: 8px 0; }
.result-list li { margin-bottom: 6px; }

/* ── Garden map SVG ───────────────────────────────────────────────── */
.garden-map-svg {
  width: 100%; max-width: 700px; aspect-ratio: 1 / 1;
  background: #1f3a2a22; border: 1px solid #21262d; border-radius: 10px;
}

/* ── Mobile ───────────────────────────────────────────────────────── */
.sidebar-overlay { display: none; }
@media (max-width: 800px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: -260px; top: 0; bottom: 0; width: 240px;
    transition: left 0.2s; z-index: 50;
  }
  .sidebar.open { left: 0; }
  .sidebar-overlay {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    z-index: 40; opacity: 0; pointer-events: none; transition: opacity 0.2s;
  }
  .sidebar-overlay.open { opacity: 1; pointer-events: auto; }
  .hamburger { display: block; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
