/* ============================================================
   EcoStep — style.css (ULTRA MODERN UI)
   Design system: Premium Dark Eco-Tech
   ============================================================ */

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

:root {
  /* Brand Gradients & Colors */
  --neon-green: #00FFA3;
  --neon-cyan:  #00E5FF;
  --bg-dark:    #05080A;
  --bg-surface: rgba(15, 23, 30, 0.6);
  --bg-panel:   rgba(255, 255, 255, 0.03);
  
  /* Text */
  --text-main:  #FFFFFF;
  --text-dim:   #94A3B8;
  --text-muted: #64748B;
  
  /* Borders & Shadows */
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glow:  rgba(0, 255, 163, 0.3);
  --shadow-soft:  0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow:  0 0 20px rgba(0, 255, 163, 0.15);
  
  /* Typography */
  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  
  /* Tokens */
  --radius-sm:  8px;
  --radius-md:  16px;
  --radius-lg:  24px;
  --radius-xl:  32px;
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes pulseGlow { 0%, 100% { opacity: 0.5; } 50% { opacity: 0.8; } }

html { scroll-behavior: smooth; font-size: 16px; }
body { 
  font-family: var(--font-body); 
  background-color: var(--bg-dark); 
  color: var(--text-main); 
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background Ambient Glows */
body::before, body::after {
  content: ''; position: fixed; border-radius: 50%; filter: blur(120px); z-index: -1; pointer-events: none;
}
body::before {
  top: -10%; left: -10%; width: 50vw; height: 50vw;
  background: radial-gradient(circle, rgba(0,255,163,0.15) 0%, transparent 70%);
  animation: pulseGlow 10s ease-in-out infinite alternate;
}
body::after {
  bottom: -20%; right: -10%; width: 60vw; height: 60vw;
  background: radial-gradient(circle, rgba(0,229,255,0.1) 0%, transparent 70%);
  animation: pulseGlow 12s ease-in-out infinite alternate-reverse;
}

/* === ACCESSIBILITY ========================================= */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
:focus-visible { outline: 2px solid var(--neon-green); outline-offset: 4px; border-radius: var(--radius-sm); }

/* === LAYOUT ================================================ */
.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }

/* === HEADER ================================================ */
.site-header {
  background: rgba(5, 8, 10, 0.8);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  position: sticky; top: 0; z-index: 100;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand-icon {
  width: 36px; height: 36px; border-radius: 12px;
  background: linear-gradient(135deg, var(--neon-green), var(--neon-cyan));
  display: flex; align-items: center; justify-content: center;
  color: #000; font-size: 18px; font-weight: bold;
}
.brand-name { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.5px; }

.nav-links { display: flex; gap: 2.5rem; list-style: none; align-items: center; }
.nav-links a {
  text-decoration: none; color: var(--text-dim); font-size: 14px; font-weight: 500;
  transition: color 0.2s, text-shadow 0.2s;
}
.nav-links a:hover { color: #fff; text-shadow: 0 0 10px rgba(255,255,255,0.5); }

/* === HERO SECTION ========================================== */
.hero { padding: 8rem 0 6rem; position: relative; text-align: center; }
.hero-inner { max-width: 800px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-panel); border: 1px solid var(--border-glass); backdrop-filter: blur(10px);
  color: var(--neon-cyan); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
  padding: 8px 20px; border-radius: 999px; margin-bottom: 2rem;
  box-shadow: var(--shadow-glow);
}
.hero h1 {
  font-family: var(--font-display); font-size: clamp(3rem, 6vw, 4.5rem);
  font-weight: 800; line-height: 1.1; margin-bottom: 1.5rem; letter-spacing: -1px;
  background: linear-gradient(to right, #FFFFFF, #A8B8D0);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub {
  font-size: 18px; color: var(--text-dim); line-height: 1.8;
  margin-bottom: 3rem; max-width: 600px;
}

/* BUTTONS */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--neon-green), var(--neon-cyan));
  color: #000; text-decoration: none;
  padding: 14px 28px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 700; border: none; cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s; font-family: var(--font-body);
  box-shadow: 0 0 20px rgba(0, 255, 163, 0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 30px rgba(0, 255, 163, 0.6); }

.btn-secondary, .btn-outline {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-panel); color: #fff; text-decoration: none;
  padding: 14px 28px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 500;
  border: 1px solid var(--border-glass); cursor: pointer;
  transition: all 0.2s; backdrop-filter: blur(10px); font-family: var(--font-body);
}
.btn-secondary:hover, .btn-outline:hover {
  background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2);
}

.download-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(0, 255, 163, 0.1); color: var(--neon-green);
  border: 1px solid rgba(0, 255, 163, 0.3);
  padding: 10px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all 0.2s ease; margin-top: 12px; width: 100%;
  font-family: var(--font-body);
}
.download-btn:hover {
  background: var(--neon-green); color: #000;
  box-shadow: 0 0 15px rgba(0, 255, 163, 0.4);
  transform: translateY(-2px);
}

.hero-stats {
  display: flex; align-items: center; justify-content: center; gap: 3rem; flex-wrap: wrap; margin-top: 4rem;
  padding: 2rem; background: var(--bg-surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass); backdrop-filter: blur(20px);
}
.stat { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.stat-val { font-family: var(--font-display); font-size: 32px; font-weight: 700; color: var(--neon-green); }
.stat-label { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-divider { width: 1px; height: 40px; background: var(--border-glass); }

/* === APP SHELL (THE COACH) ================================= */
.calculator-section { padding: 4rem 0 8rem; }
.app-shell {
  background: var(--bg-surface); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
  border-radius: var(--radius-xl); border: 1px solid var(--border-glass);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
  overflow: hidden; min-height: 600px; display: flex; flex-direction: column;
}

/* Tabs */
.app-tabs {
  display: flex; border-bottom: 1px solid var(--border-glass);
  background: rgba(0,0,0,0.2); padding: 0 1rem;
}
.app-tab {
  display: flex; align-items: center; gap: 8px; padding: 20px 24px;
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  background: none; border: none; position: relative; cursor: pointer;
  transition: color 0.2s; font-family: var(--font-body);
}
.app-tab i { font-size: 18px; }
.app-tab:hover { color: var(--text-dim); }
.app-tab.active { color: #fff; }
.app-tab.active::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--neon-green), var(--neon-cyan));
  border-top-left-radius: 3px; border-top-right-radius: 3px;
  box-shadow: 0 -2px 10px rgba(0, 255, 163, 0.5);
}

.app-panel { display: none; flex: 1; }
.app-panel.active { display: flex; flex-direction: column; animation: fadeIn 0.4s ease; }

/* === CHAT PANEL ============================================ */
.chat-messages {
  flex: 1; min-height: 400px; max-height: 500px; overflow-y: auto;
  padding: 2rem; display: flex; flex-direction: column; gap: 20px;
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

.message {
  max-width: 80%; padding: 16px 20px; border-radius: var(--radius-lg);
  font-size: 15px; line-height: 1.6; position: relative;
}
.message.ai {
  background: rgba(0, 255, 163, 0.05); border: 1px solid rgba(0, 255, 163, 0.2);
  color: #E2E8F0; align-self: flex-start; border-bottom-left-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.message.user {
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-glass);
  color: #fff; align-self: flex-end; border-bottom-right-radius: 4px;
}
.message.thinking {
  background: transparent; color: var(--text-muted); border: none; font-style: italic; align-self: flex-start;
}
.message a { color: var(--neon-cyan); text-decoration: none; font-weight: 500; }
.message a:hover { text-decoration: underline; }

/* Input Area */
.quick-btns {
  display: flex; gap: 8px; padding: 1rem 2rem; border-top: 1px solid var(--border-glass);
  overflow-x: auto; white-space: nowrap;
}
.quick-btns::-webkit-scrollbar { display: none; }
.qbtn {
  background: rgba(255,255,255,0.03); border: 1px solid var(--border-glass);
  color: var(--text-dim); padding: 8px 16px; border-radius: 999px;
  font-size: 13px; cursor: pointer; transition: all 0.2s;
}
.qbtn:hover { background: rgba(0,255,163,0.1); color: var(--neon-green); border-color: rgba(0,255,163,0.3); }

.chat-input-area {
  display: flex; gap: 12px; padding: 1rem 2rem 2rem; background: rgba(0,0,0,0.2);
}
.chat-input-area input {
  flex: 1; padding: 16px 20px; font-size: 15px;
  border: 1px solid var(--border-glass); border-radius: var(--radius-md);
  background: rgba(0,0,0,0.3); color: #fff; font-family: var(--font-body);
  transition: all 0.3s; box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}
.chat-input-area input:focus { border-color: var(--neon-green); outline: none; box-shadow: 0 0 0 1px var(--neon-green), inset 0 2px 4px rgba(0,0,0,0.2); }
.chat-input-area input::placeholder { color: var(--text-muted); }

.send-btn {
  background: var(--neon-green); color: #000; border: none;
  padding: 0 24px; border-radius: var(--radius-md); font-size: 15px; font-weight: 700;
  cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 8px;
}
.send-btn:hover { background: #00E5FF; transform: scale(1.02); }
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* === DASHBOARD PANEL ======================================= */
.dashboard-content { padding: 2.5rem; overflow-y: auto; max-height: 600px; }
.metric-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; margin-bottom: 3rem; }

.metric-card {
  background: rgba(255,255,255,0.02); border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg); padding: 24px; position: relative; overflow: hidden;
}
.metric-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}
.metric-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.metric-value { font-family: var(--font-display); font-size: 36px; font-weight: 700; color: #fff; line-height: 1.1; }
.metric-unit  { font-size: 16px; color: var(--text-dim); font-weight: 400; }
.metric-note  { font-size: 13px; color: var(--text-muted); margin-top: 8px; }

/* Bars */
.section-label { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: #fff; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 10px; }
.section-label i { color: var(--neon-cyan); }

.bar-row { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.bar-label { width: 120px; font-size: 14px; color: var(--text-dim); }
.bar-track { flex: 1; height: 12px; background: rgba(0,0,0,0.3); border-radius: 999px; overflow: hidden; border: 1px solid var(--border-glass); }
.bar-fill { height: 100%; border-radius: 999px; box-shadow: 0 0 10px currentColor; }
.bar-value { width: 80px; font-size: 14px; font-weight: 600; text-align: right; color: #fff; }

/* Tips */
.tips-list { display: grid; gap: 1rem; margin-top: 3rem; }
.tip-card {
  background: rgba(255,255,255,0.03); border: 1px solid var(--border-glass);
  border-radius: var(--radius-md); padding: 20px; display: flex; gap: 16px;
}
.tip-icon {
  width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0;
  background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.1);
}
.tip-icon.green { color: var(--neon-green); box-shadow: 0 0 15px rgba(0,255,163,0.2); }
.tip-text p { font-size: 15px; color: #E2E8F0; margin-bottom: 4px; }
.tip-text span { font-size: 13px; color: var(--neon-cyan); font-weight: 500; }

/* === PLEDGES PANEL ========================================= */
.pledge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.5rem; padding: 2.5rem; }
.pledge-card {
  background: rgba(255,255,255,0.02); border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg); padding: 24px; cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); position: relative; overflow: hidden;
}
.pledge-card:hover {
  background: rgba(255,255,255,0.05); transform: translateY(-5px);
  border-color: rgba(255,255,255,0.2); box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.pledge-card.done {
  background: rgba(0, 255, 163, 0.05); border-color: rgba(0, 255, 163, 0.4);
}
.pledge-card.done::after {
  content: ''; position: absolute; top: 0; right: 0; width: 40px; height: 40px;
  background: linear-gradient(135deg, transparent 50%, rgba(0,255,163,0.2) 50%);
}
.pledge-ico { font-size: 32px; margin-bottom: 16px; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5)); }
.pledge-title { font-size: 15px; font-weight: 600; color: #fff; margin-bottom: 8px; line-height: 1.4; }
.pledge-saving { font-size: 13px; color: var(--neon-cyan); }
.pledge-badge { display: none; } /* removed in favor of styling */

.pledge-summary {
  margin: 0 2.5rem 2.5rem; padding: 20px; border-radius: var(--radius-md);
  background: linear-gradient(90deg, rgba(0,255,163,0.1), transparent);
  border-left: 4px solid var(--neon-green); font-size: 15px;
}

/* === HOW IT WORKS / CONTEXT ================================ */
.how-it-works, .context-section { padding: 6rem 0; }
.how-it-works h2, .context-section h2 { font-family: var(--font-display); font-size: 2.5rem; text-align: center; margin-bottom: 1rem; color: #fff; }
.section-sub { text-align: center; color: var(--text-dim); font-size: 18px; margin-bottom: 4rem; }

.steps-grid, .context-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.step-card, .context-card {
  background: var(--bg-surface); border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl); padding: 2.5rem; text-align: left;
  backdrop-filter: blur(10px); transition: transform 0.3s, box-shadow 0.3s;
}
.step-card:hover, .context-card:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,0.4); border-color: rgba(255,255,255,0.15); }
.step-icon, .context-card i {
  font-size: 32px; color: var(--neon-cyan); margin-bottom: 1.5rem;
  background: rgba(0,229,255,0.1); width: 64px; height: 64px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
}
.step-card h3, .context-card h3 { font-family: var(--font-display); font-size: 20px; color: #fff; margin-bottom: 1rem; }
.step-card p, .context-card p { color: var(--text-dim); font-size: 15px; line-height: 1.7; }

/* === FOOTER ================================================ */
.site-footer {
  border-top: 1px solid var(--border-glass); padding: 3rem 0; text-align: center;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(10px); margin-top: 4rem;
}
.footer-brand { display: flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--font-display); font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 1rem; }
.footer-brand i { color: var(--neon-green); }
.footer-note { color: var(--text-dim); font-size: 14px; margin-bottom: 0.5rem; }
.footer-small { color: var(--text-muted); font-size: 12px; }

/* === MODAL ================================================= */
#apiKeyModal > div {
  background: rgba(15, 23, 30, 0.85) !important;
  backdrop-filter: blur(30px) !important;
  -webkit-backdrop-filter: blur(30px) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: var(--radius-xl) !important;
  box-shadow: 0 30px 60px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.1) !important;
}
#apiKeyModal h2 { font-family: var(--font-display) !important; font-size: 1.5rem !important; }
#apiKeyModal input { background: rgba(0,0,0,0.3) !important; border: 1px solid rgba(255,255,255,0.1) !important; transition: border-color 0.3s !important; }
#apiKeyModal input:focus { border-color: var(--neon-cyan) !important; box-shadow: 0 0 0 1px var(--neon-cyan) !important; }
#saveKeyBtn { background: linear-gradient(135deg, var(--neon-green), var(--neon-cyan)) !important; color: #000 !important; }

/* Hide skip link properly */
.skip-link { position: absolute; top: -100px; left: 0; background: var(--neon-green); color: #000; padding: 10px; z-index: 1000; transition: top 0.2s; }
.skip-link:focus { top: 0; }
