html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: sans-serif;
  background-color: #121212;
  color: white;
}

body {
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

button {
  background-color: #4f46e5;
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

button:hover {
  background-color: #6366f1;
}

button:active {
  background-color: #4338ca;
  transform: scale(0.98);
}

#iconBar {
  position: fixed;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 10px;
  z-index: 1000;
}

#iconBar button {
  width: 40px;
  height: 40px;
  padding: 0;
  background-color: #1f2937;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

#iconBar button:hover {
  background-color: #374151;
}

#iconBar svg {
  width: 20px;
  height: 20px;
  display: block;
}

#fileInput {
  padding: 0.45rem 0.8rem;
  background-color: #1f2937;
  color: white;
  border: 1px solid #374151;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#fileInput:hover {
  background-color: #374151;
}

#stats {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #aaa;
}

#network {
  flex: 1;
  min-height: 0;
  background-color: #1e1e1e;
}

#overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.spinner {
  border: 8px solid #444;
  border-top: 8px solid #8b5cf6;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

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

aside.hidden {
  display: none;
}

/* Shared side panel base */

.side-panel {
  position: absolute;
  top: 70px;
  right: 0;
  width: 300px;
  max-height: 90vh;
  padding: 1rem;
  background-color: #1e1e1e;
  border-left: 1px solid #333;
  overflow-y: auto;
  z-index: 999;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.4);
}

.side-panel.hidden {
  display: none;
}

.side-panel h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  border-bottom: 1px solid #333;
  padding-bottom: 0.5rem;
}

.side-panel label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.side-panel input,
.side-panel select,
.side-panel textarea {
  flex: 1;
  max-width: 150px;
  margin-left: 1rem;
  font-size: 0.9rem;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.setting-row label {
  flex: 1;
  padding-right: 0.5rem;
}

.setting-row select,
.setting-row input[type="checkbox"] {
  flex: 1;
  max-width: 150px;
}

#refreshBtn, #downloadJsonBtn {
  margin-top: 1rem;
  width: 100%;
  background-color: #8b5cf6;
  padding: 0.5rem;
  color: white;
  cursor: pointer;
  font-weight: bold;
  border-radius: 4px;
}

#editEdgeFrom, #editEdgeTo {
  width: 100%;
  padding: 0.4rem;
  font-size: 0.9rem;
}

.button-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

button.danger {
  background-color: #dc2626;
}

button.danger:hover {
  background-color: #b91c1c;
}

.dialog {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
}

.dialog-box {
  background: #1e1e1e;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  text-align: center;
  border: 1px solid #555;
  max-width: 300px;
  box-shadow: 0 0 10px #000;
}

.dialog-buttons {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.dialog-buttons button {
  padding: 0.4rem 1rem;
  border: none;
  border-radius: 4px;
  background-color: #4f46e5;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.dialog-buttons button:hover {
  background-color: #6366f1;
}

.hidden {
  display: none;
}
