/* ================================================
   AgroPulse — Smart Crop Moisture Detection System
   style.css — Complete Updated Stylesheet
================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --bg:       #0a0f0a;
  --bg2:      #0f1a0f;
  --bg3:      #151f15;
  --surface:  #1a261a;
  --surface2: #1f2e1f;
  --border:   rgba(120, 180, 80, 0.15);
  --border2:  rgba(120, 180, 80, 0.08);

  --accent-green: #7ec850;
  --accent-lime:  #b5e853;
  --accent-teal:  #4ecdc4;
  --accent-amber: #f5a623;
  --accent-red:   #e05555;
  --accent-blue:  #4a90d9;

  --text-primary:   #e8f4e8;
  --text-secondary: #8aab7a;
  --text-muted:     #4a6040;

  --track: rgba(255, 255, 255, 0.07);

  --font-display: 'Playfair Display', Georgia, serif;
  --font-mono:    'Space Mono', monospace;
  --font-body:    'DM Sans', system-ui, sans-serif;

  --radius:    16px;
  --radius-sm: 10px;
  --shadow:      0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4),
                 0 1px 0 rgba(126, 200, 80, 0.08) inset;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ---------- Ambient Background ---------- */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
  animation: drift 18s ease-in-out infinite alternate;
}

.blob-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #2d5a1e, transparent);
  top: -200px; left: -200px;
  animation-duration: 20s;
}
.blob-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #1a4a3a, transparent);
  top: 40%; right: -150px;
  animation-duration: 24s;
  animation-delay: -8s;
}
.blob-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #3a5a10, transparent);
  bottom: -100px; left: 40%;
  animation-duration: 16s;
  animation-delay: -4s;
}

.grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.04;
}

@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, 40px) scale(1.15); }
}

/* ---------- Navigation ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 64px;
  background: rgba(10, 15, 10, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border2);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent-lime);
  letter-spacing: -0.02em;
}

.logo-icon { font-size: 1.3rem; }

.nav-links {
  display: flex;
  list-style: none;
  gap: 32px;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--accent-lime); }

.nav-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-green);
}

.status-text {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
  animation: pulse-dot 2s ease-in-out infinite;
  transition: background 0.4s, box-shadow 0.4s;
}

/* ✅ Red dot when Java backend is offline */
.status-dot.offline {
  background: var(--accent-red);
  box-shadow: 0 0 10px var(--accent-red);
  animation: none;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.85); }
}

/* ---------- Hero Section ---------- */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 100px 80px 60px;
  gap: 80px;
}

.hero-content { flex: 1; max-width: 560px; }

.hero-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-teal);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid rgba(78, 205, 196, 0.3);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 28px;
  background: rgba(78, 205, 196, 0.06);
  animation: fadeUp 0.8s var(--ease) both;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 5.5vw, 5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  animation: fadeUp 0.8s 0.1s var(--ease) both;
}

.hero-title em {
  font-style: italic;
  background: linear-gradient(135deg, var(--accent-lime), var(--accent-teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 40px;
  animation: fadeUp 0.8s 0.2s var(--ease) both;
}

.hero-actions {
  display: flex;
  gap: 16px;
  animation: fadeUp 0.8s 0.3s var(--ease) both;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-lime);
  color: #0a0f0a;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 14px 32px;
  border-radius: 100px;
  text-decoration: none;
  transition: all 0.25s var(--ease);
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  background: #c8f560;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(181, 232, 83, 0.35);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 14px 28px;
  border-radius: 100px;
  text-decoration: none;
  border: 1px solid var(--border);
  transition: all 0.25s;
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: rgba(120, 180, 80, 0.4);
  background: rgba(120, 180, 80, 0.06);
}

/* ---------- Hero Visual ---------- */
.hero-visual {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeUp 0.8s 0.4s var(--ease) both;
}

.soil-ring {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.soil-ring.outer {
  width: 340px; height: 340px;
  border: 1px solid rgba(126, 200, 80, 0.12);
  background: radial-gradient(circle, rgba(126,200,80,0.04) 0%, transparent 70%);
  animation: spin-slow 25s linear infinite;
}

.soil-ring.middle {
  width: 260px; height: 260px;
  border: 1px solid rgba(78, 205, 196, 0.15);
  background: radial-gradient(circle, rgba(78,205,196,0.05) 0%, transparent 70%);
  animation: spin-slow 18s linear infinite reverse;
}

.soil-ring.inner {
  width: 180px; height: 180px;
  border: 1px solid rgba(181, 232, 83, 0.25);
  background: var(--surface);
}

.soil-core {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.core-icon  { font-size: 1.8rem; }

.core-value {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent-lime);
}

.core-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ring-label {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ring-label.top    { top: 10px; }
.ring-label.bottom { bottom: 10px; }

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ---------- Stats Bar ---------- */
.stats-bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--surface);
  border-top: 1px solid var(--border2);
  border-bottom: 1px solid var(--border2);
  padding: 28px 80px;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 48px;
}

.stat-num {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-lime);
}

.stat-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stat-divider {
  width: 1px;
  height: 48px;
  background: var(--border);
}

/* ---------- Sections ---------- */
.section {
  position: relative;
  z-index: 1;
  padding: 100px 80px;
}

.dark-section {
  background: var(--bg2);
  border-top: 1px solid var(--border2);
  border-bottom: 1px solid var(--border2);
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-header.light .section-tag,
.section-header.light .section-sub  { color: var(--text-muted); }
.section-header.light .section-title { color: var(--text-primary); }

.section-tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-teal);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.section-sub {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.3s;
}

.card:hover { border-color: rgba(126, 200, 80, 0.25); }

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.card-icon { font-size: 1.3rem; }

.card-header h3 {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ---------- Analyzer Grid ---------- */
.analyzer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  align-items: start;
}

/* ---------- Upload Zone ---------- */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  background: rgba(126, 200, 80, 0.02);
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent-green);
  background: rgba(126, 200, 80, 0.06);
}

.upload-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.upload-text  { font-size: 0.95rem; color: var(--text-secondary); margin-bottom: 8px; }
.upload-link  { color: var(--accent-lime); cursor: pointer; text-decoration: underline; }
.upload-hint  { font-size: 0.78rem; color: var(--text-muted); }

.image-preview {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.image-preview canvas {
  width: 100%;
  height: 200px;
  display: block;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.btn-remove {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-remove:hover { background: var(--accent-red); }

.brightness-readout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.readout-label { color: var(--text-muted); }
.readout-value { color: var(--accent-lime); }

/* ---------- Form Elements ---------- */
.form-group { margin-bottom: 22px; }

.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.select-wrapper,
.input-wrapper { position: relative; }

select,
input[type="number"],
input[type="text"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 12px 16px;
  outline: none;
  appearance: none;
  transition: border-color 0.2s;
}

select:focus,
input[type="number"]:focus,
input[type="text"]:focus {
  border-color: var(--accent-green);
}

.select-wrapper::after {
  content: '▾';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.input-wrapper input { padding-right: 50px; }

.input-unit {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ---------- Soil Chips ---------- */
.soil-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  padding: 7px 16px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover { border-color: var(--accent-green); color: var(--text-primary); }

.chip.active {
  background: rgba(126, 200, 80, 0.15);
  border-color: var(--accent-green);
  color: var(--accent-lime);
}

/* ---------- ✅ Live Weather Box (inside Config card) ---------- */
.weather-live-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
  transition: border-color 0.4s, background 0.4s;
}

.weather-live-box.visible {
  border-color: rgba(78, 205, 196, 0.35);
  background: rgba(78, 205, 196, 0.04);
}

.wlb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.wlb-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.wlb-temp {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-amber);
}

.wlb-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-transform: capitalize;
  flex: 1;
}

.wlb-tags {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.wlb-tag {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.wlb-tag b { color: var(--accent-teal); }

/* ---------- Analyze Button ---------- */
.btn-analyze {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, var(--accent-green), var(--accent-teal));
  color: #0a0f0a;
  font-weight: 700;
  font-size: 1rem;
  padding: 16px 32px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.3s var(--ease);
  letter-spacing: 0.02em;
  margin-top: 8px;
}

.btn-analyze:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(78, 205, 196, 0.4);
}

.btn-analyze:active { transform: translateY(0); }

/* ✅ Loading / disabled state */
.btn-analyze.loading,
.btn-analyze:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
}

.btn-arrow {
  font-size: 1.2rem;
  transition: transform 0.2s;
  display: inline-flex;
  align-items: center;
}

.btn-analyze:hover .btn-arrow { transform: translateX(4px); }

/* ✅ Loading spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(10, 15, 10, 0.3);
  border-top-color: #0a0f0a;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Results Panel ---------- */
.results-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 0;
  color: var(--text-muted);
  gap: 12px;
  text-align: center;
}

.empty-icon { font-size: 2.5rem; opacity: 0.5; }

/* ---------- Moisture Gauge ---------- */
.moisture-gauge {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.gauge-svg { width: 200px; height: 120px; }

.gauge-center {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  line-height: 1;
}

.gauge-val {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent-lime);
}

.gauge-unit {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent-green);
}

.gauge-label {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ---------- Result Stats ---------- */
.result-stats {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.result-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
}

.result-stat.highlight {
  border-color: rgba(78, 205, 196, 0.3);
  background: rgba(78, 205, 196, 0.06);
}

.rs-label { font-size: 0.82rem; color: var(--text-muted); }

.rs-value {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.water-value { color: var(--accent-teal); font-size: 1.1rem; }

/* ---------- Status Badges ---------- */
.status-badge {
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
}

.status-ok       { background: rgba(126, 200, 80, 0.15); color: var(--accent-lime);  }
.status-low      { background: rgba(245, 166, 35, 0.15); color: var(--accent-amber); }
.status-critical { background: rgba(224, 85, 85, 0.15);  color: var(--accent-red);   }
.status-high     { background: rgba(74, 144, 217, 0.15); color: var(--accent-blue);  }

/* ---------- Recommendation Box ---------- */
.recommendation-box {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: rgba(181, 232, 83, 0.06);
  border: 1px solid rgba(181, 232, 83, 0.15);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.rec-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

/* ---------- Cloud Send Button ---------- */
.btn-send {
  width: 100%;
  background: transparent;
  border: 1px solid var(--accent-teal);
  color: var(--accent-teal);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-send:hover {
  background: rgba(78, 205, 196, 0.12);
  box-shadow: 0 0 20px rgba(78, 205, 196, 0.2);
}

.btn-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Dashboard ---------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 48px;
}

.dash-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color 0.3s, transform 0.3s var(--ease);
}

.dash-card:hover {
  border-color: var(--border);
  transform: translateY(-3px);
}

.dash-icon { font-size: 2rem; }

.dash-info { flex: 1; }

.dash-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dash-value {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.dash-trend {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 100px;
}

.dash-trend.up      { background: rgba(126, 200, 80, 0.1);  color: var(--accent-lime); }
.dash-trend.down    { background: rgba(74, 144, 217, 0.1);  color: var(--accent-blue); }
.dash-trend.neutral { background: rgba(78, 205, 196, 0.1);  color: var(--accent-teal); }

/* ---------- Bar Chart ---------- */
.chart-section {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 32px;
}

.chart-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  height: 160px;
  padding: 0 8px;
}

.bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.bar {
  width: 100%;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--accent-lime), var(--accent-green));
  min-height: 8px;
  transition: height 0.8s var(--ease);
  position: relative;
}

.bar::after {
  content: attr(data-val);
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.chart-days {
  display: flex;
  justify-content: space-between;
  padding: 10px 8px 0;
}

.chart-day {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  flex: 1;
  text-align: center;
}

/* ---------- Weather Section ---------- */
.weather-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
}

.weather-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
}

.weather-icon-big  { font-size: 4rem; }

.weather-temp-big {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent-amber);
}

.weather-desc  { font-size: 0.95rem; color: var(--text-secondary); text-transform: capitalize; }

.weather-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}

.weather-tag {
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.weather-factors h3 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.factor-list { display: flex; flex-direction: column; gap: 18px; }

.factor-item {
  display: flex;
  align-items: center;
  gap: 14px;
}

.factor-name {
  font-size: 0.88rem;
  color: var(--text-secondary);
  min-width: 160px;
}

.factor-bar {
  flex: 1;
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}

.factor-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-lime));
  transition: width 0.8s var(--ease);
}

.factor-fill.rain  { background: linear-gradient(90deg, var(--accent-blue),  var(--accent-teal)); }
.factor-fill.wind  { background: linear-gradient(90deg, #8b7ec8, #b0a0e8); }
.factor-fill.solar { background: linear-gradient(90deg, var(--accent-amber), #f5d423); }

.factor-pct {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  min-width: 36px;
  text-align: right;
}

/* ---------- History Table ---------- */
.history-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  background: var(--surface);
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.history-table thead tr {
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.history-table th {
  padding: 14px 20px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 400;
}

.history-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border2);
  color: var(--text-secondary);
}

.history-table tbody tr:last-child td { border-bottom: none; }
.history-table tbody tr:hover { background: rgba(126, 200, 80, 0.03); }

.empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 48px;
}

.history-table .status-badge { font-family: var(--font-mono); }

.btn-view {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-view:hover {
  border-color: var(--accent-green);
  color: var(--accent-lime);
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 48px 80px;
  border-top: 1px solid var(--border2);
}

.footer-logo {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-lime);
  margin-bottom: 8px;
}

.footer-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.footer-tech {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  opacity: 0.6;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 24px;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  animation: slideInRight 0.3s var(--ease);
  max-width: 380px;
}

.toast.hidden { display: none; }

@keyframes slideInRight {
  from { transform: translateX(100px); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

/* ---------- Utilities ---------- */
.hidden { display: none !important; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .analyzer-grid  { grid-template-columns: 1fr 1fr; }
  .results-card   { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .hero           { flex-direction: column; padding: 80px 40px 60px; text-align: center; }
  .hero-actions   { justify-content: center; }
  .hero-visual    { display: none; }
  .section        { padding: 80px 40px; }
  .analyzer-grid  { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .weather-grid   { grid-template-columns: 1fr; }
  .stats-bar      { padding: 20px 40px; gap: 0; }
  .stat-item      { padding: 0 24px; }
  .navbar         { padding: 0 24px; }
  .nav-links      { display: none; }
  .status-text    { display: none; }
}

@media (max-width: 600px) {
  .stats-bar      { flex-direction: column; gap: 24px; }
  .stat-divider   { width: 48px; height: 1px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .factor-name    { min-width: 120px; }
  .toast          { left: 16px; right: 16px; bottom: 16px; }
}