:root {
  --bg-color: #0f172a;
  --panel-bg: rgba(30, 41, 59, 0.7);
  --panel-border: rgba(255, 255, 255, 0.1);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --node-root: #8b5cf6;
  --node-synonym: #10b981;
  --node-trigger: #f59e0b;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* Premium Background Shapes */
.bg-shape {
  position: absolute;
  filter: blur(80px);
  z-index: 0;
  opacity: 0.5;
  border-radius: 50%;
}

.bg-shape-1 {
  width: 500px;
  height: 500px;
  background: var(--node-root);
  top: -200px;
  left: -100px;
}

.bg-shape-2 {
  width: 600px;
  height: 600px;
  background: var(--accent);
  bottom: -300px;
  right: -200px;
}

/* Glassmorphism Classes */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 10;
  position: absolute;
}

.hidden {
  display: none !important;
}

/* Search Container */
.search-container {
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 1.5rem 2rem;
  width: 90%;
  max-width: 600px;
  text-align: center;
  transition: all 0.3s ease;
  pointer-events: none;
  /* Let background events pass through */
}

.search-container h1,
.search-container p {
  pointer-events: auto;
  /* Re-enable for text selection */
}

.search-container h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.search-container h1 i {
  color: var(--accent);
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.search-box {
  display: flex;
  position: relative;
  gap: 0.5rem;
  pointer-events: auto;
  /* So the input can be clicked */
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

input[type="text"] {
  flex: 1;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--panel-border);
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border-radius: 8px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

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

button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

button:hover {
  background: var(--accent-hover);
}

button:active {
  transform: scale(0.98);
}

#loading {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Network Container */
#network-container {
  width: 100%;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
}

/* Node Info Panel */
.info-panel {
  bottom: 2rem;
  right: 2rem;
  padding: 1.5rem;
  width: 340px;
  max-height: 70vh;
  overflow-y: auto;
  transform: translateY(0);
  opacity: 1;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-panel.hidden {
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  display: block !important;
  /* Override hidden class for animation */
}

#infoTitle {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  text-transform: capitalize;
}

.info-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.badge.root {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.5);
}

.badge.synonym {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.5);
}

.badge.trigger {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.5);
}

.badge.antonym {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.badge.hypernym {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.5);
}

.badge.hyponym {
  background: rgba(6, 182, 212, 0.2);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.5);
}

.word-attributes {
  margin-top: 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-main);
  text-align: left;
  max-height: 150px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

/* Custom Scrollbar */
.word-attributes::-webkit-scrollbar {
  width: 4px;
}

.word-attributes::-webkit-scrollbar-track {
  background: transparent;
}

.word-attributes::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.word-def {
  margin-bottom: 0.5rem;
  line-height: 1.4;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.word-def:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.pos-tag {
  color: var(--accent);
  font-style: italic;
  font-weight: 600;
  margin-right: 0.4rem;
}

.instruction {
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--panel-border);
  padding-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}