:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --background-color: #0f172a;
  --surface-color: #1e293b;
  --panel-color: #334155;
  --text-color: #f1f5f9;
  --text-muted: #94a3b8;

  /* Graph Colors */
  --node-bg: #1e293b;
  --node-border: #3b82f6;
  --edge-color: #475569;
  --path-color: #8b5cf6;
  --highlight-color: #f59e0b;
}

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

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 1.5rem;
  overflow-x: hidden;
}

.app-container {
  width: 100%;
  max-width: 1400px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

h1 {
  font-size: 2.5rem;
  background: linear-gradient(90deg, #60a5fa, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
  text-shadow: 0 0 20px rgba(96, 165, 250, 0.3);
}

.tagline {
  color: var(--text-muted);
}

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  background: transparent;
  padding: 0;
}

.control-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--surface-color);
  padding: 1rem;
  border-radius: 0.9rem;
  border: 1px solid #334155;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.input-group {
    display: flex;
    gap: 0.5rem;
}

.input-group input {
    width: 100%;
    padding: 0.5rem;
    border-radius: 0.4rem;
    border: 1px solid #475569;
    background: #0f172a;
    color: white;
}

.control-card button {
  width: 100%;
}

label {
  font-size: 0.95rem;
  color: var(--text-muted);
}

button {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: none;
  background: var(--primary-color);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
}

button:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(37, 99, 235, 0.4);
}

button:active {
  transform: translateY(0);
}

.visualization-area {
  background: #020617;
  border-radius: 1rem;
  height: 600px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.8);
}

#graph-container {
  width: 100%;
  height: 100%;
  position: relative;
}

#edges-svg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
}

.node {
    position: absolute;
    width: 60px;
    height: 60px;
    background: var(--node-bg);
    border: 2px solid var(--node-border);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    text-align: center;
    z-index: 1;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
    cursor: default;
    user-select: none;
    padding: 5px;
    overflow: hidden;
}

.node.highlight {
    background: var(--highlight-color);
    border-color: #fff;
    box-shadow: 0 0 20px var(--highlight-color);
    z-index: 2;
    color: #000;
}

.node.path {
    background: var(--path-color);
    border-color: #fff;
    box-shadow: 0 0 20px var(--path-color);
    z-index: 2;
}

line {
    stroke: var(--edge-color);
    stroke-width: 2;
    transition: all 0.3s;
}

line.path {
    stroke: var(--path-color);
    stroke-width: 4;
    filter: drop-shadow(0 0 5px var(--path-color));
}

.info-panel {
  background: var(--panel-color);
  padding: 1.25rem;
  border-radius: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border: 1px solid #475569;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

#status-message {
  font-size: 1rem;
  font-weight: 500;
}

#status-message.error {
  color: #ef4444;
}

.legend {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.legend-item {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.legend-item.node-legend {
  background: var(--node-bg);
  border: 2px solid var(--node-border);
}

.legend-item.edge-legend {
  background: var(--edge-color);
  border-radius: 0;
  height: 4px;
}

.legend-item.path-legend {
  background: var(--path-color);
  border: 2px solid #fff;
}

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