/* =========================================
   Ethereum Bliss – Overview page
   Charts, top borrowers & Q&A
   ========================================= */

:root {
  --eb-surface: rgba(15, 23, 42, 0.96);
  --eb-surface-soft: rgba(15, 23, 42, 0.9);
  --eb-border: rgba(148, 163, 184, 0.25);
  --eb-muted: #c7d2fe;   /* light muted */
  --eb-accent: #7c3aed;
  --eb-accent-soft: rgba(124, 58, 237, 0.3);
  --eb-positive: #4ade80;
  --eb-strong: #e5e7eb;  /* main text */
  --eb-text: #e5e7eb;
  --eb-bg: #020617;

  --pie-uae-color: #22d3ee;
  --pie-us-color: #4ade80;
  --pie-uk-color: #fb923c;
  --pie-india-color: #a855f7;
}

/* Ensure all page text is light */
.main,
.main p,
.main h1,
.main h2,
.main h3,
.main h4,
.main li,
.main span,
.main td,
.main th {
  color: var(--eb-text);
}

/* Background with subtle gradients */
.main {
  background:
    radial-gradient(circle at top, rgba(124, 58, 237, 0.22), transparent 60%),
    radial-gradient(circle at bottom, rgba(37, 99, 235, 0.2), transparent 60%),
    var(--eb-bg);
}

.panel {
  margin-bottom: 1.9rem;
}

.topbar h1 {
  font-size: 1.65rem;
  line-height: 1.28;
}

.topbar-subline {
  max-width: 44rem;
  font-size: 0.95rem;
}

/* =============== Hero panel =============== */

.hero-panel {
  background:
    radial-gradient(circle at top left, var(--eb-accent-soft), transparent 70%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.99), rgba(15, 23, 42, 0.94));
  border-radius: 20px;
  border: 1px solid var(--eb-border);
  padding: 1.6rem 1.5rem 1.4rem;
  box-shadow:
    0 18px 52px rgba(15, 23, 42, 0.95),
    0 0 0 1px rgba(15, 23, 42, 1);
}

.hero-header .panel-title {
  margin-bottom: 0.5rem;
}

.hero-header .panel-intro {
  max-width: 46rem;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1.1rem;
}

.metric-card {
  border-radius: 18px;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background:
    radial-gradient(circle at top, rgba(15, 23, 42, 0.5), transparent 70%),
    rgba(15, 23, 42, 0.96);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.9);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.metric-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 18px 46px rgba(15, 23, 42, 0.98),
    0 0 0 1px rgba(124, 58, 237, 0.7);
  border-color: rgba(124, 58, 237, 0.95);
}

.metric-label {
  font-size: 0.82rem;
  color: var(--eb-muted);
  margin-bottom: 0.25rem;
}

.metric-value {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.1rem;
}

.metric-card p {
  font-size: 0.86rem;
  color: var(--eb-strong);
}

/* =============== Why choose us =============== */

#why-choose-us .panel-title {
  margin-bottom: 0.45rem;
}

#why-choose-us .panel-intro {
  max-width: 42rem;
}

/* =============== Pie chart section =============== */

.overview-charts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.2fr);
  gap: 1.2rem;
  margin-top: 1rem;
}

.chart-card {
  border-radius: 20px;
  border: 1px solid var(--eb-border);
  background:
    radial-gradient(circle at top left, rgba(124, 58, 237, 0.25), transparent 65%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.99), rgba(15, 23, 42, 0.93));
  padding: 1.1rem 1.1rem 1rem;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.95);
}

.pie-chart-card {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 1rem;
  align-items: center;
}

.pie-chart {
  --uae-end: 0deg;
  --us-end: 0deg;
  --uk-end: 0deg;
  --india-end: 0deg;

  width: 190px;
  height: 190px;
  border-radius: 50%;
  position: relative;
  margin: 0 auto;
  background:
    radial-gradient(circle at center, #020617 52%, transparent 54%),
    conic-gradient(
      var(--pie-uae-color) 0deg var(--uae-end),
      var(--pie-us-color) var(--uae-end) var(--us-end),
      var(--pie-uk-color) var(--us-end) var(--uk-end),
      var(--pie-india-color) var(--uk-end) var(--india-end)
    );
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 1),
    0 0 40px rgba(124, 58, 237, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.9);
  opacity: 0;
  transition:
    transform 380ms ease-out,
    opacity 380ms ease-out,
    box-shadow 320ms ease-out;
}

.pie-chart.is-ready {
  transform: scale(1);
  opacity: 1;
}

.pie-chart:hover {
  box-shadow:
    0 0 0 1px rgba(129, 140, 248, 0.9),
    0 0 55px rgba(59, 130, 246, 0.7);
}

.pie-center-label {
  position: absolute;
  text-align: center;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.98);
  font-size: 0.82rem;
  box-shadow:
    0 10px 25px rgba(15, 23, 42, 0.9),
    0 0 0 1px rgba(15, 23, 42, 1);
}

.pie-total-label {
  display: block;
  color: var(--eb-muted);
}

.pie-total-value {
  display: block;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.pie-legend {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.45rem;
  font-size: 0.82rem;
}

.pie-legend li {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  align-items: center;
  column-gap: 0.35rem;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(15, 23, 42, 0.8);
}

.legend-uae {
  background: linear-gradient(135deg, #22d3ee, #0ea5e9);
}

.legend-us {
  background: linear-gradient(135deg, #4ade80, #22c55e);
}

.legend-uk {
  background: linear-gradient(135deg, #fb923c, #f97316);
}

.legend-india {
  background: linear-gradient(135deg, #a855f7, #e879f9);
}

.legend-flag {
  font-size: 1rem;
}

.legend-country {
  font-weight: 500;
}

.legend-count {
  font-variant-numeric: tabular-nums;
  color: var(--eb-strong);
}

.legend-percent {
  font-size: 0.78rem;
  color: var(--eb-muted);
}

.narrative-card h3 {
  font-size: 0.98rem;
  margin-bottom: 0.4rem;
}

.narrative-card p {
  font-size: 0.88rem;
}

/* =============== Top borrowers table =============== */

#top-borrowers .panel-intro {
  max-width: 48rem;
}

.borrowers-table-wrapper {
  margin-top: 0.9rem;
  overflow-x: auto;
}

.borrowers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  min-width: 720px;
}

.borrowers-table thead {
  text-align: left;
}

.borrowers-table th,
.borrowers-table td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid rgba(30, 41, 59, 0.85);
}

.borrowers-table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--eb-muted);
}

.borrowers-table tbody tr:hover {
  background: radial-gradient(circle at left, rgba(124, 58, 237, 0.24), transparent 70%);
}

.borrower-cell {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.borrower-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  object-fit: cover;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 1),
    0 6px 18px rgba(15, 23, 42, 0.9);
}

.borrower-name {
  font-size: 0.88rem;
}

.borrower-tag {
  font-size: 0.78rem;
  color: var(--eb-muted);
}

.flag {
  margin-right: 0.25rem;
}

.borrower-amount {
  font-variant-numeric: tabular-nums;
  color: #f9fafb;
}

.borrower-email a {
  color: #e5e7eb;
  text-decoration: none;
}

.borrower-email a:hover {
  text-decoration: underline;
}

.masked-email {
  font-variant-numeric: tabular-nums;
  color: var(--eb-strong);
}

.overview-disclaimer {
  margin-top: 0.7rem;
  font-size: 0.8rem;
  color: var(--eb-muted);
}

/* =============== Growth graph – centred & redesigned =============== */

.growth-graph {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
}

.growth-inner {
  position: relative;
  max-width: 520px;
  width: 100%;
  border-radius: 20px;
  border: 1px solid var(--eb-border);
  background:
    radial-gradient(circle at top, rgba(56, 189, 248, 0.22), transparent 70%),
    rgba(15, 23, 42, 0.96);
  padding: 1.1rem 1rem 1rem;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.95);
  overflow: hidden;
}

/* Glowing base line under bars */
.growth-inner::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 45px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #38bdf8, #a855f7);
  opacity: 0;
  transform-origin: left;
  transform: scaleX(0.4);
  transition:
    opacity 600ms ease-out,
    transform 600ms ease-out;
}

.growth-inner.is-ready::before {
  opacity: 1;
  transform: scaleX(1);
}

.growth-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  height: 210px;
  position: relative;
}

.growth-bar {
  position: relative;
  flex: 1;
  max-width: 70px;
  border-radius: 16px 16px 10px 10px;
  background:
    linear-gradient(180deg, rgba(56, 189, 248, 0.08), rgba(15, 23, 42, 0.9)),
    linear-gradient(180deg, rgba(59, 130, 246, 0.9), rgba(14, 116, 144, 0.95));
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 1),
    0 14px 30px rgba(15, 23, 42, 0.9);
  overflow: hidden;
  height: 0;
  transition:
    height 700ms cubic-bezier(0.21, 0.85, 0.35, 0.99),
    box-shadow 200ms ease,
    transform 200ms ease;
}

.growth-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.25), transparent 40%);
  opacity: 0.7;
}

.growth-bar.is-active {
  /* Height is set inline in JS */
}

.growth-bar:hover {
  transform: translateY(-4px);
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.98),
    0 0 0 1px rgba(94, 234, 212, 0.8);
}

.growth-bar-highlight {
  background:
    linear-gradient(180deg, rgba(234, 179, 8, 0.12), rgba(15, 23, 42, 0.92)),
    linear-gradient(180deg, rgba(234, 179, 8, 0.9), rgba(220, 38, 38, 0.95));
}

.growth-bar-value {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.growth-bar-label {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.82rem;
}

.growth-notes {
  margin-top: 0.9rem;
}

.growth-notes h3 {
  font-size: 0.96rem;
  margin-bottom: 0.35rem;
}

/* =============== Q&A section =============== */

.faq-panel .panel-intro {
  max-width: 46rem;
}

.qa-grid {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.qa-item {
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background:
    radial-gradient(circle at top, rgba(15, 23, 42, 0.5), transparent 70%),
    rgba(15, 23, 42, 0.96);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.9);
  overflow: hidden;
  transition:
    box-shadow 200ms ease,
    border-color 200ms ease,
    transform 180ms ease;
}

.qa-item.is-open {
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.98),
    0 0 0 1px rgba(124, 58, 237, 0.7);
  border-color: rgba(124, 58, 237, 0.9);
  transform: translateY(-2px);
}

.qa-header {
  width: 100%;
  border: none;
  background: transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  text-align: left;
  gap: 0.6rem;
}

.qa-question {
  font-size: 0.88rem;
}

.qa-toggle {
  font-size: 1rem;
  color: var(--eb-muted);
  transition: transform 180ms ease, color 180ms ease;
}

.qa-item.is-open .qa-toggle {
  transform: rotate(45deg);
  color: var(--eb-accent);
}

.qa-body {
  padding: 0 0.85rem 0.7rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 260ms ease,
    opacity 220ms ease;
}

.qa-item.is-open .qa-body {
  max-height: 220px;
  opacity: 1;
}

.qa-body p {
  font-size: 0.85rem;
  color: var(--eb-strong);
}

/* =============== Responsive tweaks =============== */

@media (max-width: 960px) {
  .hero-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .overview-charts-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pie-chart-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .qa-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .topbar h1 {
    font-size: 1.4rem;
  }

  .growth-bars {
    gap: 0.6rem;
  }

  .growth-bar-value {
    font-size: 0.7rem;
  }

  .borrowers-table {
    font-size: 0.8rem;
  }
}
