/* Mempool.space inspired block card styles */

/* Updated color variables */
:root {
  --mempool-bg: #12161e;
  --mempool-card-bg: #1c2938;
  --mempool-card-header: #141e2c;
  --mempool-text: #ffffff;
  --mempool-text-muted: #8e8e8e;
  --mempool-border: #2d3748;
  --mempool-green: #00b058;
  --mempool-blue: #3a9aed;
  --mempool-orange: #f5a623;
  --mempool-red: #e84142;
  --mempool-purple: #9339f4;
  --mempool-yellow: #e4bc2a;
}

/* Block container styles */
.block-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  max-width: 160px;
  margin-right: 15px;
  transition: all 0.3s ease;
  margin-bottom: 15px;
  padding: 3px;
  text-align: center;
}

/* Mempool container specific spacing */
.mempool-container {
  margin-right: 45px; /* Increased spacing for vertical divider */
}

.block-container:hover {
  transform: translateY(-5px);
  z-index: 5;
}

.block-container::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  border-radius: 3px;
}

/* Block number styles */
.block-number {
  position: relative;
  margin-bottom: 3px;
  z-index: 2;
  text-align: center;
  width: 100%;
}

/* Block connector styles */
.block-connector {
  width: 30px;
  height: 2px;
  background: linear-gradient(90deg, var(--mempool-blue), var(--mempool-green));
  margin: 0 -15px;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 5px rgba(58, 154, 237, 0.5);
}

.block-connector::after {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--mempool-blue);
  border-radius: 50%;
  position: absolute;
  box-shadow: 0 0 8px rgba(58, 154, 237, 0.7);
  animation: connectorPulse 2s infinite;
}

@keyframes connectorPulse {
  0% {
    transform: scale(0.8);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(0.8);
    opacity: 0.7;
  }
}

/* Block card styles */
.block-card {
  display: flex;
  flex-direction: column;
  width: 160px;
  height: 160px;
  background-color: var(--mempool-card-bg);
  border-radius: 8px;
  color: var(--mempool-text);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  font-size: 0.7rem;
  border: 1px solid var(--mempool-border);
  justify-content: space-between;
  align-items: center;
  text-align: center;
  padding: 0;
}

.block-card:hover {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
  color: var(--mempool-text);
  border-color: var(--mempool-blue);
}

/* Block header styles */
.block-header {
  background-color: var(--mempool-card-header);
  padding: 6px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid var(--mempool-border);
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  position: relative;
  overflow: hidden;
  text-align: center;
  width: 100%;
}

/* Block content styles */
.block-content {
  padding: 10px 0;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  background: linear-gradient(180deg, var(--mempool-card-bg) 0%, rgba(28, 41, 56, 0.9) 100%);
  position: relative;
  z-index: 1;
  width: 100%;
}

/* Block stats styles */
.block-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  margin-top: 3px;
  width: 100%;
  text-align: center;
  padding: 0;
}

.stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 0.7rem;
  position: relative;
  padding: 3px 0;
  text-align: center;
  width: 100%;
  margin: 0;
}

.stat::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 25%;
  right: 25%;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.stat-label {
  color: var(--mempool-text-muted);
  font-size: 0.65rem;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-align: center;
  width: 100%;
  padding: 0;
  margin: 0 0 2px 0;
}

.stat-value {
  font-weight: 700;
  color: var(--mempool-text);
  font-size: 0.8rem;
  text-align: center;
  width: 100%;
  padding: 0;
  margin: 0;
}

/* Block value styles */
.block-value {
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  margin-top: auto;
  margin-bottom: 5px;
  color: var(--mempool-green);
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 0;
}

/* Block footer styles */
.block-footer {
  padding: 6px 0;
  border-top: 1px solid var(--mempool-border);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.65rem;
  background-color: var(--mempool-card-header);
  min-height: 24px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  text-align: center;
  width: 100%;
}

/* Badge styles */
.badge {
  padding: 3px 6px;
  border-radius: 3px;
  font-weight: 600;
  font-size: 0.65rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.confirmed-badge {
  background-color: var(--mempool-green);
}

.forecast-badge {
  background-color: rgb(184, 134, 84);
}

/* Miner info styles */
.miner-info {
  text-align: center;
  margin-top: 5px;
  margin-bottom: 5px;
  width: 100%;
}

.pool-badge {
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 0.6rem;
  font-weight: 600;
  display: inline-block;
}

.pool-badge.unknown {
  background-color: var(--mempool-red);
}

.pool-badge.mempool {
  background-color: rgb(184, 134, 84);
}

.pool-badge.ampool {
  background-color: var(--mempool-purple);
}

.pool-badge.dedoo {
  background-color: var(--mempool-orange);
}

.pool-badge.ospool {
  background-color: var(--mempool-yellow);
}

/* Time indicator */
.time {
  color: var(--mempool-text-muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  font-size: 0.65rem;
  text-align: center;
  width: 100%;
  padding: 0;
  margin: 0;
}

/* Forecast block specific styles */
.block-card.forecast {
  background-color: rgba(184, 134, 84, 0.1);
  border: 1px solid rgba(184, 134, 84, 0.3);
}

.block-card.forecast .block-header {
  background-color: rgba(184, 134, 84, 0.2);
}

.block-card.forecast .block-footer {
  background-color: rgba(184, 134, 84, 0.2);
}

.block-card.forecast .block-value {
  color: rgb(184, 134, 84);
}

.block-card.forecast .fee-rate {
  color: rgb(184, 134, 84);
}

/* Animation for new blocks */
@keyframes newBlockPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 176, 88, 0.7);
    transform: translateY(0);
  }
  50% {
    box-shadow: 0 0 20px 5px rgba(0, 176, 88, 0.5);
    transform: translateY(-10px);
  }
  100% {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.new-block {
  animation: newBlockPulse 1.5s ease-out, fadeIn 0.5s ease-out;
}

/* Progress bar for block weight */
.weight-bar-container {
  height: 4px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 5px;
}

.weight-bar {
  height: 100%;
  background-color: var(--mempool-green);
  border-radius: 2px;
}

.forecast .weight-bar {
  background-color: var(--mempool-blue);
}

/* Fee indicator */
.fee-rate {
  font-size: 0.65rem;
  color: var(--mempool-green);
  font-weight: 600;
  text-align: center;
  width: 100%;
  display: block;
  padding: 0;
  margin: 0;
}

.forecast .fee-rate {
  color: rgb(184, 134, 84);
}

/* Unified blockchain view styles */
.unified-blockchain-view {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgb(184, 134, 84) var(--mempool-card-bg);
  width: 100%;
  padding: 15px 5px 20px 5px;
  position: relative;
  background: linear-gradient(180deg, rgba(18, 22, 30, 0.3) 0%, rgba(18, 22, 30, 0.1) 100%);
  border-radius: 16px;
  margin: 10px 0;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.unified-blockchain-view::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(184, 134, 84), transparent);
  opacity: 0.5;
}

.unified-blockchain-view::-webkit-scrollbar {
  height: 8px;
}

.unified-blockchain-view::-webkit-scrollbar-track {
  background: rgba(28, 41, 56, 0.3);
  border-radius: 4px;
}

.unified-blockchain-view::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, rgb(184, 134, 84), rgba(184, 134, 84, 0.7));
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Mempool container specific styles */
.mempool-container {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Vertical divider between mempool and blocks */
.vertical-divider {
  width: 3px;
  height: 200px; /* Made taller */
  background: linear-gradient(to bottom, rgba(184, 134, 84, 0.8), rgba(184, 134, 84, 0.4), rgba(184, 134, 84, 0.8));
  position: absolute;
  right: -22.5px; /* Centered in the 45px gap */
  top: 50%;
  transform: translateY(-50%);
  box-shadow: 0 0 8px rgba(184, 134, 84, 0.5);
  border-radius: 3px;
}

/* Removed dots - no ::before and ::after pseudo-elements */

/* Link styles for transactions and addresses */
.tx-hash-link, .address-link {
  color: var(--mempool-blue);
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}

.tx-hash-link:hover, .address-link:hover {
  color: var(--mempool-green);
  text-decoration: none;
}

.tx-hash-link::after, .address-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: -2px;
  left: 0;
  background-color: var(--mempool-green);
  transition: width 0.3s ease;
}

.tx-hash-link:hover::after, .address-link:hover::after {
  width: 100%;
}

/* Button styles */
.btn-primary {
  background: linear-gradient(135deg, var(--mempool-blue), var(--mempool-green));
  border: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3), 0 0 10px rgba(58, 154, 237, 0.4);
  background: linear-gradient(135deg, #4dabff, #00d068);
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-primary i {
  margin-right: 5px;
}

/* Responsive styles for mobile devices */
@media (max-width: 768px) {
  .block-container {
    min-width: 140px;
    max-width: 140px;
    margin-right: 12px;
  }

  .mempool-container {
    margin-right: 36px; /* Adjusted for mobile */
  }

  .block-card {
    width: 140px;
    height: 150px;
  }

  .block-content {
    padding: 8px 6px;
  }

  .block-value {
    font-size: 1rem;
    margin-bottom: 4px;
  }

  .block-stats {
    margin-bottom: 6px;
  }

  .stat-value {
    font-size: 0.75rem;
  }

  .stat-label {
    font-size: 0.6rem;
  }

  .fee-rate {
    font-size: 0.6rem;
  }

  .vertical-divider {
    height: 120px; /* Taller for tablet */
    right: -18px; /* Centered in 36px gap */
  }

  .unified-blockchain-view {
    gap: 12px;
  }
}

@media (max-width: 576px) {
  .block-container {
    min-width: 120px;
    max-width: 120px;
    margin-right: 8px;
  }

  .mempool-container {
    min-width: 110px;
    max-width: 110px;
    margin-right: 24px; /* Adjusted for smallest mobile */
  }

  .block-card {
    width: 120px;
    height: 140px;
  }

  .block-content {
    padding: 6px 5px;
  }

  .block-header {
    padding: 5px 6px;
  }

  .block-footer {
    padding: 5px 6px;
  }

  .block-value {
    font-size: 0.9rem;
  }

  .badge {
    font-size: 0.6rem;
    padding: 2px 4px;
  }

  .pool-badge {
    font-size: 0.55rem;
  }

  .vertical-divider {
    height: 100px; /* Taller for mobile */
    right: -12px; /* Centered in 24px gap */
    width: 2px; /* Slightly thicker for visibility */
  }

  /* Removed dots - no pseudo-elements */

  .unified-blockchain-view {
    gap: 8px;
  }
}
