/* ====================================================
   CarbonScope v3.0 — Unified Layout (Dashboard + About + Credits)
   ==================================================== */
:root {
  --bg: #0b1220;
  --panel: #111a2b;
  --text: #e6eefc;
  --muted: #9bb0c9;
  --accent: #33d17a;
  --accent-2: #3b82f6;
  --border: #1d2b45;
  --input-bg: #0f192e;
}
body.light {
  --bg: #f8f9fb;
  --panel: #ffffff;
  --text: #1b1f29;
  --muted: #666;
  --accent: #16a34a;
  --accent-2: #2563eb;
  --border: #ccc;
  --input-bg: #f3f4f6;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: 0.3s;
}

/* ================= HEADER ================= */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: var(--input-bg);
  border-radius: 8px;
  font-size: 20px;
}
nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 16px;
  padding: 6px 10px;
  border-radius: 6px;
  transition: 0.2s;
  font-weight: 500;
}
nav a.active, nav a:hover { background: rgba(128,128,255,0.1); color: var(--text); }
#modeToggle {
  background: none;
  border: none;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
}

/* ================= DASHBOARD MAIN ================= */
.main-container {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem 3rem;
  max-width: 1500px;
  margin: auto;
}
.panel {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 0 12px rgba(0,0,0,0.3);
}
.inputs-panel { max-width: 420px; overflow-y: auto; max-height: 82vh; }
.results-panel { flex: 2; }

/* Inputs */
details {
  background: var(--input-bg);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent-2);
  margin-bottom: 8px;
}
label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 6px 0;
}
input[type="number"] {
  width: 120px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 6px;
}
input[type="range"] { flex: 1; margin: 0 10px; accent-color: var(--accent); }
.hint { min-width: 40px; text-align: right; }

/* Actions */
.actions {
  display: flex; gap: 8px;
  margin-top: 16px;
  justify-content: center;
}
button {
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
}
#btnCalculate { background: var(--accent); color: #fff; }
.secondary { background: #6b7280; color: #fff; }
.report-link { text-align: center; margin-top: 18px; }
.report-link button {
  background: var(--accent);
  color: white;
  padding: 12px 18px;
}

/* Results */
.results-summary {
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
}
.card {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
  padding: 10px;
  flex: 1;
  margin: 0 6px;
}
.card.saving { background: rgba(51,209,122,0.15); border-color: var(--accent); }
.card h4 { margin: 4px 0; color: var(--muted); }
.card p { font-size: 18px; font-weight: 700; margin: 0; }

.chart-container {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  height: 340px;
}
canvas { width: 100% !important; height: 100% !important; }

/* ================= ABOUT & CREDITS PAGES ================= */
.main-section {
  max-width: 1000px;
  margin: 4rem auto;
  background: var(--panel);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 0 18px rgba(0,0,0,0.3);
  padding: 3rem;
  animation: fadeIn 0.6s ease-in-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.main-section h1 {
  font-size: 2.2rem;
  color: var(--accent-2);
  text-align: center;
  margin-bottom: 1.5rem;
}
.main-section h2 {
  font-size: 1.4rem;
  color: var(--accent);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}
.main-section p {
  color: var(--text);
  line-height: 1.8;
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

/* Info Box */
.info-box {
  background: rgba(59,130,246,0.08);
  border-left: 4px solid var(--accent-2);
  border-radius: 6px;
  padding: 12px 18px;
  margin: 16px 0;
  color: var(--text);
  font-size: 0.95rem;
}

/* Credits Layout */
.credits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.credit-card {
  background: var(--input-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 20px;
  text-align: center;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
  transition: 0.3s;
}
.credit-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 18px rgba(59,130,246,0.3);
}
.credit-card h3 {
  color: var(--accent-2);
  margin-bottom: 8px;
  font-size: 1.1rem;
}
.credit-card p {
  margin: 4px 0;
  color: var(--text);
  font-size: 0.95rem;
}

/* Team Info */
.team-info {
  text-align: center;
  margin-top: 2rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}
.team-info h3 {
  color: var(--accent);
  margin-bottom: 10px;
}
.team-info p {
  margin: 4px 0;
  color: var(--muted);
}

/* ================= FOOTER ================= */
.app-footer {
  text-align: center;
  padding: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4rem;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1024px) {
  .main-container { flex-direction: column; padding: 1rem; }
  .inputs-panel { max-width: 100%; max-height: unset; }
}
@media (max-width: 768px) {
  .main-section {
    margin: 2rem 1rem;
    padding: 2rem;
  }
  .credits-grid {
    grid-template-columns: 1fr;
  }
  .credit-card { padding: 16px; }
}
