/* =========================================================
   GreenMix – Main Stylesheet
   ========================================================= */

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

:root {
  --blue:       #185FA5;
  --blue-light: #E6F1FB;
  --blue-mid:   #B5D4F4;
  --blue-dark:  #0C447C;
  --green:      #2E7D32;
  --green-light:#EAF3DE;
  --green-mid:  #C0DD97;
  --green-dark: #1B5E20;
  --amber:      #E65100;
  --amber-light:#FFF3E0;
  --amber-mid:  #FFCC80;
  --red:        #C62828;
  --red-light:  #FFEBEE;
  --gray-50:    #FAFAF8;
  --gray-100:   #F5F4F0;
  --gray-200:   #EDECE7;
  --gray-300:   #D8D6CF;
  --gray-400:   #B4B2A9;
  --gray-500:   #888780;
  --gray-700:   #3D3C38;
  --gray-900:   #1A1A18;
  --white:      #FFFFFF;
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.07);
  --shadow-md:  0 4px 12px rgba(0,0,0,.10);
  --shadow-lg:  0 8px 24px rgba(0,0,0,.12);
  --font:       -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:       'SF Mono', 'Fira Code', 'Consolas', monospace;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--gray-100);
  color: var(--gray-900);
  line-height: 1.5;
  font-size: 14px;
  min-height: 100vh;
}

/* ── Nav ── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}
.nav-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex; align-items: center; gap: 32px;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 700; color: var(--gray-900);
  letter-spacing: -0.02em; text-decoration: none; white-space: nowrap;
}
.nav-links {
  display: flex; gap: 4px; flex: 1;
}
.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500;
  color: var(--gray-500);
  text-decoration: none;
  transition: all .15s;
  cursor: pointer;
}
.nav-link:hover { color: var(--gray-900); background: var(--gray-100); }
.nav-link.active { color: var(--blue); background: var(--blue-light); }

.nav-status {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--gray-500);
  white-space: nowrap;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gray-300);
  transition: background .3s;
}
.status-dot.online  { background: #43A047; box-shadow: 0 0 0 2px #C8E6C9; }
.status-dot.offline { background: var(--red); }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #0C2D4A 0%, #185FA5 55%, #1B7F5A 100%);
  color: var(--white);
  padding: 56px 24px 48px;
}
.hero-inner { max-width: 900px; margin: 0 auto; text-align: center; }
.hero-badge {
  display: inline-block;
  padding: 4px 14px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: var(--radius-xl);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.07em;
  margin-bottom: 18px;
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(4px);
}
.hero h1 {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}
.hero-accent { color: #7DD3A8; }
.hero p {
  font-size: 15px; color: rgba(255,255,255,.8);
  max-width: 560px; margin: 0 auto 28px; line-height: 1.65;
}
.hero-stats {
  display: flex; justify-content: center; gap: 32px; flex-wrap: wrap;
}
.hstat { text-align: center; }
.hstat-v {
  display: block; font-size: 24px; font-weight: 800; color: #7DD3A8;
}
.hstat-l { font-size: 11px; color: rgba(255,255,255,.65); text-transform: uppercase; letter-spacing:.07em; }

/* ── Main wrapper ── */
.main-wrap {
  max-width: 1280px; margin: 0 auto;
  padding: 28px 24px 64px;
}

/* ── Tab sections ── */
.tab-section { display: none; }
.tab-section.active { display: block; }

/* ── Two-column layout ── */
.two-col {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 20px;
  align-items: start;
}

/* ── Inputs panel ── */
.inputs-panel {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  position: sticky; top: 72px;
}
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.panel-header h2 { font-size: 16px; font-weight: 700; }
.std-pill {
  font-size: 11px; font-weight: 700;
  padding: 3px 10px;
  background: var(--blue-light); color: var(--blue);
  border-radius: var(--radius-xl);
  letter-spacing: .04em;
}

.input-group {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-100);
}
.input-group:last-of-type { border-bottom: none; }
.ig-title {
  font-size: 11px; font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}

.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12.5px; color: var(--gray-500); font-weight: 500; }
.field select,
.field input[type="number"],
.field input[type="text"] {
  padding: 8px 10px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  background: var(--white);
  color: var(--gray-900);
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
  font-family: var(--font);
}
.field select:focus,
.field input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(24,95,165,.12);
}
.fhint { font-size: 11px; color: var(--gray-400); }

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px,1fr));
  gap: 10px;
}

.exp-note {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px; line-height: 1.5;
  background: var(--blue-light); color: var(--blue-dark);
}

/* eco mini row */
.eco-mini-sel .ig-title { justify-content: space-between; }
.mini-eco-btn {
  font-size: 11px; padding: 3px 9px;
  border: 1px solid var(--blue-mid);
  border-radius: var(--radius-xl);
  background: var(--blue-light); color: var(--blue);
  cursor: pointer; font-weight: 600;
}
.eco-tags-row { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; }
.eco-tag-empty { font-size: 12px; color: var(--gray-400); font-style: italic; }
.eco-tag-pill {
  display: flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  background: var(--green-light); color: var(--green-dark);
  border-radius: var(--radius-xl); font-size: 12px; font-weight: 600;
}
.eco-tag-pill .rm { cursor: pointer; opacity: .6; font-size: 14px; }

/* design button */
.design-btn {
  width: 100%; margin-top: 14px;
  padding: 13px;
  background: var(--blue);
  color: var(--white);
  border: none; border-radius: var(--radius-md);
  font-size: 14.5px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all .15s;
  letter-spacing: .01em;
}
.design-btn:hover { background: var(--blue-dark); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.design-btn:active { transform: scale(.99); }
.design-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ── Results panel ── */
.results-panel {
  min-height: 400px;
}
.results-placeholder {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px;
  min-height: 380px;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--gray-300);
  color: var(--gray-400);
  text-align: center; padding: 40px;
}
.results-placeholder p { font-size: 14px; line-height: 1.6; max-width: 280px; }

/* ── Loader ── */
.loader-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
}
.loader-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px 40px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loader-msg { font-size: 14px; color: var(--gray-500); }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 1000;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 13px; font-weight: 500;
  background: var(--gray-900); color: var(--white);
  box-shadow: var(--shadow-lg);
  transform: translateY(80px); opacity: 0;
  transition: all .25s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }
.toast.warn    { background: var(--amber); }

/* ── Eco tab ── */
.eco-header { margin-bottom: 20px; }
.eco-header h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.eco-header p  { color: var(--gray-500); }
.eco-filter-row { display: flex; gap: 8px; margin-bottom: 20px; }
.eco-filter {
  padding: 6px 16px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-xl);
  font-size: 13px; font-weight: 500;
  background: var(--white); color: var(--gray-500);
  cursor: pointer; transition: all .15s;
}
.eco-filter.active { background: var(--blue); color: var(--white); border-color: var(--blue); }
.eco-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px,1fr));
  gap: 16px;
}
.eco-footer-actions {
  margin-top: 24px; text-align: center;
}
.apply-eco-btn {
  padding: 12px 40px;
  background: var(--green); color: var(--white);
  border: none; border-radius: var(--radius-md);
  font-size: 15px; font-weight: 700;
  cursor: pointer; transition: all .15s;
}
.apply-eco-btn:hover { background: var(--green-dark); box-shadow: var(--shadow-md); }

/* ── Compare tab ── */
.compare-header {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 24px;
}
.compare-header h2 { font-size: 22px; font-weight: 700; }
.compare-header p  { color: var(--gray-500); }
.compare-run-btn {
  align-self: flex-start;
  padding: 10px 28px;
  background: var(--blue); color: var(--white);
  border: none; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all .15s;
}
.compare-run-btn:hover { background: var(--blue-dark); }
.compare-placeholder {
  padding: 48px; text-align: center;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--gray-300);
  color: var(--gray-400);
}

/* ── Prices tab ── */
.prices-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.prices-header h2 { font-size: 22px; font-weight: 700; flex: 1; }
.prices-meta { display: flex; align-items: center; gap: 10px; }
#prices-updated { font-size: 12px; color: var(--gray-400); }
.refresh-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--white); color: var(--gray-700);
  font-size: 12.5px; font-weight: 500;
  cursor: pointer; transition: all .15s;
}
.refresh-btn:hover { background: var(--gray-100); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .inputs-panel { position: static; }
  .nav-links { gap: 0; }
  .nav-link { padding: 6px 10px; font-size: 12.5px; }
}
@media (max-width: 600px) {
  .hero { padding: 40px 16px 36px; }
  .main-wrap { padding: 16px 14px 48px; }
  .hero-stats { gap: 20px; }
  .nav-inner { gap: 12px; padding: 0 14px; }
  .eco-grid { grid-template-columns: 1fr; }
}
