/* --- Base Styles --- */
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  background: linear-gradient(120deg, #e0ffe7 0%, #f0f7f4 100%);
  color: #222;
}

h1 {
  color: #11998e;
  text-align: center;
  margin-top: 2.5rem;
  letter-spacing: 1px;
  font-weight: 800;
  font-size: 2.2rem;
  text-shadow: 0 2px 12px #b2f7ef44;
}

form,
.charts,
.conclusion {
  background: #fff;
  padding: 2rem 2.5rem 1.5rem 2.5rem;
  border-radius: 18px;
  margin: 2rem auto 2rem auto;
  box-shadow: 0 2px 16px rgba(17,153,142,0.08);
  max-width: 900px;
}

label {
  font-weight: 600;
  margin-bottom: 0.3em;
  color: #11998e;
  display: block;
}

select {
  padding: 0.6em 1em;
  border-radius: 8px;
  border: 1.5px solid #b2dfdb;
  font-size: 1.08em;
  background: #f0fdfa;
  margin-top: 0.2em;
  width: 100%;
  transition: border 0.2s;
}
select:focus {
  border: 1.5px solid #11998e;
  outline: none;
}

button[type="submit"] {
  background: linear-gradient(90deg, #11998e 0%, #38ef7d 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.8em 2.2em;
  font-size: 1.15em;
  font-weight: 700;
  cursor: pointer;
  margin-top: 1.2em;
  box-shadow: 0 2px 8px rgba(17,153,142,0.08);
  transition: background 0.2s, transform 0.2s;
  letter-spacing: 0.5px;
}
button[type="submit"]:hover {
  background: linear-gradient(90deg, #38ef7d 0%, #11998e 100%);
  transform: translateY(-2px) scale(1.03);
}

#plantRadioDiv {
  margin: 1em 0 1.2em 0;
  padding: 1em 1.2em;
  background: #e0f7fa;
  border-radius: 10px;
  display: flex;
  gap: 2em;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: 0 1px 8px #b2f7ef33;
  border: 1.5px solid #b2f7ef;
}
#plantRadioDiv label {
  font-weight: 500;
  margin: 0;
  color: #11998e;
  display: flex;
  align-items: center;
  gap: 0.4em;
}
#plantRadioDiv input[type="radio"] {
  accent-color: #11998e;
  width: 1.15em;
  height: 1.15em;
  margin-right: 0.3em;
}
#plantRadioDiv label span {
  font-size: 1.08em;
  font-weight: 500;
  color: #222;
}

.soil-info-card {
  background: #f4fff4;
  border: 2px solid #4caf50;
  border-radius: 12px;
  padding: 18px 22px;
  margin: 18px 0 10px 0;
  box-shadow: 0 2px 12px rgba(76, 175, 80, 0.08);
  font-size: 1.08em;
  transition: all 0.3s;
}
.soil-info-card h3 {
  margin-top: 0;
  color: #388e3c;
}
.soil-info-card ul {
  margin: 0 0 8px 0;
  padding-left: 20px;
}
.soil-info-card .suitable {
  margin-top: 8px;
  font-weight: 500;
  color: #2e7d32;
}

/* --- Charts --- */
.charts {
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
  max-width: 1300px;
  /* Make charts area wider */
}
.chart-group-title {
  color: #11998e;
  margin-bottom: 0.5em;
  margin-top: 1.5em;
  font-size: 1.2em;
  letter-spacing: 0.5px;
  font-weight: 700;
  border-left: 5px solid #43e97b;
  padding-left: 0.7rem;
  background: #e0ffe7;
  border-radius: 7px;
  box-shadow: 0 1px 6px #b2f7ef33;
}
.all-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 2.2em 2em;
  /* More gap for clarity */
  align-items: stretch;
}
.chart-section {
  background: #f0fdfa;
  border-radius: 18px;
  padding: 1.5em 1.5em 1em 1.5em;
  box-shadow: 0 8px 32px 0 rgba(34, 139, 34, 0.18),
    0 1.5px 8px 0 rgba(0, 0, 0, 0.09);
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 380px;
  /* Make each chart box taller */
  transition: box-shadow 0.3s, transform 0.3s;
}
.chart-section h3 {
  font-size: 1.13em;
  color: #11998e;
  margin-bottom: 0.7em;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.chart-container {
  min-height: 320px;
  width: 88%;
  max-width: 700px;
  margin: 0 auto 1.5rem auto;
  background: linear-gradient(135deg, #e0ffe7 0%, #f0f7f4 100%);
  border-radius: 22px;
  box-shadow: 0 12px 40px 0 rgba(34, 139, 34, 0.22),
    0 3px 12px 0 rgba(0, 0, 0, 0.12);
  padding: 2.2rem 1.7rem;
  transition: box-shadow 0.3s, transform 0.3s;
  border: 1.5px solid #b2f7ef;
  perspective: 800px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chart-container:hover {
  box-shadow: 0 20px 60px 0 rgba(34, 139, 34, 0.28),
    0 6px 18px 0 rgba(0, 0, 0, 0.16);
  transform: translateY(-6px) scale(1.025);
}
canvas {
  max-width: 100%;
  filter: drop-shadow(0 8px 24px rgba(34, 139, 34, 0.22));
  background: transparent;
  border-radius: 18px;
  transition: box-shadow 0.4s;
}

/* --- Conclusion Card --- */
.conclusion {
  background: #e9f5f2;
  padding: 1rem;
  border-radius: 14px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.08);
  max-width: 900px;
}
.conclusion-card {
  background: linear-gradient(120deg, #e0ffe7 0%, #f0f7f4 100%);
  border-radius: 18px;
  box-shadow: 0 6px 32px rgba(34,139,34,0.13);
  border: 2px solid #b2f7ef;
  padding: 2.2rem 2rem 1.7rem 2rem;
  margin: 2rem 0 1.5rem 0;
  font-size: 1.12rem;
  transition: box-shadow 0.3s;
}
.conclusion-card:hover {
  box-shadow: 0 12px 48px rgba(34,139,34,0.18);
}
.conclusion-card h3 {
  color: #11998e;
  margin-top: 1.5rem;
  margin-bottom: 0.7rem;
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: 0.7px;
  display: flex;
  align-items: center;
  gap: 0.5em;
}
.conclusion-card h3::before {
  content: "•";
  color: #43e97b;
  font-size: 1.5em;
  margin-right: 0.3em;
}
.conclusion-card ul {
  margin: 0 0 0.7rem 1.2rem;
  padding-left: 1.2rem;
  margin-bottom: 1.1rem;
}
.conclusion-card li {
  margin-bottom: 0.4rem;
  line-height: 1.6;
}
.conclusion-card .highlight {
  color: #fff;
  background: linear-gradient(90deg, #43e97b 0%, #38f9d7 100%);
  font-weight: 700;
  padding: 0.13em 0.55em;
  border-radius: 7px;
  box-shadow: 0 1px 6px #b2f7ef44;
  font-size: 1.02em;
}
.conclusion-card .soil-list {
  margin: 0.2em 0 0.2em 0.5em;
  padding-left: 1.2em;
  font-size: 0.98em;
}
.conclusion-card a {
  color: #11998e;
  text-decoration: underline;
  font-weight: 500;
}
.conclusion-card a:hover {
  color: #43e97b;
  text-decoration: none;
}
.conclusion-note {
  margin-top: 1.2rem;
  background: #e0ffe7;
  border-left: 4px solid #11998e;
  padding: 0.7em 1em;
  border-radius: 7px;
  font-size: 1.04em;
  color: #2f4f4f;
}

/* --- Enhanced Data/Info Cards --- */
.info-card,
.aqi-card,
.weather-card {
  background: linear-gradient(120deg, #f0fdfa 0%, #e0ffe7 100%);
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(17,153,142,0.10);
  border: 1.5px solid #b2f7ef;
  padding: 1.3rem 1.5rem 1.1rem 1.5rem;
  margin: 1.5rem 0 1.2rem 0;
  font-size: 1.08rem;
  transition: box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  gap: 0.7em;
}
.info-card h3,
.aqi-card h3,
.weather-card h3 {
  color: #11998e;
  margin-top: 0;
  margin-bottom: 0.5em;
  font-size: 1.13rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.4em;
}
.info-card ul,
.aqi-card ul,
.weather-card ul {
  margin: 0 0 0.5em 1.2em;
  padding-left: 1.2em;
  font-size: 1em;
}
.info-card li,
.aqi-card li,
.weather-card li {
  margin-bottom: 0.3em;
  line-height: 1.5;
}
.info-card .highlight,
.aqi-card .highlight,
.weather-card .highlight {
  color: #fff;
  background: linear-gradient(90deg, #43e97b 0%, #38f9d7 100%);
  font-weight: 700;
  padding: 0.13em 0.55em;
  border-radius: 7px;
  box-shadow: 0 1px 6px #b2f7ef44;
  font-size: 1.02em;
}
.info-card .subtitle,
.aqi-card .subtitle,
.weather-card .subtitle {
  color: #388e3c;
  font-size: 0.97em;
  margin-bottom: 0.2em;
  font-weight: 500;
}
.info-card .stat-row {
  display: flex;
  gap: 2em;
  margin-bottom: 0.7em;
  flex-wrap: wrap;
}
.info-card .stat {
  background: #e0ffe7;
  border-radius: 8px;
  padding: 0.6em 1.2em;
  font-size: 1.07em;
  color: #11998e;
  font-weight: 600;
  box-shadow: 0 1px 6px #b2f7ef33;
  margin-bottom: 0.3em;
}
.info-card .stat-label {
  color: #2e7d32;
  font-size: 0.97em;
  font-weight: 500;
  margin-right: 0.4em;
}
.info-card .trend-up {
  color: #43e97b;
  font-weight: 700;
  margin-left: 0.3em;
}
.info-card .trend-down {
  color: #ff512f;
  font-weight: 700;
  margin-left: 0.3em;
}
.info-card .trend-neutral {
  color: #888;
  font-weight: 700;
  margin-left: 0.3em;
}
.info-card .divider {
  border-top: 1.5px dashed #b2f7ef;
  margin: 1em 0;
}

/* --- Deep Data Table: Modern, Card-like, Fully Responsive --- */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 2em 0 2em 0;
  font-size: 1.07em;
  background: #f0fdfa;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 32px 0 rgba(34, 139, 34, 0.13),
    0 1.5px 8px 0 rgba(0, 0, 0, 0.09);
  display: none;
  transition: box-shadow 0.3s, max-height 0.3s;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}
.data-table.show-table {
  display: table;
  animation: fadeInTable 0.6s;
}
@keyframes fadeInTable {
  from { opacity: 0; transform: translateY(30px);}
  to { opacity: 1; transform: translateY(0);}
}
.data-table th,
.data-table td {
  padding: 1em 1.2em;
  text-align: left;
  word-break: break-word;
  border-bottom: 1.5px solid #e0ffe7;
}
.data-table th {
  background: #e0ffe7;
  color: #11998e;
  font-weight: 700;
  border-bottom: 2.5px solid #b2f7ef;
  font-size: 1.08em;
  letter-spacing: 0.5px;
}
.data-table tr:last-child td {
  border-bottom: none;
}
.data-table tr:nth-child(even) {
  background: #f7fafc;
}
.data-table tr:hover {
  background: #e0ffe7;
  transition: background 0.2s;
}
.data-table .trend-up {
  color: #43e97b;
  font-weight: 700;
}
.data-table .trend-down {
  color: #ff512f;
  font-weight: 700;
}
.data-table .trend-neutral {
  color: #888;
  font-weight: 700;
}

/* --- Table Caption for Section Title (optional) --- */
.data-table caption {
  caption-side: top;
  text-align: left;
  font-size: 1.18em;
  color: #11998e;
  font-weight: 700;
  padding: 1em 1.2em 0.5em 1.2em;
  background: #e0ffe7;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  letter-spacing: 0.5px;
}

/* --- Responsive Table --- */
@media (max-width: 1100px) {
  .data-table {
    max-width: 99vw;
    font-size: 1em;
  }
}
@media (max-width: 700px) {
  .data-table, .data-table thead, .data-table tbody, .data-table th, .data-table td, .data-table tr {
    display: block;
    width: 100%;
  }
  .data-table {
    box-shadow: 0 2px 12px #b2f7ef33;
    border-radius: 14px;
    margin: 1.2em 0 1.2em 0;
    font-size: 0.98em;
    padding: 0;
  }
  .data-table thead {
    display: none;
  }
  .data-table tr {
    margin-bottom: 1.2em;
    background: #f0fdfa;
    border-radius: 10px;
    box-shadow: 0 1px 6px #b2f7ef33;
    padding: 0.7em 0.5em;
    border: 1.5px solid #e0ffe7;
  }
  .data-table td {
    padding: 0.7em 1em;
    text-align: left;
    position: relative;
    font-size: 1em;
    border-bottom: 1px solid #e0ffe7;
    background: none;
  }
  .data-table td:before {
    content: attr(data-label);
    font-weight: 700;
    color: #11998e;
    display: block;
    margin-bottom: 0.2em;
    font-size: 0.97em;
  }
  .data-table tr:last-child td {
    border-bottom: none;
  }
}

/* --- Section Titles --- */
.section-title {
  font-size: 1.35em;
  color: #11998e;
  font-weight: 800;
  margin-top: 2.2em;
  margin-bottom: 1em;
  letter-spacing: 0.7px;
  border-left: 6px solid #43e97b;
  padding-left: 0.8em;
  background: #e0ffe7;
  border-radius: 8px;
  box-shadow: 0 1px 6px #b2f7ef33;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  form, .charts, .conclusion {
    padding: 1.2rem 0.7rem 1rem 0.7rem;
    font-size: 1em;
  }
  .all-charts-grid {
    grid-template-columns: 1fr;
  }
  .info-card, .aqi-card, .weather-card {
    padding: 1rem 0.7rem 0.7rem 0.7rem;
    font-size: 1em;
  }
  .data-table th, .data-table td {
    padding: 0.5em 0.5em;
    font-size: 0.98em;
  }
}
@media (max-width: 600px) {
  .conclusion-card {
    padding: 1.2rem 0.7rem 1rem 0.7rem;
    font-size: 1em;
  }
  .conclusion-card h3 {
    font-size: 1.05rem;
  }
  .chart-container {
    padding: 1rem 0.5rem;
  }
  .info-card, .aqi-card, .weather-card {
    padding: 0.7rem 0.3rem 0.5rem 0.3rem;
    font-size: 0.97em;
  }
  .data-table th, .data-table td {
    padding: 0.3em 0.3em;
    font-size: 0.97em;
  }
}
@media (max-width: 1200px) {
  .charts {
    max-width: 98vw;
    padding: 1.2rem 0.7rem 1rem 0.7rem;
  }
  .all-charts-grid {
    grid-template-columns: 1fr;
  }
  .chart-container {
    max-width: 98vw;
    padding: 1.2rem 0.5rem;
  }
}
@media (max-width: 700px) {
  .chart-container {
    min-height: 220px;
    padding: 0.7rem 0.2rem;
  }
  .chart-section {
    min-height: 220px;
    padding: 0.7em 0.5em 0.5em 0.5em;
  }
  .data-table, .data-table thead, .data-table tbody, .data-table th, .data-table td, .data-table tr {
    display: block;
    width: 100%;
  }
  .data-table thead {
    display: none;
  }
  .data-table tr {
    margin-bottom: 1.2em;
    background: #f0fdfa;
    border-radius: 8px;
    box-shadow: 0 1px 6px #b2f7ef33;
    padding: 0.7em 0.5em;
  }
  .data-table td {
    padding: 0.6em 1em;
    text-align: left;
    position: relative;
    font-size: 1em;
    border-bottom: 1px solid #e0ffe7;
  }
  .data-table td:before {
    content: attr(data-label);
    font-weight: 700;
    color: #11998e;
    display: block;
    margin-bottom: 0.2em;
    font-size: 0.97em;
  }
}
