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

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

.header {
  text-align: center;
  margin-bottom: 30px;
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header h1 {
  color: #2c3e50;
  margin-bottom: 10px;
}

.status-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 15px;
}

.status-indicator {
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
}

.status-connected {
  background: #d4edda;
  color: #155724;
}

.status-disconnected {
  background: #f8d7da;
  color: #721c24;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.card h2 {
  color: #2c3e50;
  margin-bottom: 15px;
  font-size: 18px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #555;
}

.form-control {
  width: 100%;
  padding: 10px;
  border: 2px solid #e1e8ed;
  border-radius: 5px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.form-control:focus {
  outline: none;
  border-color: #3498db;
}

.btn {
  background: #3498db;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
  margin-right: 10px;
  margin-bottom: 10px;
}

.btn:hover {
  background: #2980b9;
}

.btn-success {
  background: #27ae60;
}

.btn-success:hover {
  background: #229954;
}

.btn-warning {
  background: #f39c12;
}

.btn-warning:hover {
  background: #e67e22;
}

.btn-danger {
  background: #e74c3c;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-small {
  padding: 5px 10px;
  font-size: 12px;
}

.radio-group {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.accounts-list,
.escrows-list {
  max-height: 300px;
  overflow-y: auto;
}

.account-item,
.escrow-item {
  border: 1px solid #e1e8ed;
  border-radius: 5px;
  padding: 10px;
  margin-bottom: 10px;
  background: #f8f9fa;
  cursor: pointer;
}

.account-item.selected,
.escrow-item.selected {
  border-color: #3498db;
  background: #ebf3fd;
}

.account-address {
  font-family: monospace;
  font-size: 12px;
  color: #666;
  word-break: break-all;
}

.account-balance {
  font-weight: 500;
  color: #27ae60;
}

.log-area {
  background: #2c3e50;
  color: #ecf0f1;
  padding: 15px;
  border-radius: 5px;
  font-family: monospace;
  font-size: 12px;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  margin-top: 15px;
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 15px;
}

.wasm-status {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wasm-readme-link {
  align-self: flex-start;
}

.wasm-readme-link .btn {
  font-size: 12px;
  padding: 4px 8px;
}

.wasm-info {
  font-size: 12px;
  color: #666;
  font-style: italic;
}

.wasm-readme-link.hidden {
  display: none;
}

.wasm-warning {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
  padding: 12px;
  border-radius: 5px;
  margin-bottom: 15px;
  font-weight: 500;
}

.wasm-warning.hidden {
  display: none;
}

.hidden {
  display: none;
}

/* Loading states */
.loading-container {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 5px;
  margin-bottom: 10px;
}

/* Empty state messages */
.empty-state {
  text-align: center;
  color: #666;
  padding: 20px;
}

/* Advanced options */
.advanced-toggle {
  width: 100%;
  margin-bottom: 10px;
  background: #f8f9fa;
  color: #333;
  border: 1px solid #ddd;
}

.advanced-content {
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: #f8f9fa;
}

.advanced-content.hidden {
  display: none;
}

.advanced-title {
  margin-top: 0;
  font-size: 14px;
  color: #666;
}

/* Quick test section */
.quick-test-controls {
  margin-bottom: 15px;
}

/* Explorer links */
.explorer-link {
  color: #3498db;
  text-decoration: underline;
}

/* Account and escrow item layouts */
.item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-meta {
  font-size: 12px;
  color: #666;
}

.item-meta-right {
  text-align: right;
  font-size: 12px;
}

.item-details {
  font-size: 12px;
  color: #666;
  margin-top: 5px;
}

.tabs {
  display: flex;
  border-bottom: 2px solid #e1e8ed;
  margin-bottom: 15px;
}

.tab {
  padding: 10px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  border-bottom: 2px solid transparent;
}

.tab.active {
  color: #3498db;
  border-bottom-color: #3498db;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.spinner-small {
  width: 14px;
  height: 14px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
  margin-right: 5px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Toast notifications */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  min-width: 300px;
  background: #e74c3c;
  color: white;
  padding: 15px 20px;
  border-radius: 5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast.success {
  background: #27ae60;
}

.toast.warning {
  background: #f39c12;
}

.toast.info {
  background: #3498db;
}

.toast-close {
  float: right;
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  margin-left: 10px;
  padding: 0;
  line-height: 1;
}

@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 10px;
  }

  .toast {
    top: 10px;
    right: 10px;
    left: 10px;
    min-width: auto;
  }
}
