/* Main container for the graph tool */
.wwp-db-root {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 8px;
  background: #2d2d2d;
  color: #f0f0f0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  width: 100%;
  height: 75vh;
  min-height: 550px;
  box-sizing: border-box;
  overflow: hidden;
}

/* Toolbar styles */
.wwp-db-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid #444;
}

.wwp-toolbar-spacer { margin-left: auto; }

.wwp-db-toolbar label { font-size: 13px; display: inline-flex; align-items: center; gap: 4px;}
.wwp-db-toolbar select, .wwp-db-toolbar input {
    background: #3a3a3a;
    color: #f0f0f0;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 13px;
}
.wwp-db-toolbar input[type="search"], .wwp-db-toolbar select.wwp-db-node-search {
    min-width: 180px;
}
.wwp-db-checkbox-label {
    cursor: pointer;
}

/* Container for the canvas and side panel */
.wwp-db-panels {
  display: flex;
  gap: 8px;
  flex-grow: 1;
  min-height: 0;
}

/* Cytoscape canvas */
.wwp-db-canvas {
  flex-grow: 1;
  position: relative;
  border: 1px solid #444;
  border-radius: 6px;
  background: #1e1e1e;
  min-width: 0;
  height: 100%;
}

/* Side panel for details */
.wwp-db-sidepanel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 12px;
  background: #3a3a3a;
  width: 30%;
  max-width: 350px;
  min-width: 250px;
  overflow-y: auto;
  transition: all 0.3s ease;
}

/* Buttons */
.wwp-fullscreen-btn, .wwp-toggle-panel {
  background: #4f4f4f;
  color: #f0f0f0;
  border: 1px solid #666;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wwp-fullscreen-btn svg {
    stroke: #f0f0f0;
}
.wwp-fullscreen-btn:hover, .wwp-toggle-panel:hover {
    background-color: #5a5a5a;
}

/* Side panel content */
.wwp-db-title { margin: 0 0 8px; font-size: 20px; line-height: 1.2; color: #fff; }
.wwp-db-description { font-size: 14px; line-height: 1.5; margin-bottom: 12px; }
.wwp-db-connections h4 { font-size: 14px; margin: 16px 0 8px; border-bottom: 1px solid #4f4f4f; padding-bottom: 4px; }
.wwp-db-connections-list { display: flex; flex-direction: column; gap: 4px; list-style: none; padding: 0; margin: 0; }
.conn-item { padding: 4px 8px; border-radius: 4px; cursor: pointer; transition: background-color 0.2s; }
.conn-item:hover { background-color: #4f4f4f; }

/* Legend styles */
.wwp-db-legend {
    margin-top: 16px;
    border-top: 1px solid #4f4f4f;
    padding-top: 12px;
}
.wwp-db-legend h4 {
    margin: 0 0 8px;
    font-size: 14px;
}
.wwp-db-legend h5 {
    margin: 12px 0 8px;
    font-size: 13px;
    font-weight: bold;
}
.wwp-db-legend ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
}
.wwp-db-legend li {
    display: flex;
    align-items: center;
    gap: 8px;
}
.legend-color-box {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
    border: 1px solid rgba(255,255,255,0.2);
}


/* Error message styling */
.wwp-db-error {
  padding: 20px;
  background-color: #ffebee;
  color: #c62828;
  border: 1px solid #c62828;
  border-radius: 8px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  text-align: center;
}

