/* =============================================
   Underflow Explore — Artist Graph
   ============================================= */

:root {
  --bg:           #0a0a0f;
  --bg-card:      rgba(255, 255, 255, 0.03);
  --border:       rgba(255, 255, 255, 0.08);
  --text:         #e8e8f0;
  --text-muted:   rgba(255, 255, 255, 0.45);
  --text-faint:   rgba(255, 255, 255, 0.28);
  --accent:       #e05588;
  --accent-dim:   rgba(224, 85, 136, 0.18);
  --accent-glow:  rgba(224, 85, 136, 0.35);
  --font:         'Inter', system-ui, -apple-system, sans-serif;

  --color-remixer:      #a855f7;
  --color-collaborator: #3b82f6;
  --color-featured:     #22c55e;
  --color-original:     #f59e0b;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ---- Nav ---- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  height: 28px;
  width: auto;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--text); }

.nav-cta {
  background: var(--accent);
  color: #fff;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}
.nav-cta:hover { opacity: 0.85; }

/* ---- Search ---- */

.search-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 10;
  width: 100%;
  max-width: 520px;
  padding: 0 24px;
}

.search-title {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.search-sub {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 32px;
  line-height: 1.5;
}

.search-form {
  display: flex;
  gap: 8px;
}

.search-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 20px;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.search-input::placeholder { color: var(--text-faint); }

.search-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px 28px;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}
.search-btn:hover { opacity: 0.85; }
.search-btn:active { transform: scale(0.97); }

.search-hints {
  margin-top: 20px;
  color: var(--text-faint);
  font-size: 13px;
}

.hint-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 6px;
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
  margin-left: 4px;
  transition: background 0.2s, color 0.2s;
}
.hint-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

/* ---- Graph ---- */

.graph-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#graph-svg {
  width: 100%;
  height: 100%;
  cursor: grab;
}
#graph-svg:active { cursor: grabbing; }

/* ---- Graph Elements ---- */

.node-circle {
  cursor: pointer;
  transition: filter 0.3s;
}
.node-circle:hover {
  filter: brightness(1.3);
}

.node-label {
  fill: var(--text);
  font-family: var(--font);
  font-weight: 500;
  text-anchor: middle;
  pointer-events: none;
  user-select: none;
}

.link-line {
  stroke-linecap: round;
}

/* ---- Tooltip ---- */

.tooltip {
  position: fixed;
  background: rgba(20, 20, 30, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 12px 16px;
  pointer-events: none;
  z-index: 200;
  max-width: 240px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  transition: opacity 0.15s;
}
.tooltip.hidden { opacity: 0; }

.tooltip-name {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 6px;
}

.tooltip-details {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.tooltip-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 4px;
  margin-top: 4px;
}

/* ---- Legend ---- */

.legend {
  position: fixed;
  bottom: 24px;
  left: 24px;
  display: flex;
  gap: 16px;
  z-index: 50;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(8px);
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---- Back Button ---- */

.back-btn {
  position: fixed;
  top: 72px;
  left: 24px;
  z-index: 50;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

/* ---- Graph Search (top bar) ---- */

.graph-search {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
}

.graph-search-input {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  color: var(--text);
  width: 260px;
  text-align: center;
  outline: none;
  transition: border-color 0.25s, width 0.3s, box-shadow 0.25s;
}

.graph-search-input::placeholder {
  color: var(--text-faint);
}

.graph-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(224, 85, 136, 0.15);
  width: 320px;
  text-align: left;
}

/* ---- SVG Filters (defined in JS) ---- */

/* Glow animation for center node */
@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Node appear animation */
@keyframes node-appear {
  from {
    opacity: 0;
    transform: scale(0);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ---- Embed Mode (for iframe on main page) ---- */

body.embed-mode {
  overflow: hidden;
}

body.embed-mode .nav,
body.embed-mode .search-container,
body.embed-mode .legend,
body.embed-mode .back-btn,
body.embed-mode .graph-search {
  display: none !important;
}

body.embed-mode .graph-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

body.embed-mode #graph-svg {
  cursor: default;
}

body.embed-mode .node-group {
  cursor: pointer;
}
