/* ============================================================
   OIL PULSE DASHBOARD — Ultra Premium Dark Industrial Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@300;400;500;700&family=JetBrains+Mono:wght@400;700&display=swap');

/* ─── CSS Variables ──────────────────────────────────────── */
:root {
  --bg-void:       #040608;
  --bg-deep:       #080c10;
  --bg-surface:    #0d1318;
  --bg-card:       #111820;
  --bg-card-hover: #161f28;
  --border:        rgba(255,165,0,0.12);
  --border-glow:   rgba(255,140,0,0.35);

  --oil:       #ff8c00;
  --oil-light: #ffb347;
  --oil-dim:   rgba(255,140,0,0.15);
  --oil-glow:  0 0 30px rgba(255,140,0,0.3);

  --gas:    #00d4ff;
  --gas-dim: rgba(0,212,255,0.12);

  --danger: #ff3b3b;
  --safe:   #00e676;

  --text-primary:   #f0ead6;
  --text-secondary: #8a9ab0;
  --text-muted:     #455060;

  --font-display: 'Bebas Neue', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --transition: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-void);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ─── Background FX ──────────────────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(255,100,0,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(0,180,255,0.05) 0%, transparent 60%),
    repeating-linear-gradient(0deg, transparent, transparent 59px, rgba(255,140,0,0.02) 60px),
    repeating-linear-gradient(90deg, transparent, transparent 59px, rgba(255,140,0,0.02) 60px);
  pointer-events: none;
  z-index: 0;
}

/* ─── Header ─────────────────────────────────────────────── */
header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(4,6,8,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}

.header-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 70px;
}

.logo {
  display: flex; align-items: center; gap: 12px;
}

.logo-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--oil), #ff4500);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  box-shadow: 0 0 20px rgba(255,140,0,0.5);
  animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(255,140,0,0.5); }
  50%       { box-shadow: 0 0 35px rgba(255,140,0,0.9), 0 0 60px rgba(255,140,0,0.3); }
}

.logo-text {
  display: flex; flex-direction: column;
}

.logo-title {
  font-family: var(--font-display);
  font-size: 1.6rem; letter-spacing: 2px;
  color: var(--oil);
  line-height: 1;
}

.logo-sub {
  font-size: 0.6rem; letter-spacing: 4px; text-transform: uppercase;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.header-status {
  display: flex; align-items: center; gap: 20px;
}

.live-badge {
  display: flex; align-items: center; gap: 7px;
  background: rgba(0,230,118,0.1);
  border: 1px solid rgba(0,230,118,0.3);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.7rem; font-family: var(--font-mono);
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--safe);
}

.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--safe);
  animation: liveBlink 1.2s ease-in-out infinite;
}

@keyframes liveBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.3; transform: scale(0.7); }
}

.clock {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ─── Main Layout ────────────────────────────────────────── */
main {
  position: relative; z-index: 1;
  max-width: 1400px; margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
}

/* ─── Section Titles ─────────────────────────────────────── */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.65rem; letter-spacing: 4px;
  text-transform: uppercase; color: var(--oil);
  margin-bottom: 0.5rem;
  display: flex; align-items: center; gap: 10px;
}

.section-label::after {
  content: '';
  flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--oil-dim), transparent);
}

/* ─── Hero KPI Strip ─────────────────────────────────────── */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
  margin-bottom: 2.5rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.8rem;
  position: relative; overflow: hidden;
  cursor: default;
  transition: transform 0.3s var(--transition), border-color 0.3s, box-shadow 0.3s;
  animation: cardReveal 0.6s var(--transition) both;
}

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.kpi-card:nth-child(1) { animation-delay: 0.05s; }
.kpi-card:nth-child(2) { animation-delay: 0.12s; }
.kpi-card:nth-child(3) { animation-delay: 0.19s; }
.kpi-card:nth-child(4) { animation-delay: 0.26s; }

.kpi-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--oil), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.kpi-card:hover::before { opacity: 1; }

.kpi-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: var(--oil-glow), 0 20px 40px rgba(0,0,0,0.4);
  background: var(--bg-card-hover);
}

.kpi-card .accent-bg {
  position: absolute; right: -10px; bottom: -10px;
  width: 90px; height: 90px; border-radius: 50%;
  opacity: 0.06;
  transition: opacity 0.3s, transform 0.3s;
}

.kpi-card:hover .accent-bg { opacity: 0.12; transform: scale(1.2); }

.kpi-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 0.8rem;
}

.kpi-icon {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  background: var(--oil-dim);
  border: 1px solid var(--border);
}

.kpi-change {
  font-family: var(--font-mono);
  font-size: 0.72rem; font-weight: 700;
  padding: 3px 8px; border-radius: 20px;
}

.kpi-change.up   { color: var(--safe);   background: rgba(0,230,118,0.1); }
.kpi-change.down { color: var(--danger); background: rgba(255,59,59,0.1); }

.kpi-value {
  font-family: var(--font-display);
  font-size: 2.6rem; letter-spacing: 1px;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 0.3rem;
}

.kpi-label {
  font-size: 0.75rem; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 1px;
}

/* ─── Ticker ─────────────────────────────────────────────── */
.ticker-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0;
  overflow: hidden;
  margin-bottom: 2.5rem;
  position: relative;
}

.ticker-wrap::before,
.ticker-wrap::after {
  content: '';
  position: absolute; top: 0; bottom: 0; width: 80px;
  z-index: 2;
}

.ticker-wrap::before { left: 0; background: linear-gradient(90deg, var(--bg-surface), transparent); }
.ticker-wrap::after  { right: 0; background: linear-gradient(-90deg, var(--bg-surface), transparent); }

.ticker-inner {
  display: flex; gap: 0; white-space: nowrap;
  animation: tickerScroll 40s linear infinite;
}

@keyframes tickerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 0 2rem;
  border-right: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 0.78rem;
}

.ticker-item .t-name { color: var(--text-secondary); }
.ticker-item .t-price { color: var(--text-primary); font-weight: 700; }
.ticker-item .t-chg.up   { color: var(--safe); }
.ticker-item .t-chg.down { color: var(--danger); }

/* ─── Chart Grid ─────────────────────────────────────────── */
.chart-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  animation: cardReveal 0.6s var(--transition) 0.3s both;
}

.chart-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.5rem;
}

.chart-title {
  font-family: var(--font-display);
  font-size: 1.4rem; letter-spacing: 1px;
  color: var(--text-primary);
}

.chart-filters {
  display: flex; gap: 6px;
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.65rem; letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--oil-dim);
  border-color: var(--oil);
  color: var(--oil);
}

.canvas-wrap {
  position: relative;
  height: 240px;
}

/* ─── Gauge Cards ────────────────────────────────────────── */
.gauge-stack {
  display: flex; flex-direction: column; gap: 1.2rem;
}

.gauge-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.3rem 1.5rem;
  animation: cardReveal 0.6s var(--transition) 0.4s both;
}

.gauge-top {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 0.9rem;
}

.gauge-name {
  font-family: var(--font-mono);
  font-size: 0.7rem; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text-secondary);
}

.gauge-val {
  font-family: var(--font-display);
  font-size: 1.6rem; color: var(--oil);
}

.gauge-bar {
  height: 8px; background: rgba(255,255,255,0.05);
  border-radius: 4px; overflow: hidden;
  position: relative;
}

.gauge-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--oil), var(--oil-light));
  box-shadow: 0 0 10px rgba(255,140,0,0.6);
  width: 0;
  transition: width 1.5s cubic-bezier(0.22, 0.61, 0.36, 1);
  position: relative;
}

.gauge-fill::after {
  content: '';
  position: absolute; right: 0; top: -2px;
  width: 4px; height: 12px;
  background: white; border-radius: 2px;
  opacity: 0.8;
}

.gauge-ticks {
  display: flex; justify-content: space-between;
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 0.58rem; color: var(--text-muted);
}

/* ─── Bottom Grid ────────────────────────────────────────── */
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

/* ─── Map Card ───────────────────────────────────────────── */
.map-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  animation: cardReveal 0.6s var(--transition) 0.5s both;
}

.map-visual {
  width: 100%; height: 180px;
  border-radius: var(--radius-md);
  background: var(--bg-deep);
  border: 1px solid var(--border);
  position: relative; overflow: hidden;
  margin-bottom: 1rem;
}

.map-bg {
  width: 100%; height: 100%;
  opacity: 0.35;
  object-fit: cover;
}

.map-node {
  position: absolute;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--oil);
  box-shadow: 0 0 0 0 rgba(255,140,0,0.7);
  animation: mapPulse 2s ease-out infinite;
  cursor: pointer;
}

@keyframes mapPulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,140,0,0.7); }
  70%  { box-shadow: 0 0 0 12px rgba(255,140,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,140,0,0); }
}

.map-node:nth-child(2) { animation-delay: 0.4s; background: var(--gas); box-shadow-color: var(--gas); }
.map-node:nth-child(3) { animation-delay: 0.8s; }
.map-node:nth-child(4) { animation-delay: 1.2s; background: var(--danger); }

.producer-list { display: flex; flex-direction: column; gap: 8px; }

.producer-row {
  display: flex; align-items: center; gap:10px;
  padding: 8px 10px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}

.producer-row:hover { border-color: var(--border-glow); }

.producer-flag { font-size: 1.1rem; }

.producer-name {
  flex: 1; font-size: 0.78rem;
  color: var(--text-secondary);
}

.producer-bbl {
  font-family: var(--font-mono);
  font-size: 0.72rem; color: var(--oil);
  font-weight: 700;
}

/* ─── News Card ──────────────────────────────────────────── */
.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  animation: cardReveal 0.6s var(--transition) 0.6s both;
}

.news-list { display: flex; flex-direction: column; gap: 10px; margin-top: 1rem; }

.news-item {
  padding: 10px 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--oil);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.news-item:hover { background: var(--bg-card-hover); transform: translateX(3px); }
.news-item.gas    { border-color: var(--gas); }
.news-item.danger { border-color: var(--danger); }

.news-time {
  font-family: var(--font-mono);
  font-size: 0.6rem; color: var(--text-muted);
  margin-bottom: 3px;
}

.news-text {
  font-size: 0.78rem; color: var(--text-secondary);
  line-height: 1.4;
}

/* ─── Donut Card ─────────────────────────────────────────── */
.donut-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  animation: cardReveal 0.6s var(--transition) 0.55s both;
  display: flex; flex-direction: column;
}

.donut-wrap {
  position: relative;
  width: 160px; height: 160px;
  margin: 1rem auto;
}

.donut-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
}

.donut-center-val {
  font-family: var(--font-display);
  font-size: 1.8rem; color: var(--oil);
}

.donut-center-label {
  font-size: 0.58rem; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text-muted);
}

.donut-legend {
  display: flex; flex-direction: column; gap: 7px;
  margin-top: 0.5rem;
}

.legend-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}

.legend-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}

.legend-name { font-size: 0.73rem; color: var(--text-secondary); flex: 1; }

.legend-pct {
  font-family: var(--font-mono);
  font-size: 0.72rem; color: var(--text-primary); font-weight: 700;
}

/* ─── SEO Text Section ───────────────────────────────────── */
.seo-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 3.5rem;
  animation: cardReveal 0.6s var(--transition) 0.7s both;
}

.seo-section h1 {
  font-family: var(--font-display);
  font-size: 2.8rem; letter-spacing: 2px;
  color: var(--oil);
  margin-bottom: 0.5rem;
  line-height: 1.1;
}

.seo-section h2 {
  font-family: var(--font-display);
  font-size: 1.6rem; letter-spacing: 1px;
  color: var(--text-primary);
  margin: 2rem 0 0.8rem;
}

.seo-section p {
  color: var(--text-secondary);
  font-size: 0.95rem; line-height: 1.85;
  max-width: 900px;
  margin-bottom: 1rem;
}

.seo-section strong { color: var(--oil-light); }

.seo-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 1.5rem;
}

.seo-tag {
  background: var(--oil-dim);
  border: 1px solid var(--border);
  color: var(--oil-light);
  padding: 4px 12px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.65rem; letter-spacing: 1px;
}

/* ─── Footer ─────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  position: relative; z-index: 1;
}

footer p {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  letter-spacing: 1px;
  line-height: 2;
}

footer p strong { color: var(--text-secondary); }

/* ─── Loader ─────────────────────────────────────────────── */
#loader {
  position: fixed; inset: 0;
  background: var(--bg-void);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s, visibility 0.5s;
}

#loader.hidden { opacity: 0; visibility: hidden; }

.loader-logo {
  font-family: var(--font-display);
  font-size: 3rem; letter-spacing: 6px;
  color: var(--oil);
  animation: loaderPulse 1.5s ease-in-out infinite;
  margin-bottom: 2rem;
}

@keyframes loaderPulse {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 1; }
}

.loader-bar {
  width: 200px; height: 2px;
  background: rgba(255,140,0,0.15);
  border-radius: 2px; overflow: hidden;
}

.loader-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--oil), var(--oil-light));
  border-radius: 2px;
  animation: loaderSlide 1.8s ease-in-out forwards;
}

@keyframes loaderSlide {
  0%   { width: 0%; }
  100% { width: 100%; }
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  .kpi-strip   { grid-template-columns: repeat(2, 1fr); }
  .chart-grid  { grid-template-columns: 1fr; }
  .bottom-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .kpi-strip   { grid-template-columns: 1fr 1fr; }
  .bottom-grid { grid-template-columns: 1fr; }
  main         { padding: 1.5rem 1rem 3rem; }
  .seo-section { padding: 2rem 1.5rem; }
  .seo-section h1 { font-size: 2rem; }
  .header-inner { height: 60px; }
  .clock        { display: none; }
}