/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green-dark:  #2d5a0e;
  --green-main:  #4a7c1f;
  --green-light: #d4edaa;
  --green-pale:  #f0f7e6;
  --text-primary: #1a1a1a;
  --text-secondary: #666;
  --text-muted: #999;
  --bg: #fafaf7;
  --card-bg: #ffffff;
  --border: #e8ede0;
  --radius: 12px;
  --radius-lg: 18px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Sarabun', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== NAVBAR ===== */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-left { display: flex; align-items: center; gap: 10px; }

.logo-icon { font-size: 22px; }

.logo-text {
  font-size: 17px;
  font-weight: 600;
  color: var(--green-dark);
  letter-spacing: -0.3px;
}

.ai-badge {
  display: inline-block;
  background: var(--green-main);
  color: white;
  font-size: 11px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 20px;
  vertical-align: middle;
  margin-left: 2px;
}

.nav-right { display: flex; align-items: center; gap: 16px; }

.nav-province {
  font-size: 13px;
  color: var(--text-secondary);
}

.nav-updated {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
}

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 60px 24px 48px;
  background: linear-gradient(160deg, #f0f7e6 0%, #fafaf7 60%);
  border-bottom: 1px solid var(--border);
}

.hero-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: var(--green-main);
  background: var(--green-pale);
  border: 1px solid var(--green-light);
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}

.hero-title {
  font-size: clamp(32px, 6vw, 52px);
  font-weight: 300;
  line-height: 1.15;
  color: var(--text-primary);
  letter-spacing: -1px;
  margin-bottom: 16px;
}

.hero-accent {
  font-weight: 600;
  color: var(--green-main);
}

.hero-sub {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ===== METRICS ===== */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  padding: 32px 32px 0;
  max-width: 1000px;
  margin: 0 auto;
}

.metric-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

.metric-card.highlight {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: white;
}

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.metric-card.highlight .metric-label { color: rgba(255,255,255,0.7); }

.metric-value {
  font-size: 30px;
  font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.metric-card.highlight .metric-value { color: white; }

.metric-unit {
  font-size: 11px;
  color: var(--text-muted);
}

.metric-card.highlight .metric-unit { color: rgba(255,255,255,0.6); }

/* ===== SECTION ===== */
.section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 32px 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.section-tag {
  font-size: 12px;
  color: var(--text-muted);
  background: #f0f0f0;
  padding: 3px 10px;
  border-radius: 20px;
  font-family: 'IBM Plex Mono', monospace;
}

.section-tag.ai {
  background: var(--green-pale);
  color: var(--green-main);
  border: 1px solid var(--green-light);
}

/* ===== CHART ===== */
.chart-wrap {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  height: 240px;
}

/* ===== FORECAST ===== */
.forecast-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.forecast-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.forecast-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

.forecast-week {
  font-size: 12px;
  font-weight: 600;
  color: var(--green-main);
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}

.forecast-date {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
  margin-bottom: 10px;
}

.forecast-price {
  font-size: 24px;
  font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.forecast-diff {
  font-size: 12px;
  font-family: 'IBM Plex Mono', monospace;
}

.forecast-diff.up { color: #2d7a2d; }
.forecast-diff.down { color: #a32d2d; }

/* ===== ABOUT ===== */
.about {
  padding-bottom: 0;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.about-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.about-icon { font-size: 24px; margin-bottom: 10px; }

.about-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.about-val {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.6;
}

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 40px 24px 32px;
  margin-top: 40px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.8;
}

.footer-update {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .nav { padding: 12px 16px; }
  .hero { padding: 40px 16px 32px; }
  .metrics { padding: 20px 16px 0; }
  .section { padding: 24px 16px 0; }
  .forecast-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-updated { display: none; }
}

/* ===== PREDICTION CARD ===== */
.predict-section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 32px 0;
}

.predict-card {
  background: var(--green-dark);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 32px;
  color: white;
}

.predict-left { flex: 1; }

.predict-label {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 4px;
}

.predict-date {
  font-size: 15px;
  font-family: 'IBM Plex Mono', monospace;
  color: rgba(255,255,255,0.8);
  margin-bottom: 8px;
}

.predict-price {
  font-size: 56px;
  font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
  line-height: 1;
  color: white;
  margin-bottom: 4px;
}

.predict-unit {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
}

.predict-divider {
  width: 1px;
  height: 120px;
  background: rgba(255,255,255,0.15);
}

.predict-right { flex: 1; display: flex; flex-direction: column; gap: 12px; }

.predict-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.pr-label { color: rgba(255,255,255,0.6); }
.pr-val { color: white; font-weight: 500; }
.pr-val.mono { font-family: 'IBM Plex Mono', monospace; }

.trend-badge {
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.trend-up { background: rgba(80,200,80,0.2); color: #90ee90; }
.trend-down { background: rgba(255,80,80,0.2); color: #ffaaaa; }
.trend-stable { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.8); }

@media (max-width: 600px) {
  .predict-card { flex-direction: column; gap: 20px; }
  .predict-divider { width: 100%; height: 1px; }
  .predict-price { font-size: 40px; }
  .predict-section { padding: 20px 16px 0; }
}
