/* ═══════════════════════════════════════════════════════════════════════════
   WattCost EV Section — ev.css
   Electric blue palette overrides. Load after app.css on all /ev/ pages.
   Primary  #3b7dd8  Light  #5b9cf6  Dark  #1e4a8a  Tint  #f0f6ff
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── EV Hero ─────────────────────────────────────────────────────────────── */
.ev-hero {
  background: #06120f;
  background-image:
        radial-gradient(circle at 78% 18%, rgba(87, 150, 255, 0.16), transparent 34%),
        linear-gradient(135deg, #06120f 0%, #0b1f22 45%, #10253a 100%);
  color: #fff;
  padding: 1.1rem 1.5rem 1rem;
  position: relative;
  overflow: hidden;
}

.ev-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 90% 50%, rgba(91,156,246,0.12) 0%, transparent 60%);
  pointer-events: none;
}

.ev-hero .hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  display: block;
  height: auto !important;
  min-height: 0 !important;
}

.ev-hero h1 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 600;
  color: #fff;
  margin: 0.3rem 0 0.4rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.ev-hero h1 .accent {
  color: #5dcba7;
}

.ev-hero .hero-sub {
  font-size: 0.82rem;
  color: #c8daf0;
  max-width: 560px;
  line-height: 1.5;
  margin: 0;
}

/* ── Breadcrumb inside ev-hero — strip any dark box from app.css ─────────── */
.ev-hero .breadcrumb,
.ev-hero nav.breadcrumb {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 0 0.3rem !important;
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  position: static !important;
  align-items: unset !important;
  justify-content: unset !important;
  flex-direction: unset !important;
}

.ev-hero .breadcrumb a {
  color: #9db8d8;
  text-decoration: none;
}

.ev-hero .breadcrumb a:hover {
  color: #5b9cf6;
}

/* ── EV Section Badge ────────────────────────────────────────────────────── */
.ev-section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(91,156,246,0.15);
  border: 1px solid rgba(91,156,246,0.3);
  color: #53cca9;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.18rem 0.55rem;
  border-radius: 20px;
  margin-bottom: 0.3rem;
}

/* ── Hub Tool Cards ──────────────────────────────────────────────────────── */
.ev-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.ev-tool-card {
  display: block;
  background: #fff;
  border: 1.5px solid #d0e3f8;
  border-radius: 10px;
  padding: 1.2rem 1.1rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
  position: relative;
  overflow: hidden;
}

.ev-tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b7dd8, #5b9cf6);
  opacity: 0;
  transition: opacity 0.18s;
}

.ev-tool-card:hover {
  border-color: #3b7dd8;
  box-shadow: 0 4px 16px rgba(59,125,216,0.14);
  transform: translateY(-2px);
}

.ev-tool-card:hover::before {
  opacity: 1;
}

.ev-tool-card__title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e4a8a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
  padding-left: 0.6rem;
  border-left: 3px solid #3b7dd8;
}

.ev-tool-card__desc {
  font-size: 0.82rem;
  color: #555;
  line-height: 1.45;
}

.ev-tool-card__arrow {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: #2558a8;
  font-weight: 600;
}

/* ── EV Stat Strip (hub page) ────────────────────────────────────────────── */
.ev-stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: #d0e3f8;
  border: 1.5px solid #d0e3f8;
  border-radius: 10px;
  overflow: hidden;
  margin: 1.5rem 0;
}

.ev-stat {
  background: #f0f6ff;
  padding: 1rem 1.1rem;
  text-align: center;
}

.ev-stat__value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e4a8a;
  line-height: 1.1;
}

.ev-stat__label {
  font-size: 0.74rem;
  color: #2d4a7a;
  margin-top: 0.2rem;
  line-height: 1.3;
}

/* ── Rate Badge Override (blue) ──────────────────────────────────────────── */
.ev-page .rate-badge {
  background: rgba(59,125,216,0.12);
  border-color: rgba(59,125,216,0.35);
  color: #143670;
}

.ev-page .rate-badge:hover {
  background: rgba(59,125,216,0.18);
}

/* ── Results Grid Override (blue highlight) ──────────────────────────────── */
.ev-page .result-cell.highlight {
  background: #f0f6ff;
  border-color: #2558a8;
}

.ev-page .result-cell.highlight .result-value {
  color: #1e4a8a;
}

/* ── EV-specific Result Boxes ────────────────────────────────────────────── */
.ev-results-box {
  border: 1.5px solid #3b7dd8;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.ev-results-box__head {
  background: #1e4a8a;
  color: #fff;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.45rem 1rem;
}

.ev-results-box__body {
  background: #f0f6ff;
  padding: 0.9rem 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.5rem;
}

.ev-result-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.ev-result-cell__value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.2rem;
  font-weight: 600;
  color: #1e4a8a;
  line-height: 1.1;
}

.ev-result-cell__value--lg {
  font-size: 1.5rem;
}

.ev-result-cell__label {
  font-size: 0.7rem;
  color: #2d4a7a;
  text-align: center;
}

/* ── EV CO₂ block (inherits green, just note override if needed) ─────────── */
/* CO₂ block stays green — carbon is carbon regardless of section */

/* ── EV Comparison Table (vs-gas, level-comparison) ─────────────────────── */
.ev-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.ev-compare-table th {
  background: #1e4a8a;
  color: #fff;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.6rem 0.8rem;
  text-align: left;
}

.ev-compare-table th.col-l1 { background: #4a6a9a; }
.ev-compare-table th.col-l2 { background: #3b7dd8; }
.ev-compare-table th.col-l2f { background: #2d6cc0; }
.ev-compare-table th.col-dc { background: #1e4a8a; }
.ev-compare-table th.col-ultra { background: #0f1f42; }

.ev-compare-table td {
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid #e0ecff;
  vertical-align: middle;
}

.ev-compare-table tr:last-child td { border-bottom: none; }

.ev-compare-table tr:nth-child(even) td {
  background: #f7faff;
}

.ev-compare-table .row-label {
  font-weight: 500;
  color: #1e4a8a;
}

/* ── EV Input Label Override ─────────────────────────────────────────────── */
.ev-page .btn-small.primary {
  background: #2558a8;
  border-color: #2558a8;
  color: #fff;
}

.ev-page .btn-small.primary:hover {
  background: #2d6cc0;
}

/* ── EV Card Accent ──────────────────────────────────────────────────────── */
.ev-page .card {
  border-color: #d0e3f8;
}

.ev-page .card-head {
  border-bottom-color: #d0e3f8;
  background: #f7faff;
}

.ev-page .card-head h2 {
  color: #1e4a8a;
}

/* ── Savings Highlight (vs-gas) ──────────────────────────────────────────── */
.ev-savings-callout {
  background: #1e4a8a;
  color: #fff;
  border-radius: 10px;
  padding: 1.2rem 1.3rem;
  text-align: center;
  margin-bottom: 1rem;
}

.ev-savings-callout__value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 2rem;
  font-weight: 600;
  color: #8bbdfa;
  line-height: 1;
  margin-bottom: 0.3rem;
}

.ev-savings-callout__label {
  font-size: 0.82rem;
  color: #dce8fa;
}

/* ── Level indicator pills ───────────────────────────────────────────────── */
.level-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
}

.level-pill--l1 { background: #e8f0fa; color: #2d4a7a; }
.level-pill--l2 { background: #dbeafe; color: #1a4a9a; }
.level-pill--dc { background: #1e4a8a; color: #fff; }

/* ── Section heading override ────────────────────────────────────────────── */
.ev-page .section-heading {
  color: #1e4a8a;
  border-bottom-color: #d0e3f8;
}

/* ── Divider in EV calc ──────────────────────────────────────────────────── */
.ev-page .divider {
  border-color: #d0e3f8;
}

/* ── Popular link override ───────────────────────────────────────────────── */
.ev-page .popular-link {
  border-color: #d0e3f8;
  color: #1e4a8a;
}

.ev-page .popular-link:hover {
  background: #f0f6ff;
  border-color: #3b7dd8;
  color: #2558a8;
}

/* ── Input focus override ────────────────────────────────────────────────── */
.ev-page .input-field:focus,
.ev-page .select-field:focus,
.ev-page .manual-input:focus {
  border-color: #3b7dd8;
  box-shadow: 0 0 0 3px rgba(59,125,216,0.12);
}

/* ── Preset button override ──────────────────────────────────────────────── */
.ev-page .preset-btn.active {
  background: #2558a8;
  border-color: #2558a8;
  color: #fff;
}

.ev-page .preset-btn:hover {
  border-color: #3b7dd8;
  color: #2558a8;
}

/* ── ref-table co2 cell override for EV pages ───────────────────────────── */
.ev-page .co2-ref-th,
.ev-page .co2-ref-cell {
  color: #2d7a5e; /* keep green — it's still carbon data */
}

/* ────────────────────────────────────────────────
   EV Charging Levels — Mobile Table Fix
   ──────────────────────────────────────────────── */

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Calculator results: turn rows into compact mobile cards */
@media (max-width: 640px) {

  #lc-results-table {
    border-collapse: collapse;
    border-spacing: 0;
    margin-bottom: 0;
  }

  #lc-results-table thead {
    display: none;
  }

  #lc-results-table,
  #lc-results-table tbody,
  #lc-results-table tr,
  #lc-results-table td {
    display: block;
    width: 100%;
  }

  #lc-results-table tr {
    background: #f7faff;
    border: 1px solid #d0e3f8;
    border-radius: 10px;
    overflow: hidden;
    margin: 0 0 0.75rem 0;
  }

  #lc-results-table tr:last-child {
    margin-bottom: 0;
  }

  #lc-results-table tr:nth-child(even) td {
    background: transparent;
  }

  #lc-results-table td {
    border-bottom: 1px solid #e0ecff;
    padding: 0.55rem 0.75rem;
    font-size: 0.82rem;
    white-space: normal;
  }

  #lc-results-table td:last-child {
    border-bottom: none;
  }

  /* Hide Power and km/hour on mobile */
  #lc-results-table td:nth-child(2),
  #lc-results-table td:nth-child(4) {
    display: none;
  }

  #lc-results-table td:nth-child(1) {
    background: #2c3e50 !important;
    color: #fff !important;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    font-size: 0.78rem;
  }

  #lc-results-table td:nth-child(3)::before {
    content: "Time to charge";
  }

  #lc-results-table td:nth-child(5)::before {
    content: "Session cost";
  }

  #lc-results-table td:nth-child(3),
  #lc-results-table td:nth-child(5) {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: baseline;
    font-weight: 600;
  }

  #lc-results-table td:nth-child(3)::before,
  #lc-results-table td:nth-child(5)::before {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #59708c;
    font-weight: 600;
  }
}

/* Reference table: keep compact comparison on mobile */
@media (max-width: 640px) {

  #lc-ref-table {
    table-layout: fixed;
    font-size: 0.76rem;
  }

  #lc-ref-table th,
  #lc-ref-table td {
    padding: 0.5rem 0.45rem;
    white-space: normal;
    line-height: 1.25;
  }

  /* Hide Level 2 Fast */
  #lc-ref-table th:nth-child(4),
  #lc-ref-table td:nth-child(4) {
    display: none;
  }

  /* Hide DC Ultra Fast */
  #lc-ref-table th:nth-child(6),
  #lc-ref-table td:nth-child(6) {
    display: none;
  }

  #lc-ref-table th:nth-child(1),
  #lc-ref-table td:nth-child(1) {
    width: 28%;
  }

  #lc-ref-table th:nth-child(2),
  #lc-ref-table td:nth-child(2),
  #lc-ref-table th:nth-child(3),
  #lc-ref-table td:nth-child(3),
  #lc-ref-table th:nth-child(5),
  #lc-ref-table td:nth-child(5) {
    width: 24%;
  }

  #lc-ref-table .row-label {
    font-weight: 600;
  }
}

/* ── EV Section Navigation ─────────────────────────────────────────────────
   Explicitly resets app.css global nav rules so this mini-nav does not become
   sticky or overlap the main navigation/content.
   ───────────────────────────────────────────────────────────────────────── */
.ev-subnav {
  position: static !important;
  top: auto !important;
  z-index: 1 !important;
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  margin: 0;
  background: #06120f;
  border-bottom: 1px solid rgba(91,156,246,0.24);
  padding: 0.85rem 1.5rem 0.95rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem;
  flex-wrap: wrap;
  box-shadow: none !important;
}

.ev-subnav a {
  flex: 0 0 auto;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  color: #d9f5ec;
  background: rgba(91,156,246,0.10);
  border: 1px solid rgba(91,156,246,0.36);
  border-radius: 999px;
  padding: 0.38rem 0.75rem;
  text-decoration: none;
  line-height: 1.2;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.ev-subnav a:hover,
.ev-subnav a:focus {
  color: #ffffff;
  background: rgba(91,156,246,0.20);
  border-color: rgba(91,156,246,0.62);
}

.ev-subnav a[aria-current="page"] {
  color: #06120f;
  background: #5dcba7;
  border-color: #5dcba7;
}

@media (max-width: 640px) {
  .ev-subnav {
    justify-content: flex-start !important;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 0.75rem 1rem 0.85rem !important;
    -webkit-overflow-scrolling: touch;
  }

  .ev-subnav a {
    white-space: nowrap;
    font-size: 0.68rem;
  }
}
