/* ============================================
   LithiumInverter.in — Main Stylesheet
   India's Battery Intelligence Hub
   ============================================ */

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #1c2128;
  --border: #30363d;
  --accent: #f59e0b;
  --accent-hover: #fbbf24;
  --text-primary: #f0f6fc;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --green: #3fb950;
  --red: #f85149;
  --blue: #58a6ff;
  --nav-height: 64px;
  --ticker-height: 40px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 15px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* ---- PRICE TICKER ---- */
.ticker-bar {
  background: #111827;
  border-bottom: 1px solid var(--border);
  height: var(--ticker-height);
  overflow: hidden;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 200;
}
.ticker-label {
  background: var(--accent);
  color: #000;
  font-weight: 700;
  font-size: 11px;
  padding: 4px 12px;
  white-space: nowrap;
  height: 100%;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.ticker-track {
  display: flex;
  animation: ticker-scroll 40s linear infinite;
  white-space: nowrap;
  gap: 0;
}
.ticker-track:hover { animation-play-state: paused; }
.ticker-item {
  padding: 0 28px;
  font-size: 13px;
  color: var(--text-primary);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--ticker-height);
}
.ticker-item .label { color: var(--text-secondary); font-size: 12px; }
.ticker-item .value { font-weight: 600; }
.ticker-item .change.up { color: var(--green); }
.ticker-item .change.down { color: var(--red); }
@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ---- NAVIGATION ---- */
nav {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  position: sticky;
  top: var(--ticker-height);
  z-index: 100;
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 24px;
}
.logo {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.logo-main {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}
.logo-main span { color: var(--accent); }
.logo-sub {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  flex-wrap: wrap;
}
.nav-links a {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.15s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text-primary);
  background: rgba(245,158,11,0.12);
  text-decoration: none;
}
.nav-date {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---- LAYOUT ---- */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}
.page-wrapper {
  padding: 32px 0 64px;
}

/* ---- HERO BANNER ---- */
.hero {
  background: linear-gradient(135deg, #1a2035 0%, #0d1117 60%);
  border-bottom: 1px solid var(--border);
  padding: 40px 0 32px;
  margin-bottom: 32px;
}
.hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}
.hero-tag {
  display: inline-block;
  background: var(--accent);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 3px;
  margin-bottom: 14px;
}
.hero h1 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-primary);
  max-width: 680px;
  margin-bottom: 12px;
}
.hero p {
  color: var(--text-secondary);
  font-size: 15px;
  max-width: 560px;
  margin-bottom: 20px;
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.hero-meta span { display: flex; align-items: center; gap: 5px; }

/* ---- SECTION HEADERS ---- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: '';
  display: block;
  width: 4px;
  height: 18px;
  background: var(--accent);
  border-radius: 2px;
}
.section-link {
  font-size: 13px;
  color: var(--accent);
}

/* ---- CARDS ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}
.card-grid-2 { grid-template-columns: repeat(2, 1fr); }
.card-grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover {
  border-color: rgba(245,158,11,0.4);
  transform: translateY(-2px);
}
.card-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 10px;
  background: rgba(245,158,11,0.15);
  color: var(--accent);
}
.card-tag.india { background: rgba(34,197,94,0.12); color: #4ade80; }
.card-tag.global { background: rgba(96,165,250,0.12); color: #60a5fa; }
.card-tag.policy { background: rgba(167,139,250,0.12); color: #a78bfa; }
.card-tag.tech { background: rgba(251,146,60,0.12); color: #fb923c; }
.card-tag.market { background: rgba(34,211,238,0.12); color: #22d3ee; }
.card h3 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}
.card-source { font-weight: 500; }

/* ---- FEATURED CARD ---- */
.card-featured {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.card-featured .card-content { display: flex; flex-direction: column; }
.card-featured h3 { font-size: 20px; }
.card-featured p { -webkit-line-clamp: 5; }

/* ---- PRICE TABLE ---- */
.price-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 40px;
}
.price-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}
.price-card .p-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.price-card .p-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1;
}
.price-card .p-unit {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.price-card .p-change {
  font-size: 13px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
}
.p-change.up { background: rgba(63,185,80,0.15); color: var(--green); }
.p-change.down { background: rgba(248,81,73,0.15); color: var(--red); }
.p-change.flat { background: rgba(139,148,158,0.15); color: var(--text-secondary); }
.price-card .p-source {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ---- BESS TRACKER TABLE ---- */
.tracker-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 40px;
}
.tracker-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tracker-table th {
  background: #1a2035;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tracker-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #21262d;
  color: var(--text-secondary);
  vertical-align: top;
}
.tracker-table tr:last-child td { border-bottom: none; }
.tracker-table tr:hover td { background: rgba(255,255,255,0.02); }
.tracker-table .project-name { color: var(--text-primary); font-weight: 500; }
.status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.status-badge.awarded { background: rgba(63,185,80,0.15); color: var(--green); }
.status-badge.tendered { background: rgba(245,158,11,0.15); color: var(--accent); }
.status-badge.construction { background: rgba(96,165,250,0.15); color: var(--blue); }
.status-badge.commissioned { background: rgba(167,139,250,0.15); color: #a78bfa; }

/* ---- CHEMISTRY CARDS ---- */
.chem-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 40px;
}
.chem-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.chem-card:hover { border-color: var(--accent); }
.chem-symbol {
  font-size: 28px;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 4px;
  line-height: 1;
}
.chem-name { font-size: 11px; color: var(--text-muted); margin-bottom: 12px; }
.chem-stat { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.chem-stat .s-label { color: var(--text-muted); }
.chem-stat .s-value { color: var(--text-primary); font-weight: 500; }

/* ---- NEWS ARTICLE PAGE ---- */
.article-header { margin-bottom: 28px; }
.article-header h1 {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 12px;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.article-body h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 28px 0 10px;
  color: var(--text-primary);
  padding-left: 14px;
  border-left: 3px solid var(--accent);
}
.article-body p {
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.75;
}
.article-body .source-line {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: -8px;
  margin-bottom: 20px;
}
.article-body .source-line a { color: var(--blue); }

/* ---- SIDEBAR LAYOUT ---- */
.content-sidebar {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}
.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 20px;
}
.sidebar-widget h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sidebar-item {
  padding: 10px 0;
  border-bottom: 1px solid #21262d;
  font-size: 13px;
}
.sidebar-item:last-child { border-bottom: none; }
.sidebar-item .si-label { color: var(--text-muted); font-size: 11px; margin-bottom: 2px; }
.sidebar-item .si-value { color: var(--text-primary); font-weight: 600; }
.sidebar-item .si-change { font-size: 12px; font-weight: 500; }

/* ---- FOOTER ---- */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  margin-top: 64px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 32px;
  border-bottom: 1px solid var(--border);
}
.footer-brand .logo-main { font-size: 22px; margin-bottom: 8px; }
.footer-brand p { font-size: 13px; color: var(--text-muted); line-height: 1.6; max-width: 280px; }
.footer-col h5 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-primary);
  margin-bottom: 14px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: var(--text-muted); font-size: 13px; }
.footer-col a:hover { color: var(--accent); text-decoration: none; }
.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}
.footer-note {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.footer-note strong { color: var(--accent); }

/* ---- DRAFT BADGE ---- */
.draft-notice {
  background: rgba(248,81,73,0.1);
  border: 1px solid rgba(248,81,73,0.3);
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 13px;
  color: #f85149;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.draft-notice::before { content: '⚠'; }

/* ---- STAT BANNER ---- */
.stat-banner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}
.stat-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}
.stat-item .s-num {
  font-size: 30px;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-item .s-label { font-size: 12px; color: var(--text-muted); }

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .price-grid { grid-template-columns: repeat(3, 1fr); }
  .chem-grid { grid-template-columns: repeat(3, 1fr); }
  .content-sidebar { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stat-banner { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .card-grid { grid-template-columns: 1fr; }
  .card-featured { grid-column: span 1; grid-template-columns: 1fr; }
  .price-grid { grid-template-columns: repeat(2, 1fr); }
  .chem-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
  .hero h1 { font-size: 24px; }
  .footer-grid { grid-template-columns: 1fr; }
}
