/* ===============================
   WeedTracker V60 Pilot Final
   =============================== */

/* GENERAL RESET */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body.theme-dark {
  background: #222;
  color: #eee;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

/* HEADERS */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #333;
  color: #fff;
  padding: 0.8rem 1.2rem;
  border-bottom: 2px solid #4caf50;
  position: sticky;
  top: 0;
  z-index: 10;
}
.app-header h1 {
  font-size: 1.1rem;
  font-weight: 600;
}
.icon-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: #fff;
}

/* MAIN LAYOUT */
.screen {
  display: none;
  padding: 1rem;
  max-width: 900px;
  margin: auto;
}
.screen.active {
  display: block;
}

.card {
  background: #2f2f2f;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
}
.card.soft {
  background: #303030;
}
.card h2, .card h3 {
  margin-bottom: 0.5rem;
}

/* FORM ELEMENTS */
label {
  display: block;
  margin-bottom: 0.6rem;
}
label input, label select, label textarea {
  width: 100%;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #555;
  background: #1c1c1c;
  color: #eee;
  font-size: 0.95rem;
}
label textarea {
  resize: vertical;
}
label input:focus, label select:focus, label textarea:focus {
  border-color: #4caf50;
  outline: none;
}

/* ROW / FLEX UTILITIES */
.row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.row.between {
  justify-content: space-between;
}
.row.end {
  justify-content: flex-end;
}
.row.gap {
  gap: 1rem;
}
.grow {
  flex: 1;
}
.grid4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

/* BUTTONS */
.btn, .menu-btn, .pill {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  transition: 0.2s;
}

.btn.primary, .menu-btn.green { background: #4caf50; color: #fff; }
.btn.secondary, .menu-btn.blue { background: #2196f3; color: #fff; }
.btn.danger, .menu-btn.gray { background: #f44336; color: #fff; }
.menu-btn.aqua { background: #009688; color: #fff; }
.menu-btn.lime { background: #8bc34a; color: #000; }
.menu-btn.purple { background: #673ab7; color: #fff; }
.menu-btn.slate { background: #607d8b; color: #fff; }

.btn:hover, .menu-btn:hover, .pill:hover {
  opacity: 0.9;
}

/* PILLS */
.pill {
  background: #444;
  color: #eee;
  padding: 0.4rem 0.8rem;
  border: 1px solid #555;
  font-size: 0.85rem;
}
.pill.warn {
  background: #b71c1c;
}
.pill.muted {
  background: #333;
  color: #aaa;
}

/* MENUS */
.menu {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 1rem;
}
.menu-btn {
  font-size: 1.1rem;
  padding: 1rem;
  text-align: center;
  border-radius: 10px;
}

/* FILTERS */
.filters {
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 0.8rem;
  margin: 0.5rem 0;
}
.input {
  background: #1c1c1c;
  color: #eee;
  border: 1px solid #555;
  padding: 0.5rem;
  border-radius: 6px;
  width: 100%;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0;
}
.chip {
  background: #444;
  color: #eee;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
}
.chip input {
  margin-right: 0.3rem;
}

/* LISTS */
.list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.list-item {
  background: #2f2f2f;
  padding: 0.8rem;
  border: 1px solid #444;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.list-item:hover {
  border-color: #4caf50;
}

/* MAP */
.map {
  height: 70vh;
  width: 100%;
  border: 1px solid #444;
  border-radius: 8px;
  margin-top: 1rem;
}

/* SPINNER & TOAST */
.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.spinner-overlay.hidden {
  display: none;
}
.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #666;
  border-top: 5px solid #4caf50;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.spinner-text {
  color: #fff;
  margin-top: 1rem;
  font-size: 1rem;
}
@keyframes spin {
  0% { transform: rotate(0); }
  100% { transform: rotate(360deg); }
}

/* TOAST */
#toastHost {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 200;
}
.toast {
  background: #333;
  color: #fff;
  border-radius: 6px;
  padding: 0.6rem 1rem;
  border: 1px solid #555;
  animation: fadeInOut 2.5s forwards;
}
@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(10px); }
  10%, 80% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}

/* RESPONSIVE */
@media (max-width: 600px) {
  .grid4 { grid-template-columns: repeat(2, 1fr); }
  .menu-btn { font-size: 1rem; padding: 0.8rem; }
}
