@keyframes glitch {
  0% { text-shadow: 2px 2px #ff00ff, -3px -3px rgb(95, 235, 186); }
  50% { text-shadow: -2px -2px #ff00ff, 3px 3px rgb(95, 235, 186); }
  100% { text-shadow: 2px 2px #ff00ff, -3px -3px rgb(95, 235, 186); }
}

.glitch-effect {
  animation: glitch 1s steps(5, end);
}

#typewriter-title {
  color: rgb(255, 255, 255);
  display: inline-block;
  white-space: nowrap;
  padding-right: 10px;
  margin: 0;
  padding-bottom: 30px;
  padding-top: 20px;
  font-family: "Rubik Broken Fax", serif;
  font-weight: 400;
  font-style: normal;
  font-size: 2.7rem;
  animation: blink 0.9s step-end infinite;
} 

body {
  font-family: "Source Code Pro", monospace;
  font-optical-sizing: auto;
  font-weight: 200;
  font-style: normal;
  background-color: rgb(18, 18, 18);
  margin: 0;
  padding: 0;
  display: flex;
  height: 100vh;
  color: #fff;
}

.input-container {
  position: relative;
  z-index: 1;
  background-color: rgb(18, 18, 18);
}

#animation-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  z-index: -1;
}

#matrixCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

#fetchRoles:hover,
#fetchTransfers:hover,
#fetchMetadata:hover {
  background-color: rgb(125, 253, 254);
  color: black;
  cursor: pointer;
}

.container {
  display: flex;
  width: 100%;
}

aside {
  width: 20%;
  min-width: 200px;
  background-color: #1a1919;
  padding: 10px 20px;
  overflow-y: auto;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  max-height: calc(100vh - 40px);
  scrollbar-width: thin;
  scrollbar-color: rgba(125, 253, 254, 0.5) transparent;
}

aside::-webkit-scrollbar {
  width: 6px;
}

aside::-webkit-scrollbar-thumb {
  background: rgba(125, 253, 254, 0.5);
  border-radius: 3px;
}

aside ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

aside li {
  font-size: 0.9rem;
  margin: 5px 0;
  padding: 5px;
  border-radius: 5px;
  transition: background-color 0.3s ease;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.history-entry span {
  display: block;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo-link {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  width: 100%;
}

.center-img {
  width: 200px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.aside-center {
  display: flex;
  flex-direction: column;
  align-items: left;
  text-align: left;
}

main {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.input-container {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.input-container input {
  flex: 1;
  padding: 10px;
  font-family: inherit;
  font-size: 1rem;
  margin-right: 10px;
  border: 1px solid rgb(125, 253, 254);
  color: white;
  background: none;
  caret-color: rgb(250, 98, 132);
  height: 40px;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

.input-container input:hover {
  border-color: rgb(250, 98, 132);
  color: white;
}

.input-container input::placeholder {
  color: white;
}

.input-container button, 
#clearHistory {
  padding: 10px 10px;
  font-family: inherit;
  font-size: 1rem;
  height: 40px;
  border: 1px solid white;
  background-color: transparent;
  color: white;
  border-radius: 0;
  cursor: pointer;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-container button:hover {
  background-color: rgb(125, 253, 254); 
}

#clearHistory:hover {
  background-color: rgb(255, 103, 159);
}

.delete-btn {
  font-family: inherit;
  font-size: 0.9rem;
  background-color: transparent;
  color: rgb(255, 255, 255);
  border: 1px solid rgb(255, 255, 255);
  padding: 3px 8px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  margin-right: 10px;
}

.delete-btn:hover {
  background-color: rgb(255, 103, 159);
  color: black;
}

.history-entry {
  padding: 10px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, text-shadow 0.3s ease;
}

.history-entry:hover {
  background-color: rgb(142, 191, 191, 0.3);
}

.history-entry.selected {
  background-color: rgb(142, 191, 191);
  text-shadow: 2px 2px rgb(255, 103, 159), -0.15px -0.15px;
  transition: text-shadow 0.5s ease;
}

.history-entry.selected .delete-btn {
  background-color: transparent;
}

#results {
  white-space: pre-wrap;
  padding-top: 10px;
  color: white;
  margin: 0; 
  padding: 0;
}

#results div {
  box-shadow: 2px 2px 4px rgb(125, 253, 254);
  margin-bottom: 15px;
  padding: 10px;
}

#results strong {
  color: rgb(125, 253, 254);
  font-weight: bold;
  display: inline-block;
  margin-bottom: 2px;
}

#results div br {
  margin-bottom: 0px;
}

#results div span {
  display: inline-block;
  margin-bottom: 2px;
}

hr {
  display: none;
}

#assetHeader {
  font-family: "Source Code Pro", monospace;
  font-size: 0.9rem;
  color: rgb(125, 253, 254, 0.5);
  margin: 10px 0;
  text-align: center;
}

#transfersChart {
  max-height: 300px;
  width: 100%;
}

#heatmapChart {
  max-height: 250px;
  width: 100%;
}

table td[title] {
  cursor: pointer;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.8rem;
  text-align: left;
}

table th, table td {
  border: 1px solid #ddd;
  padding: 8px;
}

table th {
  background-color: rgb(125, 253, 254);
  color: black;
  text-align: center;
}

#transfersTable {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

#transfersTable th, #transfersTable td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid rgba(125, 253, 254, 0.3);
}

#transfersTable tr:hover {
  background-color: rgba(125, 253, 254, 0.2); 
  transition: background-color 0.3s ease;
  cursor: pointer;
}

.copy-btn {
  font-family: "Silkscreen", sans-serif;
  background-color: rgba(125, 253, 254, 0.4);
  border: none;
  color: black;
  padding: 2px 8px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.copy-btn:hover {
  background-color: rgba(125, 253, 254, 1);
}

.top-right-buttons {
  position: absolute; 
  top: 60px;
  right: 20px;
  display: flex;
  gap: 25px;
  align-items: center;
  z-index: 1;
}

.top-right-buttons button {
  font-family: "Silkscreen", sans-serif;
  font-size: 1.1rem;
  color: white;
  background: none;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  transition: text-shadow 0.3s ease;
}

.top-right-buttons button:hover {
  text-shadow: 2px 2px #ff00ff, -2px -2px rgb(95, 235, 186);
}

#loadMoreButton {
  font-family: "Silkscreen", sans-serif;
  font-size: 1rem;
  color: white;
  background: none;
  border: 1px solid #fff;
  padding: 10px 20px;
  cursor: pointer;
  text-transform: uppercase;
  animation: glitch 1s steps(5, end);
  margin-top: 20px;
  margin-bottom: 30px;
  display: block;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

#loadMoreButton:hover {
  text-shadow: 2px 2px #ff00ff, -2px -2px rgb(95, 235, 186);
}

#menuToggleButton {
  display: none;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  z-index: 10;
  position: relative;
}

#menuToggleButton:hover {
  color: rgb(125, 253, 254);
}

#dropdownMenu {
  font-family: inherit;
  font-size: 1rem;
  color: white;
  background-color: rgba(125, 253, 254, 0.9);
  padding: 10px;
  text-align: center;
  text-decoration: none;
  display: block;
  margin: 5px 0;
  cursor: pointer;
  display: none;
  position: absolute;
  top: 100%;
  right: 10px;
  z-index: 10;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#dropdownMenu button,
#dropdownMenu a {
  font-family: inherit;
  font-size: 1rem;
  color: black;
  background-color: transparent;
  border: 1px solid white;
  padding: 10px;
  text-align: center;
  text-decoration: none;
  display: block;
  margin: 5px 0;
  cursor: pointer;
}

#dropdownMenu a {
  font-family: "Silkscreen", sans-serif;
  font-size: 1rem;
  color: white;
  text-shadow: 2px 2px #ff00ff, -0.5px -0.5px rgb(95, 235, 186);
  background-color: rgb(39, 39, 39);
  border: none;
}

#dropdownMenu button:hover,
#dropdownMenu a:hover {
  background-color: rgb(125, 253, 254);
}

@media (max-width: 1000px) {
  #fetchRoles,
  #fetchTransfers,
  #fetchMetadata,
  .top-right-buttons {
    display: none !important;
  }

  #menuToggleButton {
    display: block !important;
  }

  #dropdownMenu.hidden {
    display: none;
  }

  #dropdownMenu {
    display: flex;
    flex-direction: column;
  }
}

progress {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  border: 1px solid rgb(108, 82, 163);
  border-radius: 5px;
  background-color: rgba(18, 18, 18, 0.5);
  overflow: hidden;
}

progress::-webkit-progress-bar {
  background-color: rgba(18, 18, 18, 0.5);
}

progress::-webkit-progress-value {
  background-color: rgb(250, 98, 132);
  transition: width 0.25s ease-in-out;
}

progress::-moz-progress-bar {
  background-color: rgb(250, 98, 132);
}

#addressGraph {
  position: relative;
  width: 100%;
  height: 360px;
  margin: 10px 0 20px 0;
  overflow: hidden;
  z-index: 0;
}

#addressGraph svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;         
}

.node-label {
  font-family: "Source Code Pro", monospace;
  font-size: 11px;
  fill: rgba(255,255,255,0.9);
  paint-order: stroke;
  stroke: rgba(18,18,18,0.9);
  stroke-width: 2px;
}

.node-circle {
  stroke-width: 2px;
  filter: drop-shadow(0 0 6px rgba(125,253,254,0.65));
}

.node--contract { fill: rgba(125,253,254,0.15); stroke: rgb(125,253,254); }
.node--impl     { fill: rgba(255,103,159,0.12); stroke: rgb(255,103,159); filter: drop-shadow(0 0 6px rgba(255,103,159,0.6));}
.node--deployer { fill: rgba(108,82,163,0.14);  stroke: rgb(108,82,163);  filter: drop-shadow(0 0 6px rgba(108,82,163,0.6));}
.node--peer     { fill: rgba(95,235,186,0.10);  stroke: rgb(95,235,186);  filter: drop-shadow(0 0 4px rgba(95,235,186,0.5));}
.node--role     { fill: rgba(255,255,255,0.06); stroke: rgba(255,255,255,0.5);}

.link {
  stroke: rgba(125,253,254,0.35);
  stroke-width: 1.5px;
}

.link--deploy   { stroke: rgba(108,82,163,0.6);  stroke-dasharray: 2 3; }
.link--impl     { stroke: rgba(255,103,159,0.8); }
.link--transfer { stroke: rgba(95,235,186,0.55); }
.link--role     { stroke: rgba(255,255,255,0.35); stroke-dasharray: 3 4; }

#addressGraph .legend {
  position: absolute; right: 8px; top: 8px; font-size: 11px;
  color: rgba(255,255,255,0.85);
  font-family: "Source Code Pro", monospace;
  background: rgba(18,18,18,0.7); padding: 6px 8px; border: 1px solid rgba(255,255,255,0.15);
}

#addressGraph svg { cursor: grab; }
#addressGraph.grabbing svg { cursor: grabbing; }

.node { cursor: default; }
.node:hover { cursor: pointer; }

.node--hover .node-circle {
  stroke-width: 3px;
  filter: drop-shadow(0 0 14px rgba(125,253,254,0.95));
  transition: r 120ms ease, filter 120ms ease, stroke-width 120ms ease;
}

.node--hover .node-label {
  text-decoration: underline;
}
.node--hover .node-label::after {
  content: " ↗";
  font-weight: 700;
}

.dim-node { opacity: 0.18; transition: opacity 120ms ease; }
.dim-link { opacity: 0.12; transition: opacity 120ms ease; }
.node-label.dim-node { opacity: 0.28; }


/* Mempool Monitoring */
[hidden] { display: none !important; }

.btn-live {
  background: #0ff; color: #000; border: none;
  padding: 10px 14px; font-weight: 700; letter-spacing: 1px;
  cursor: pointer; box-shadow: 0 0 8px #0ff, inset 0 0 6px #0ff;
}

.live-panel {
  position: fixed;
  top: 50%; left: 50%;
  width: 80vw; height: 80vh;
  transform: translate(-50%, -50%);
  z-index: 9999;
  background: #000;
  color: #0ff;
  font-family: "Source Code Pro", monospace;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 32px rgba(0,255,255,0.25);
  border-radius: 12px;
}
.live-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid #044;
  background: linear-gradient(90deg, #001012, #001a1e);
  color: #7efcff; text-shadow: 0 0 6px #09f;
}
.btn-close {
  font-family: "Silkscreen", sans-serif;
  font-size: 1rem;
  color: white;
  background: transparent; color: #7efcff; border: 1px solid #0ff;
  padding: 6px 10px; cursor: pointer; box-shadow: 0 0 6px #0ff;
}

.btn-close:hover {
  text-shadow: 2px 2px #ff00ff, -0.5px -0.5px rgb(95, 235, 186);
  transform: translateY(-1px) scale(1.02);
  background-color: rgb(255, 103, 159);
  box-shadow:
    0 0 16px rgba(0,255,255,0.9),
    0 0 36px rgba(0,255,255,0.5),
    inset 0 0 16px rgba(0,255,255,0.55);
}

.live-stream { padding: 16px; overflow: auto; flex: 1; }

.console-line { white-space: pre-wrap; margin: 0 0 8px 0; text-shadow: 0 0 6px rgba(0,255,255,.6); }
.console-line .label { color: #9effff; }
.console-line .value { color: #d1fff7; }
.console-line .time-value {
  font-weight: 700;
}
.console-line .amount-value {
  font-weight: 700;
  color: rgb(95,235,186);
}

.live-panel .typing::after {
  content: "▌";
  margin-left: 3px;
  animation: tron-caret-blink 1s steps(1) infinite;
}

@keyframes tron-caret-blink {
  50% { opacity: 0; }
}

.tx-entry {
  border-top: 1px dashed rgba(126, 252, 255, 0.35);
  padding-top: 8px;
  margin-top: 8px;
}

.btn-live.electric {
  position: relative;
  font-family: "Silkscreen", sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 0.75px solid rgba(126, 252, 255, 0.7);
  background: radial-gradient(120% 120% at 50% 50%, rgba(0,255,255,0.18), rgba(0,255,255,0.06) 60%, rgba(0,0,0,0) 61%);
  color: #fff;
  padding: 10px 16px;
  overflow: visible;
  box-shadow:
    0 0 10px rgba(0,255,255,0.6),
    inset 0 0 10px rgba(0,255,255,0.35);
  text-shadow:
    0 0 6px rgba(0,255,255,0.9),
    0 0 16px rgba(0,255,255,0.45);
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
  animation: electricIdle 2.2s infinite linear;
}

@keyframes electricIdle {
  0%   { filter: drop-shadow(0 0 6px rgba(0,255,255,0.55)); }
  50%  { filter: drop-shadow(0 0 12px rgba(0,255,255,0.9)); }
  100% { filter: drop-shadow(0 0 6px rgba(0,255,255,0.55)); }
}

.btn-live.electric::before {
  content: "";
  position: absolute;
  inset: -2px;
  border: 2px solid rgba(0,255,255,0.65);
  filter: drop-shadow(0 0 8px rgba(0,255,255,0.85));
  opacity: 0.75;
  pointer-events: none;
  border-radius: 2px;
  animation: borderPulse 1.8s ease-in-out infinite;
}

@keyframes borderPulse {
  0%,100% { opacity: 0.6; }
  50%     { opacity: 0.95; }
}

.btn-live.electric::after {
  content: "";
  position: absolute;
  inset: -10px;
  pointer-events: none;
  background:
     radial-gradient(6px 6px at 10% 30%, rgba(126,252,255,0.9), transparent 55%),
     radial-gradient(5px 5px at 85% 65%, rgba(126,252,255,0.7), transparent 60%),
     radial-gradient(4px 4px at 40% 90%, rgba(126,252,255,0.6), transparent 60%);
  mix-blend-mode: screen;
  opacity: 0.45;
  animation: sparks 1.6s infinite steps(2, end);
}

@keyframes sparks {
  0%   { transform: translate(0,0) skewX(0deg); opacity: 0.35; }
  50%  { transform: translate(0.5px, -0.5px) skewX(1deg); opacity: 0.6; }
  100% { transform: translate(0,0) skewX(0deg); opacity: 0.35; }
}

.btn-live.electric:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow:
    0 0 16px rgba(0,255,255,0.9),
    0 0 36px rgba(0,255,255,0.5),
    inset 0 0 16px rgba(0,255,255,0.55);
}

.btn-live.electric:hover::after {
  inset: -18px;
  opacity: 0.75;
  animation-duration: 1s;
  background:
     radial-gradient(10px 10px at 8% 20%, rgba(126,252,255,0.95), transparent 55%),
     radial-gradient(8px 8px  at 88% 70%, rgba(126,252,255,0.9), transparent 60%),
     radial-gradient(6px 6px  at 42% 98%, rgba(126,252,255,0.8), transparent 60%),
     conic-gradient(from 0deg at 50% 50%, rgba(126,252,255,0.15), transparent 20%, rgba(126,252,255,0.12) 40%, transparent 60%, rgba(126,252,255,0.15) 80%, transparent);
}