/* ==============================================================
   SelfEco App — page layout styles
   File: /app/styles.css
   File updated on: 2025-10-06
   ============================================================== */

/* --- Base & theme tokens --- */
:root {
  --bg: #031812;
  --panel: #0a2019;
  --tile: #102431;
  --stroke: rgba(255,255,255,0.10);
  --muted: #a8c3b5;
  --mint: #00FF9D;
  --mint-2: #0fe3a2;
  --text: #e4f2eb;
}

/* --- FIX HEADER + CANVAS SPACING --- */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1; /* keeps background behind all content */
  display: block;
}

.site-header {
  margin: 0;
  padding: 0;
}

/* tighten top margin for main content */
main {
  padding-top: 12px;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

/* --- Typography --- */
body {
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  font-weight: 400;
  line-height: 1.5;
}

h1 {
  margin: 10px 0 6px;
  font-size: 2rem;
  line-height: 1.2;
  color: var(--mint);
  font-weight: 700;
  letter-spacing: 0.2px;
}

.lead {
  color: var(--muted);
  margin: 8px 0 18px;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, rgba(3, 24, 18, 0.9), rgba(3, 24, 18, 0.6));
  backdrop-filter: saturate(1.2) blur(6px);
  border-bottom: 1px solid var(--stroke);
}

.container.nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.tag {
  font-size: 0.75rem;
  margin-left: 0.5rem;
  padding: 2px 8px;
  border-radius: 999px;
  color: #022016;
  background: var(--mint-2);
}

/* --- Buttons --- */
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 600;
  text-decoration: none;
  color: #001510;
  background: var(--mint-2);
  box-shadow: 0 8px 18px rgba(15, 227, 162, 0.18);
}

.btn:hover {
  filter: brightness(1.04);
}

.btn.alt {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--stroke);
}

.btn.alt:hover {
  background: #0e2a22;
}

/* --- Metrics --- */
.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 8px 0 6px;
}

.stat {
  min-width: 160px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #08231c;
  border: 1px solid var(--stroke);
}

.stat .val {
  font-size: 1.1rem;
  font-weight: 700;
}

.stat .label {
  font-size: 0.85rem;
  color: var(--muted);
}

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 10px 0 12px;
}

.tab {
  padding: 8px 12px;
  border-radius: 20px;
  user-select: none;
  border: 1px solid var(--stroke);
  background: #09231b;
  color: var(--text);
  cursor: pointer;
}

.tab.active {
  background: var(--mint-2);
  color: #001510;
  border-color: transparent;
}

/* --- Panels --- */
.panel {
  display: none;
  margin-top: 8px;
}
.panel.show {
  display: block;
}

/* --- CTA Row --- */
.cta-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 10px 0 8px;
}
.cta-row .btn {
  min-width: 180px;
}

/* --- Daily Hero Events --- */
.section-title {
  font-weight: 800;
  margin: 16px 0 6px;
}
.subtle {
  color: var(--muted);
  margin: 0 0 14px;
}

.countdowns {
  display: grid;
  gap: 12px;
  margin-top: 8px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.tile {
  background: var(--tile);
  border: 1px solid #0f2b2b;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.tile h3 {
  margin: 0 0 2px;
  font-size: 1rem;
}

.time {
  font-size: 1.6rem;
  margin: 4px 0 6px;
  font-weight: 700;
}

.label {
  color: var(--muted);
  font-size: 0.9rem;
}

/* --- Sliders --- */
.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: center;
  max-width: 520px;
  margin: 10px auto 8px;
}

.control label {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

input[type="range"] {
  width: 100%;
}
.nearme {
  margin-top: 6px;
}

/* --- Footer --- */
footer {
  margin: 28px 0 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

/* --- Responsive tweaks --- */
@media (max-width: 720px) {
  .container.nav {
    padding: 10px 12px;
  }
  h1 {
    font-size: 1.7rem;
  }
  .controls {
    grid-template-columns: 1fr;
  }
}

/* --- A11y focus --- */
a:focus,
button:focus,
.tab:focus,
.btn:focus {
  outline: 2px solid var(--mint-2);
  outline-offset: 2px;
}

/* File updated on 2025-10-06 (Bangkok time)
   Purpose: Pill-visible boundary for inline CTA + footer parity with landing */

/* Pill-styled inline CTA (next to "Hero Events") */
.pill {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 9999px;
  background: #092019;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 2px 10px rgba(0,0,0,0.25), inset 0 0 0 1px rgba(15,227,162,0.06);
  vertical-align: middle;
}
.inline-cta,
.inline-cta:visited {
  color: var(--aqua);
  font-weight: 700;
  text-decoration: none;
}
.inline-cta:hover,
.inline-cta:focus-visible {
  color: var(--mint);
  text-decoration: underline;
  text-underline-offset: 2px;
  outline: none;
}

/* Footer (match landing page) */
.app-footer{
  display:flex; justify-content:center;
  padding:22px 16px;
  color: var(--muted);
  font-size:.9rem;
  border-top:1px solid rgba(255,255,255,0.06);
  background: linear-gradient(180deg, rgba(3,24,18,0) 0%, rgba(3,24,18,0.55) 60%, rgba(3,24,18,0.9) 100%);
  margin-top: 28px;
}
.app-footer .inner{
  width:100%; max-width:1100px;
  display:flex; gap:12px; align-items:center;
}
.app-footer .grow{ flex:1; }

/* MOBILE TWEAKS — File updated on: 2025-10-06 */
@media (max-width: 560px){
  .cta-row { flex-direction: column; gap: 8px; }
  .cta-row .btn { width: 100%; }
  .controls { grid-template-columns: 1fr; gap: 10px; }
}

