/* Neighborhood Tree Health Journal Styles */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f8f9fa;
}

header {
  background: #2e7d32;
  color: white;
  padding: 1rem;
  text-align: center;
}

header h1 { margin: 0.25rem 0 0.5rem; font-size: 1.5rem; }

header .tagline { margin: 0; font-size: 0.9rem; opacity: 0.9; }

nav { margin-top: 0.5rem; }

nav button {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 0.5rem 1rem;
  margin: 0 0.25rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}

nav button:hover { background: rgba(255,255,255,0.3); }

nav button[aria-expanded="false"] { background: #4caf50; }

main { max-width: 800px; margin: 0 auto; padding: 1rem; }

aside { max-width: 300px; margin: 1rem 0 1rem; }

aside h3 { font-size: 1rem; margin-top: 0; color: #2e7d32; }

aside ul { padding-left: 1.2rem; }

aside li { margin-bottom: 0.4rem; }

section { margin-bottom: 1.5rem; }

section h2 { font-size: 1.25rem; color: #1b5e20; margin-top: 0; }

section h3 { font-size: 1rem; color: #388e3c; }

form {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

fieldset {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}

legend {
  font-weight: 600;
  padding: 0 0.5rem;
}

label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  color: #424242;
}

input[type="text"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  margin-bottom: 1rem;
}

textarea {
  resize: vertical;
}

#symptom-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.symptom-tag {
  background: #e8f5e9;
  border: 1px solid #c8e6c9;
  color: #2e7d32;
  padding: 0.4rem 0.75rem;
  border-radius: 16px;
  cursor: pointer;
  font-size: 0.8rem;
}

.symptom-tag:hover {
  background: #c8e6c9;
}

.symptom-tag.selected {
  background: #2e7d32;
  color: white;
}

.photo-upload {
  margin: 1rem 0;
}

.photo-preview {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

#preview-img { max-height: 80px; border-radius: 4px; }

.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.primary {
  background: #2e7d32;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}

.primary:hover { background: #1b5e20; }

.secondary {
  background: #f5f5f5;
  color: #424242;
  border: 1px solid #ddd;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
}

.secondary:hover { background: #e0e0e0; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-card h3 { margin: 0 0 0.25rem; font-size: 0.9rem; color: #666; }

.stat-card p { margin: 0; font-size: 1.5rem; font-weight: 600; color: #2e7d32; }

#entries-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

#entries-table th,
#entries-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

#entries-table th { background: #f5f5f5; font-weight: 600; }

.empty-state {
  text-align: center;
  padding: 2rem;
  color: #757575;
  font-style: italic;
}

.chart-controls {
  margin-bottom: 1rem;
}

.chart-controls button {
  padding: 0.5rem 1rem;
  margin-right: 0.25rem;
  border-radius: 4px;
  border: 1px solid #ddd;
  background: white;
  cursor: pointer;
}

.chart-controls button.active { background: #2e7d32; color: white; border-color: #2e7d32; }

.chart-container {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-placeholder {
  color: #757575;
  text-align: center;
  margin: 0;
}

footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.85rem;
  color: #666;
  border-top: 1px solid #e0e0e0;
  margin-top: 2rem;
}

footer a { color: #2e7d32; text-decoration: none; }

footer a:hover { text-decoration: underline; }

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  main { padding: 1.5rem; }
}

@media (min-width: 900px) {
  body { display: flex; gap: 2rem; padding: 1rem; }

  main { flex: 1; max-width: none; }

  aside { flex: 0 0 280px; position: sticky; top: 1rem; height: fit-content; }

  #entries-table {
    display: block; overflow-x: auto;
  }
}


/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
