/* ================================
   GUN TOKEN PRICE OVERLAY
   ================================ */

/* Basic reset for this page */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

/* Let the global background + static from base.css show through */
body {
  background: transparent;
  font-family: "Kode Mono", monospace;
  color: #e5e7eb;
  line-height: 1.45;
  -webkit-font-smoothing: subpixel-antialiased;
  text-rendering: geometricPrecision;
}

/* ================================
   Outer overlay container
   ================================ */

#gun-overlay {
  width: 520px;
  max-width: 100vw;
  padding: 18px 20px 16px;
}

/* Header */

.header {
  margin-bottom: 12px;
}

.title {
  font-family: "Kode Mono", monospace;
  font-size: 14px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #e5e7eb;
}

/* ================================
   Token card
   ================================ */

/* Card container */
#gun-token-section {
  position: relative;
  overflow: hidden; /* clip the ::before image to rounded corners */

  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  padding: 16px 18px 14px;

  /* base dark gradient behind everything */
  background: radial-gradient(circle at top left, #020617, #020314);

  display: flex;
  flex-direction: column;
  row-gap: 14px;
}

/* Background image layer */
#gun-token-section::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit; /* match card corners */

  background: url("/public/assets/gunzilla_faded_background.jpg")
    center/cover no-repeat;

  opacity: 0.15;          /* <-- adjust this for more/less image visibility */
  pointer-events: none;
  z-index: 0;
}

/* Ensure content sits above the image layer */
#gun-token-section > * {
  position: relative;
  z-index: 1;
}
/* Block that JS fills with price + cap + vol */
#gun-price {
  padding-right: 0;
}

/* ================================
   Metrics block
   ================================ */

.gun-metrics {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* === GUN label with faded token icon behind text === */

.gun-metric-main {
  position: relative; /* ensure a sane stacking context for the label + icon */
}

.gun-label {
  position: relative;
  z-index: 1;              /* keep the text above the icon */
  padding: 2px 8px;        /* tiny padding so the icon has room under the word */
  line-height: 1.3;
}

/* Faded token icon behind "GUN" */
.gun-label::before {
  content: "";
  position: absolute;
  left: 63%;
  top: 50%;
  width: 50px;             /* adjust size as needed */
  height: 50px;
  transform: translate(-50%, -55%); /* center under text, nudged up slightly */

  background: url("/public/assets/tokens/gun.webp")
    center / contain no-repeat;

  opacity: 0.22;           /* stronger/weaker presence: 0.15–0.35 is a good range */
  pointer-events: none;
  z-index: -1;             /* sit behind the text but inside the label box */

  /* optional: a bit of shadow so it doesn’t wash out */
  filter: drop-shadow(0 0 6px rgba(15, 23, 42, 0.9));
}

.gun-price {
  font-weight: 700;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  display: inline-block;
}

/* Flip animation when price changes */
.gun-price.flip-animate {
  animation: price-flip 0.35s ease-out;
}

@keyframes price-flip {
  0% {
    transform: translateY(6px);
    opacity: 0;
  }
  100% {
    transform: translateY(0px);
    opacity: 1;
  }
}

.gun-change {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gun-change.positive {
  color: #4ade80;
}

.gun-change.negative {
  color: #f97373;
}

/* Mkt cap / Vol grid */

.gun-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 24px;
}

.metric {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #6b7280;
  margin-bottom: 2px;
}

.metric-value {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ================================
   Sparklines row (under price)
   ================================ */

#gun-sparkline {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.sparkline-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 0;
  min-width: 0;
}

.sparkline-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #6b7280;
}

/* chart box */
.sparkline-chart {
  width: 90%;
  height: 45px; /* condensed vertically */
  padding: 0px 0px 0px 0px;
  box-sizing: border-box;
}

/* Text stats under the chart (Δ1H, 24H change, high, low) */
.sparkline-stat {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 6px;
}

.sparkline-stat-line {
  line-height: 1.5;
}

/* Extra space to keep stats clearly under their sparkline */
#gun-sparkline-live-stat {
  margin-top: 8px;
}

#gun-sparkline-24h-stat {
  margin-top: 8px;
}

/* Stack sparklines vertically on very small widths */
@media (max-width: 480px) {
  #gun-sparkline {
    flex-direction: column;
    gap: 10px;
  }

  .sparkline-chart {
    height: 64px;
  }
}

/* ================================
   SVG sparkline styling
   ================================ */

.sparkline-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* line */
.sparkline-path {
  fill: none;
  stroke-width: 1.5;
  stroke: #6b7280;
  stroke-linejoin: round;
  stroke-linecap: round;
}

/* area under 24h curve */
.sparkline-area {
  fill: rgba(107, 114, 128, 0.22);
  stroke: none;
}

.sparkline-area.positive {
  fill: rgba(77, 217, 179, 0.18);
}

.sparkline-area.negative {
  fill: rgba(235, 21, 174, 0.18);
}

/* zero line */
.sparkline-zero-line {
  stroke: rgba(148, 163, 184, 0.85);
  stroke-width: 0.6;
}

/* end dot on live sparkline */
.sparkline-end-dot {
  fill: #4dd9b3;
  animation: spark-end-blink 0.8s ease-in-out infinite;
}

/* Animations for line draw + dot blink */

@keyframes spark-draw {
  from {
    stroke-dashoffset: 140;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes spark-end-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

/* ================================
   Readability tweaks / overrides
   ================================ */

/* Global text a bit brighter */
body {
  color: #f4f4f5; /* almost-white, still soft */
}

/* Header: GUN TOKEN PRICE ACTION – larger + brighter */
.title {
  font-family: "Kode Mono", monospace;
  font-size: 14px;                 /* was ~11px */
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #e5e7eb;                  /* brighter */
}

/* Primary price row */
.gun-label {
  color: rgba(203, 213, 225, 0.9); /* lighter grey */
  font-size: 11px;
}

.gun-price {
  color: #f9fafb;                  /* bright for $ price */
}

.gun-change {
  color: #fbbf24;                  /* base color, still overridden by .positive/.negative */
}

/* Mkt Cap / Vol labels + values */
.metric-label {
  color: rgba(203, 213, 225, 0.9); /* brighter grey */
  font-size: 11px;
}

.metric-value {
  color: #f3f4f6;                  /* brighter numbers */
}

/* Sparkline labels */
.sparkline-label {
  color: rgba(203, 213, 225, 0.9);
  font-size: 11px;
}

/* Δ1H / Δ24H / High / Low text */
.sparkline-stat {
  color: #e5e7eb;
  font-size: 11px;
}

.sparkline-stat-line {
  line-height: 1.3;
}

/* Optional: Δ1H label if you’re using a separate class */
.delta-1h-label {
  color: rgba(203, 213, 225, 0.9);
  font-size: 11px;
}
