/* Shared styles for Blake Lively vs Justin Baldoni Network */

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

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  min-height: 100vh;
  color: #e8e8e8;
}

.container { max-width: 1400px; margin: 0 auto; padding: 20px; }

header { text-align: center; margin-bottom: 20px; }
h1 { font-size: 1.8rem; font-weight: 300; margin-bottom: 8px; color: #fff; }
.subtitle { color: #8892b0; font-size: 0.95rem; }

/* Legend */
.legend {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 15px;
  margin-bottom: 15px; padding: 15px; background: rgba(255,255,255,0.05);
  border-radius: 12px;
}
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; }
.legend-line { width: 25px; height: 3px; border-radius: 2px; }

/* Main layout */
.main-content { display: flex; gap: 20px; }

/* Graph container */
#graph-container {
  flex: 1;
  background: rgba(255,255,255,0.03);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
  position: relative;
}

svg { display: block; }

/* Nodes */
.node { cursor: pointer; }
.node-ring { stroke-width: 3; transition: all 0.2s; }
.node:hover .node-ring { stroke-width: 5; filter: brightness(1.2); }
.node.selected .node-ring { stroke-width: 5; stroke: #fff !important; filter: drop-shadow(0 0 10px rgba(255,255,255,0.5)); }
.node text { font-size: 10px; fill: #e8e8e8; pointer-events: none; font-weight: 500; }
.node-initials { font-size: 14px; fill: #1a1a2e; font-weight: 600; text-anchor: middle; dominant-baseline: central; }

/* Links */
.link { fill: none; stroke-opacity: 0.6; }
.link-label { font-size: 8px; fill: #8892b0; pointer-events: none; }

/* Tooltip */
.tooltip {
  position: absolute; background: rgba(20, 30, 50, 0.95); color: #fff;
  padding: 12px 16px; border-radius: 8px; font-size: 0.85rem;
  pointer-events: none; opacity: 0; transition: opacity 0.2s;
  max-width: 280px; border: 1px solid rgba(100, 150, 255, 0.3);
  box-shadow: 0 10px 40px rgba(0,0,0,0.4); z-index: 100;
}
.tooltip h4 { margin-bottom: 6px; color: #64b5f6; }

/* Controls */
.controls {
  position: absolute; top: 15px; right: 15px; display: flex; gap: 8px; z-index: 10;
}
.controls button, .btn {
  background: rgba(100, 150, 255, 0.2); border: 1px solid rgba(100, 150, 255, 0.4);
  color: #fff; padding: 8px 14px; border-radius: 6px; cursor: pointer;
  font-size: 0.8rem; transition: all 0.2s; text-decoration: none;
}
.controls button:hover, .btn:hover { background: rgba(100, 150, 255, 0.4); }

/* Detail Panel */
#detail-panel {
  width: 380px;
  background: rgba(255,255,255,0.03);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 20px;
  display: none;
  flex-direction: column;
  max-height: 650px;
  overflow-y: auto;
}
#detail-panel.active { display: flex; }
#detail-panel .close-btn {
  position: absolute; top: 10px; right: 15px; background: none; border: none;
  color: #8892b0; font-size: 1.5rem; cursor: pointer; line-height: 1;
}
#detail-panel .close-btn:hover { color: #fff; }

.panel-header {
  display: flex; align-items: center; gap: 15px; margin-bottom: 20px;
  padding-bottom: 15px; border-bottom: 1px solid rgba(255,255,255,0.1);
  position: relative;
}
.panel-avatar {
  width: 60px; height: 60px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 600;
  background-size: cover; background-position: center;
  border: 3px solid;
}
.panel-title h2 { font-size: 1.1rem; font-weight: 500; margin-bottom: 4px; }
.panel-title .role { font-size: 0.8rem; color: #8892b0; }

.panel-section { margin-bottom: 20px; }
.panel-section h3 {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px;
  color: #64b5f6; margin-bottom: 10px;
}
.panel-section p { font-size: 0.9rem; line-height: 1.6; color: #c8c8d8; }

/* Connection list */
.connection-list { list-style: none; }
.connection-list li {
  padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.85rem; display: flex; align-items: center; gap: 8px;
}
.connection-list li:last-child { border: none; }
.connection-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.connection-type { color: #8892b0; font-size: 0.75rem; }

/* Reference list */
.reference-list { list-style: none; }
.reference-list li { margin-bottom: 10px; }
.reference-list a {
  color: #64b5f6; text-decoration: none; font-size: 0.85rem;
  display: flex; align-items: flex-start; gap: 8px; line-height: 1.4;
}
.reference-list a:hover { color: #90caf9; text-decoration: underline; }
.reference-list .source {
  font-size: 0.7rem; color: #8892b0; display: block; margin-top: 2px;
}

/* Attachment list */
.attachment-list { list-style: none; }
.attachment-list li {
  padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.85rem; display: flex; align-items: center; gap: 8px;
}
.attachment-list li:last-child { border: none; }
.attachment-list a {
  color: #64b5f6; text-decoration: none;
}
.attachment-list a:hover { text-decoration: underline; }
.attachment-size { color: #8892b0; font-size: 0.75rem; }

/* Court cases list */
.court-cases-list { list-style: none; }
.court-cases-list li {
  padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.court-cases-list li:last-child { border: none; }
.court-case-name {
  color: #64b5f6; font-size: 0.9rem; font-weight: 500;
  display: block; margin-bottom: 4px;
}
.court-case-name a {
  color: #64b5f6; text-decoration: none;
}
.court-case-name a:hover { text-decoration: underline; }
.court-case-meta {
  font-size: 0.75rem; color: #8892b0;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.court-case-meta span { display: inline-flex; align-items: center; gap: 3px; }
.court-case-role {
  display: inline-block; padding: 2px 6px; border-radius: 4px;
  background: rgba(100, 150, 255, 0.2); color: #90caf9;
  font-size: 0.7rem; margin-top: 4px;
}

/* Status badges */
.status-badge {
  display: inline-block; padding: 4px 10px; border-radius: 12px;
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px;
  margin-top: 8px;
}
.status-active { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }
.status-dismissed { background: rgba(46, 204, 113, 0.2); color: #2ecc71; }
.status-pending { background: rgba(241, 196, 15, 0.2); color: #f1c40f; }

/* Stats */
.stats {
  display: flex; justify-content: center; gap: 30px; margin-top: 15px;
  flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-value { font-size: 1.5rem; font-weight: 600; color: #64b5f6; }
.stat-label { font-size: 0.75rem; color: #8892b0; text-transform: uppercase; letter-spacing: 1px; }

/* Instructions */
.instructions {
  text-align: center; padding: 10px; color: #8892b0; font-size: 0.8rem;
  margin-bottom: 10px;
}

/* Loading state */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 400px;
  color: #8892b0;
}

/* Error state */
.error {
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: #e74c3c;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

/* Responsive */
@media (max-width: 900px) {
  .main-content { flex-direction: column; }
  #detail-panel { width: 100%; max-height: none; }
}
