/* Visualize page fixes and enhancements */

/* Main container height fix */
.visualize-container {
  height: calc(100vh - 60px); /* Adjust for nav height */
  display: flex;
  flex-direction: column;
}

/* Ensure proper layout for explore tab */
#explore-tab {
  display: flex;
  flex-direction: column;
  height: 100%;
  flex: 1;
}

#explore-tab .graph-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* Filter panel visibility toggle */
.filter-panel {
  display: none;
  transition: all 0.3s ease;
}

.filter-panel.show {
  display: block;
}

/* Node details panel */
.node-details {
  position: absolute;
  right: 20px;
  top: 20px;
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  width: 300px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: none;
  z-index: 1000;
}

.node-details.active {
  display: block;
}

.node-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.node-details-header h3 {
  margin: 0;
  font-size: 1.2em;
}

.node-details-header .close-btn {
  background: none;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  color: var(--text-color);
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.node-details-content p {
  margin: 8px 0;
  word-break: break-word;
}

.node-details-actions {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
}

/* Message container */
#message-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
}

.message {
  padding: 15px 20px;
  border-radius: 4px;
  margin-bottom: 10px;
  animation: slideIn 0.3s ease;
}

.message.success {
  background: #4caf50;
  color: white;
}

.message.error {
  background: #f44336;
  color: white;
}

.message.warning {
  background: #ff9800;
  color: white;
}

.message.info {
  background: #2196f3;
  color: white;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Graph status indicator */
#graph-status {
  color: var(--primary-color);
  font-weight: 500;
}

/* Context menu positioning fix */
#context-menu {
  position: fixed;
  z-index: 9999;
}

/* Filter chip active state */
.filter-chip.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Cytoscape container fix */
#cy {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: var(--background-color);
}

/* Graph container relative positioning */
.graph-container {
  position: relative;
  height: calc(100vh - 300px); /* Adjust based on header/controls height */
  min-height: 400px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

/* Graph info display - the actual stats panel */
.graph-info {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px 15px;
  border-radius: 4px;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  z-index: 100;
  display: flex;
  gap: 15px;
}

.graph-info div {
  display: flex;
  align-items: center;
  gap: 5px;
}

.graph-info span {
  font-weight: bold;
  color: var(--primary-color, #4a90e2);
}

/* Highlighted nodes */
.highlighted {
  opacity: 1 !important;
}

.dimmed {
  opacity: 0.3 !important;
}

/* Stats panel styling */
.stats-panel {
  position: absolute;
  bottom: 60px; /* Move up to avoid being cut off */
  right: 10px;
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 15px;
  border-radius: 4px;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  z-index: 100;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  min-width: 300px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Make stats panel responsive */
@media (max-width: 768px) {
  .stats-panel {
    grid-template-columns: repeat(2, 1fr);
    min-width: 200px;
    bottom: 80px;
  }
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 20px;
  font-weight: bold;
  color: var(--primary-color, #4a90e2);
  margin-bottom: 5px;
}

.stat-label {
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
}