/* Basic Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(220deg, #9594D6, #9D85C1);
  color: white;
  height: 100dvh;
  padding: 20px;
}

/* Title */
h1 {
  text-align: center;
  margin-bottom: 30px;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

.input-container {
  max-width: fit-content;
  margin: 20px auto;
  padding: 20px;
  border: 2px solid #aea3d6c9;
  border-radius: 12px;
  background: linear-gradient(220deg, #9594d6a0, #9d85c1a0);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
}

/* Prefix input container */
.prefix-container {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
}

input {
  color: white;
  background: rgba(255, 255, 255, 0.25);
  border-width: 2px;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
}

#prefixInput {
  font-size: 0.9rem;
  padding: 6px;
  width: 120px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Speed container */
.speed-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

#speedInput {
  font-size: 0.9rem;
  padding: 6px;
  width: 120px;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-left: auto;
}

.speed-info {
  font-size: 0.8rem;
  color: #555;
}

/* Control container for Add Block and Mine All buttons */
.control-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.add-block-btn,
.mine-all-btn {
  font-size: 1.05rem;
  padding: 5px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  width: 200px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.add-block-btn {
  background: #5eee6ab4;
  border: 2px solid #adddb2b4;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.1);
  transition: background-color 0.3s, box-shadow 0.3s;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
  color: #fff;
}

.add-block-btn:hover {
  background-color: #31ec7f;
}

.mine-all-btn {
  background: #eebc32b4;
  border: 2px solid #d3cb88b4;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.1);
  transition: background-color 0.3s, box-shadow 0.3s;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
  color: #fff;
}

.mine-all-btn:hover {
  background-color: #ffc116b4;
}

/* Toggle View Mode container */
.view-toggle-container {
  text-align: center;
  margin-bottom: 20px;
}

.toggle-btn {
  font-size: 1.05rem;
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  gap: 2px;
  background: #cbbff7b4;
  border: 2px rgba(203, 196, 230, 0.706)ddb2b4;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.1);
  transition: background-color 0.3s, box-shadow 0.3s;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
  color: #fff;
  transition: background-color 0.3s ease;
}

.toggle-btn:first-child {
  border-radius: 4px 0 0 4px;
}

.toggle-btn:last-child {
  border-radius: 0 4px 4px 0;
}

.toggle-btn:hover {
  background: #a38df5b4;
}

.toggle-btn.active {
  background: #7752ffb4;
}

/* Container for blocks */
.chain-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

/* Block card */
.block {
  padding: 20px;
  width: 330px;
  display: flex;
  flex-direction: column;
  border: 2px solid #aea3d6c9;
  border-radius: 12px;
  background: linear-gradient(220deg, #9594d6a0, #9d85c1a0);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
  transition: border-left 0.3s;
}

.block hr {
  border-color: rgba(255, 255, 255, 0.4);
  border-width: 1px;
}

.block::before {
  display: block;
  content: '';
  width: 38px;
  height: 8px;
  margin: 0 auto;
  border-radius: 9999px;
  margin-bottom: 8px;
}

/* Valid/invalid coloring */
.block.valid::before {
  background: #1abc9c;
  box-shadow: 0 0 12px #1abc9c;
}

.block.invalid::before {
  background: #e74c3c;
  box-shadow: 0 0 12px #e74c3c;
}

/* Labels and inputs */
.label {
  font-weight: 600;
  margin: 5px 0 2px;
  font-size: 0.9rem;
}

.input-field {
  font-size: 0.9rem;
  padding: 6px;
  margin-bottom: 10px;
  width: 100%;
  color: white;
  border: 2px solid #aea3d6c9;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.input-field:focus {
  outline: none;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.3);
  border-color: #bfb3ec;
}

.readonly-field {
  color: #EEE;
  background: rgba(255, 255, 255, 0.15);
}

/* Textarea styling */
textarea.input-field {
  resize: vertical;
}

/* Hash fields with fixed size */
.hash-field {
  word-wrap: break-word;
  font-family: monospace;
  font-size: 0.85rem;
  color: #EEE;
  padding: 6px;
  border-radius: 4px;
  border: 1px solid #ccc;
  margin-bottom: 10px;
  min-height: 48px;
  border: 2px solid #aea3d6c9;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
}

/* Raw view styling (matching hash-field style) */
.raw-field {
  padding: 6px;
  border-radius: 4px;
  margin-bottom: 10px;
  font-family: monospace;
  font-size: 0.8rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-height: 120px;
  color: white;
  border: 2px solid #aea3d6c9;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
}

.raw-label {
  font-weight: bold;
  margin-bottom: 5px;
}

/* Mine button – full width by default */
.mine-btn {
  padding: 10px;
  border: none;
  border-radius: 4px;
  background: #7567f7b0;
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  width: 100%;
  margin-top: 5px;
  border: 2px solid #7365f1b0;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.1);
  transition: background-color 0.3s, box-shadow 0.3s;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.alert-btn {
  padding: 10px;
  border: none;
  border-radius: 4px;
  background: #f76767b0;
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  margin-top: 5px;
  border: 2px solid #f16565b0;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.1);
  transition: background-color 0.3s, box-shadow 0.3s;
}

.mine-btn:hover {
  background: rgba(132, 118, 255, 0.69);
  box-shadow: 0 0 12px rgba(92, 82, 184, 0.2);
}

.alert-btn:hover {
  background: rgba(255, 145, 118, 0.69);
  box-shadow: 0 0 12px rgba(184, 82, 82, 0.2);
}

.delete-btn {
  aspect-ratio: 1 / 1;
}

/* Mining controls container: two buttons side by side with gap */
.mining-controls {
  display: flex;
  gap: 10px;
}

.mining-controls .mine-btn {
  width: auto;
  flex: 1;
}

.mine-delete-controls {
  display: flex;
  gap: 6px;
}