:root {
  --primary-color: #45c9c3;
  --primary-dark: #39a8a3;
  --text-color: #333;
  --bg-color: #f3f6f9;
  --sidebar-width: 280px;
  --sidebar-bg: #fff;
  --border-radius: 8px;
  --box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

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

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  box-shadow: var(--box-shadow);
  padding: 20px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.logo-img {
  width: 40px;
  height: 40px;
}

.logo h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-dark);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 14px;
  font-weight: 500;
}

input[type="text"] {
  padding: 10px 12px;
  font-size: 14px;
  border-radius: var(--border-radius);
  border: 1px solid #ddd;
  transition: border-color 0.3s;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--primary-color);
}

button {
  padding: 10px 16px;
  border: none;
  background: var(--primary-color);
  color: white;
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s;
}

button:hover {
  background: var(--primary-dark);
}

button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.filter-button {
  margin-top: 10px;
  background: #f0f0f0;
  color: #333;
}

.filter-button:hover {
  background: #e5e5e5;
}

.progress-container {
  margin-top: 10px;
}

.progress {
  height: 10px;
  background: #eee;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 5px;
}

.progress-bar {
  height: 100%;
  background: var(--primary-color);
  width: 0%;
  transition: width 0.3s ease;
}

.filters {
  margin-top: 20px;
}

.filters h3 {
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: 500;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.info-panel {
  margin-top: auto;
  padding-top: 20px;
}

.info-panel h3 {
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: 500;
}

#graph-stats p {
  font-size: 14px;
  margin-bottom: 5px;
}


.hidden {
  display: none;
  opacity: 0;
}

/* Cytoscape Container */
#cy {
  flex: 1;
  position: relative;
  z-index: 1;
}

/* Modal */
.modal-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.modal-container.show {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
  width: 700px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--primary-color);
  color: white;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

.close-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  padding: 0;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

#modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(80vh - 60px);
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th {
  text-align: left;
  padding: 12px 16px;
  background: #f5f5f5;
  font-weight: 500;
  font-size: 14px;
  border-bottom: 2px solid #eee;
}

table td {
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}

table tr:hover {
  background-color: #f8f8f8;
}

.tx-link {
  color: var(--primary-color);
  text-decoration: none;
  display: inline-block;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tx-link:hover {
  text-decoration: underline;
}

.tx-direction-in {
  color: #38b000;
}

.tx-direction-out {
  color: #d62828;
}

#context-menu {
  min-width: 180px;
  font-size: 14px;
}

.context-item {
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.context-item:hover {
  background-color: #f0f0f0;
}

.context-item {
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.context-item:hover {
  background-color: #f0f0f0;
}

#note-modal {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -30%);
  background: white;
  border: 1px solid #ccc;
  padding: 16px;
  z-index: 10000;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

#note-modal.hidden {
  display: none;
}

.note-box textarea {
  width: 100%;
  height: 80px;
  margin-bottom: 12px;
}

.note-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}


#export-buttons {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#export-buttons button {
  background-color: #70C7BA;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  color: white;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: background 0.2s ease-in-out;
}

#export-buttons button:hover {
  background-color: #49EACB;
}

.tag-overlay {
  pointer-events: none;
  opacity: 0.9;
}

// Dive modal
#dive-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#dive-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9998;
}

#dive-container {
  position: absolute;
  top: 5%;
  left: 5%;
  width: 90%;
  height: 90%;
  background: #fdfdfd;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: sans-serif;
  z-index: 9999;
}

#dive-controls select,
#dive-controls button {
  font-size: 14px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

@keyframes pulse-glow {
  0%   { box-shadow: 0 0 0px #49EACB; }
  50%  { box-shadow: 0 0 12px #49EACB; }
  100% { box-shadow: 0 0 0px #49EACB; }
}

.cy-node-pulsing {
  animation: pulse-glow 0.8s ease-in-out;
  animation-iteration-count: infinite;
}


/* Enhanced tooltip styles */
#tooltip {
  position: absolute;
  background: white;
  padding: 12px;
  border-radius: var(--border-radius);
  border: 1px solid #ddd;
  box-shadow: var(--box-shadow);
  font-size: 13px;
  display: none;
  max-width: 320px;
  z-index: 9999;
  white-space: normal;
  word-break: normal;
  line-height: 1.5;
}

/* Address container styles */
#tooltip .address-container {
  background: #f7f7f7;
  padding: 8px;
  border-radius: 4px;
  margin-bottom: 10px;
  overflow: hidden;
}

#tooltip .address-text {
  font-family: monospace;
  font-size: 11px;
  word-break: break-all;
  display: inline-block;
  width: 100%;
}

/* Section divider styles */
#tooltip .section-divider {
  border-top: 1px solid #eee;
  margin: 8px 0;
  padding-top: 8px;
}

/* Info row styles */
#tooltip .info-row {
  margin-bottom: 5px;
}

#tooltip .info-row:last-child {
  margin-bottom: 0;
}

.tab-header {
  display: flex;
  flex-wrap: wrap;
  background: #fafafa;
  padding: 10px 16px;
  gap: 8px;
  border-bottom: 1px solid #eee;
}

.tab-btn {
  padding: 6px 12px;
  background: #f0f0f0;
  color: #333;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.tab-btn.active {
  background: var(--primary-color);
  color: white;
}

.tab-btn:hover {
  background: #e0e0e0;
}

.wallet-tag-entry {
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.wallet-tag-entry b {
  color: var(--primary-dark);
}


.context-separator {
  margin: 4px 0;
  border: none;
  border-top: 1px solid #ddd;
}


/* Wallet Tag Activity Modal */
#walletTagsModal.modal-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

#walletTagsModal.show {
  display: flex;
}

#walletTagsModal .modal-content {
  width: 800px;
  height: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
}

#walletTagsModal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--primary-color);
  color: white;
}

#walletTagsModal .modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

#walletTagsModal .close-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  padding: 0;
}

#walletTagsModal .close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

#walletTagsModal .tab-header {
  display: flex;
  flex-wrap: wrap;
  background: #fafafa;
  padding: 12px 16px;
  gap: 10px;
  border-bottom: 1px solid #eee;
  justify-content: flex-start;
}

#walletTagsModal .tab-btn {
  padding: 8px 14px;
  background: #f0f0f0;
  color: #333;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease;
}

#walletTagsModal .tab-btn.active {
  background: var(--primary-color);
  color: white;
}

#walletTagsModal .tab-btn:hover {
  background: #e0e0e0;
}

#walletTagsBody {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #fff;
}

.wallet-tag-entry {
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.wallet-tag-entry b {
  color: var(--primary-dark);
  word-break: break-all;
}

.wallet-tag-entry small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #666;
}



