@import url('https://fonts.googleapis.com/css2?family=Lugrasimo&display=swap');
:root {
  --bg: #0b1220;
  --panel: #0f1724;
  --muted: #9aa4b2;
  --accent: #2f80ed;
  --text: #e6eef6;
  --glass: rgba(255, 255, 255, 0.03);
}

[data-theme="light"] {
  --bg: #f7fbff;
  --panel: #ffffff;
  --muted: #6b7280;
  --accent: #0b5cff;
  --text: #0b1220;
  --glass: rgba(0, 0, 0, 0.03);
}

* {
  box-sizing: border-box;
  font-family: Inter, ui-sans-serif, system-ui, Arial, Helvetica, sans-serif;
}
html,
body {
  height: 100%;
  margin: 0;
}
body {
  width: auto;
  background: linear-gradient(180deg, var(--bg), #071022);
  color: var(--text);
  transition:
    background 400ms ease,
    color 300ms ease;
}
p {
  color: var(--muted);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
p:hover {
  cursor: pointer;
  transform: scale(1.05);
  color: var(--accent);
  transition: all 0.3s;
}
a {
  color: var(--accent);
  text-decoration: none;
}
#particles-js {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.6;
  pointer-events: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.12), transparent);
  backdrop-filter: blur(6px);
}
.brand {
  font-family: "Lugrasimo", cursive;
  font-weight: 700;
  font-size: 18px;
  color: var(--accent);
}
.search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.search-row input {
  width: 420px;
  max-width: 60vw;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--panel);
  color: var(--text);
  outline: none;
  transition: box-shadow 200ms;
}
.search-row input:focus {
  box-shadow: 0 6px 18px rgba(47, 128, 237, 0.12);
}
.search-row button {
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
}
.controls button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
}

.container {
  height: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid:
    "first second"
    "third third";
  gap: 18px;
  padding: 18px;
  max-width: 95%;
  margin: 10px auto;
  position: relative;
  z-index: 3;
}
.left {
  width: auto;
  flex: 1;
  display: flex;
  flex-direction: row;
  gap: 16px;
}
.right {
  grid-area: third;
  width: 100%;
}
.panel1,
.panel2 {
  background: linear-gradient(180deg, var(--panel), rgba(255, 255, 255, 0.02));
  border-radius: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.6);
}
.panel1 {
  width: 50%;
  grid-area: first;
}
.panel2 {
  width: 70%;
  grid-area: second;
}

.panel-header {
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--muted);
}

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 56vh;
  overflow: auto;
  padding-right: 6px;
  /* font-size: 12px; */
}
.item {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  border-radius: 8px;
  background: var(--glass);
  transition:
    transform 180ms,
    background 180ms;
  cursor: pointer;
}
.item:hover {
  transform: translateY(-4px);
  background: rgba(47, 128, 237, 0.06);
}
.i-left {
  display: flex;
  flex-direction: column;
}
.i-left1 {
  border-bottom: 3px solid #ddd;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
}
.block-number {
  font-weight: 700;
}
.block-hash {
  color: var(--muted);
  font-size: 13px;
}
.tx-item {
  font-size: 15px;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: 8px;
  background: transparent;
  transition: background 140ms;
  cursor: pointer;
  flex-wrap: wrap; /* allow wrapping on small screens */
}
.tx-item:hover {
  background: rgba(255, 255, 255, 0.02);
}
.tx-hash {
  width: 140px;
  color: var(--muted);
  overflow: hidden; /* prevent overflow */
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 0 0 140px;
}
.tx-from,
.tx-to {
  color: var(--muted);
  width: 110px;
  overflow: hidden; /* prevent overflow */
  text-overflow: ellipsis; /* add ellipsis */
  white-space: nowrap; /* keep on single line */
  flex: 0 0 110px; /* fixed column width */
}
.tx-val {
  margin-left: auto;
  font-weight: 600;
  flex: 0 0 auto;
  white-space: nowrap;
}

.detail {
  /* grid-area: third; */
  min-height: 60vh;
}
.detail-content {
  padding: 8px;
  z-index: 3;
  /* Make details area scrollable like the left lists */
  max-height: 56vh;
  overflow: auto;
  padding-right: 6px;
}
.meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  margin-bottom: 12px;
}
.tx-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tx-row {
  display: flex;
  gap: 12px;
  padding: 8px;
  border-radius: 8px;
  background: var(--glass);
  cursor: pointer;
  align-items: center;
  flex-wrap: wrap; /* allow wrapping to avoid overlap */
}
.tx-row:hover {
  background: rgba(47, 128, 237, 0.04);
}
.thash {
  width: 140px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 0 0 140px;
}
.tfrom,
.tto {
  width: 110px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 0 0 110px;
}
.tval {
  font-size: 12px;
  margin-left: auto;
  font-weight: 800;
  white-space: nowrap;
}

.subheader {
  font-weight: 600;
  margin-top: 8px;
  margin-bottom: 6px;
}

@media (max-width: 900px) {
  .container {
    display: grid;
    grid-template-columns: 1fr;
    grid:
      "first"
      "second"
      "third";
  }
  .left {
    width: 100%;
    flex-direction: column;
    padding: 10px;
  }
  .panel1,
  .panel2 {
    width: 100%;
  }
  .right {
    width: 100%;
  }
  .panel-header {
    font-size: 14px;
  }
  .detail {
    min-height: auto;
  }
  .detail-content {
    max-height: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 12px;
    font-weight: bold;
    width: 100%;
  }
  .i-left1 {
    display: flex;
    flex-direction: column;
    line-height: 1.5rem;
    word-spacing: 1px;
  }
  .search-row input {
    width: 220px;
  }
}

* {
  transition:
    color 220ms,
    background 220ms;
}

html {
  font-size: 16px; 
}

.container {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-areas: 
    "first first first first second second second second second second second second"
    "third third third third third third third third third third third third";
  gap: 20px;
  width: 95%;
  max-width: 1440px;
  margin: 20px auto;
  padding: 0;
}

/* Area Assignments */
.panel1 { grid-area: first; width: 100% !important; }
.panel2 { grid-area: second; width: 100% !important; }
.right  { grid-area: third; width: 100%; }

/* 3. The Responsive Media Queries */

/* Tablet & Smaller Desktops (Under 1100px) */
@media (max-width: 1100px) {
  .container {
    grid-template-areas: 
      "first first first first first first"
      "second second second second second second"
      "third third third third third third";
    grid-template-columns: repeat(6, 1fr);
  }
  
  .search-row input {
    width: 300px;
  }
}

/* Mobile Devices (Under 768px) */
@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    text-align: center;
  }

  .search-row {
    width: 100%;
    justify-content: center;
  }

  .search-row input {
    width: 100%; 
    max-width: none;
  }

  .container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 10px;
  }

  .tx-item, .tx-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px;
    position: relative;
  }

  .tx-hash, .tx-from, .tx-to, .thash, .tfrom, .tto {
    width: 100%;
    flex: 1 1 auto;
    font-size: 0.85rem;
  }

  .tx-val, .tval {
    margin-left: 0;
    margin-top: 4px;
    color: var(--accent);
  }

  .block-hash {
    font-size: 11px;
    word-break: break-all; 
  }
}

/* Small Mobile (Under 480px) */
@media (max-width: 480px) {
  .brand {
    font-size: 1.2rem;
  }
  
  .panel1, .panel2 {
    padding: 10px;
  }
  
  .item {
    padding: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

.list::-webkit-scrollbar, 
.detail-content::-webkit-scrollbar {
  width: 4px;
}

.list::-webkit-scrollbar-thumb, 
.detail-content::-webkit-scrollbar-thumb {
  background: var(--glass);
  border-radius: 10px;
}
