/**
 * Context Panel - Smart Sidebar for Entity Details
 * Feature 11: Context Panels
 * Version: 2.5.0
 * Phase: 1 - Base Panel
 */

/* =============================================================================
   CONTAINER & LAYOUT
   ============================================================================= */

.context-panel {
  width: 360px;
  height: 100vh;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 20000;

  /* Glassmorphism Background */
  background: rgba(26, 32, 44, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  /* Border */
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);

  /* Slide-in Animation */
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.context-panel.visible {
  transform: translateX(0);
}

/* Smooth transitions for content updates */
.context-panel * {
  transition: opacity 0.2s ease, transform 0.2s ease;
}


/* =============================================================================
   HEADER SECTION
   ============================================================================= */

.context-panel-header {
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

.context-panel-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.context-panel-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 1);
  transform: scale(1.1);
}

.entity-icon-large {
  width: 48px;
  height: 48px;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.entity-icon-large:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* =============================================================================
   INLINE EDITOR - Edit Tasks Directly in 3D Space
   ============================================================================= */

.context-inline-editor {
  position: absolute;
  width: 400px;
  max-height: 600px;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  z-index: 1001;
  overflow: hidden;
  animation: inline-editor-slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes inline-editor-slide-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Header */
.inline-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(59, 130, 246, 0.15);
  border-bottom: 1px solid rgba(59, 130, 246, 0.3);
}

.inline-editor-title {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-weight: 600;
  color: #60a5fa;
  font-size: 14px;
}

.inline-editor-icon {
  font-size: 16px;
}

.inline-editor-close {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.inline-editor-close:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fff;
}

/* Body */
.inline-editor-body {
  padding: 16px;
  max-height: 450px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 130, 246, 0.3) transparent;
}

.inline-editor-body::-webkit-scrollbar {
  width: 6px;
}

.inline-editor-body::-webkit-scrollbar-track {
  background: transparent;
}

.inline-editor-body::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.3);
  border-radius: 3px;
}

/* Field Styles */
.inline-editor-field {
  margin-bottom: 12px;
}

.inline-editor-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.inline-editor-field input,
.inline-editor-field textarea,
.inline-editor-field select {
  width: 100%;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: #e0e7ff;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.inline-editor-field input:focus,
.inline-editor-field textarea:focus,
.inline-editor-field select:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.08);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.inline-editor-field textarea {
  resize: vertical;
  min-height: 60px;
}

.inline-editor-field select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23e0e7ff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

.inline-editor-field select option {
  background: #1e293b;
  color: #e0e7ff;
  padding: 8px;
}

.inline-editor-field-updated {
  animation: field-flash 0.6s ease;
}

@keyframes field-flash {
  0%, 100% { background: rgba(255, 255, 255, 0.05); }
  50% { background: rgba(34, 197, 94, 0.2); }
}

/* Row Layout */
.inline-editor-row {
  display: flex;
  gap: var(--space-3);
  margin-bottom: 12px;
}

.inline-editor-field-half {
  flex: 1;
  margin-bottom: 0;
}

/* Footer */
.inline-editor-footer {
  display: flex;
  gap: var(--spacing-sm);
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.inline-editor-btn {
  flex: 1;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.inline-editor-btn-primary {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.8), rgba(37, 99, 235, 0.9));
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.inline-editor-btn-primary:hover {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.9), rgba(37, 99, 235, 1));
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}

.inline-editor-btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #e0e7ff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.inline-editor-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.inline-editor-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* AI Suggestions Section */
.inline-editor-ai-section {
  margin-top: 16px;
  padding: 12px;
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: var(--radius-md);
}

.inline-editor-ai-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-weight: 600;
  color: #7dd3fc;
  font-size: 12px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.inline-editor-ai-icon {
  font-size: 16px;
}

.inline-editor-ai-loading {
  padding: 16px;
  text-align: center;
  color: #38bdf8;
  font-size: 13px;
}

.inline-editor-ai-error {
  padding: 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  color: #fca5a5;
  font-size: 12px;
}

.inline-editor-ai-suggestion {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 8px;
}

.inline-editor-ai-suggestion:last-child {
  margin-bottom: 0;
}

.inline-editor-ai-label {
  font-size: 11px;
  font-weight: 600;
  color: #38bdf8;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.inline-editor-ai-value {
  color: #e0e7ff;
  font-size: 13px;
  margin-bottom: 8px;
  line-height: 1.5;
}

.inline-editor-ai-priority-low {
  color: #86efac;
}

.inline-editor-ai-priority-medium {
  color: #fbbf24;
}

.inline-editor-ai-priority-high {
  color: #f87171;
}

.inline-editor-ai-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.inline-editor-ai-tag {
  padding: 4px 10px;
  background: rgba(14, 165, 233, 0.2);
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: var(--radius-lg);
  font-size: 11px;
  color: #7dd3fc;
  font-weight: 500;
}

.inline-editor-ai-apply {
  padding: 4px 12px;
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-sm);
  color: #86efac;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.inline-editor-ai-apply:hover {
  background: rgba(34, 197, 94, 0.3);
  border-color: rgba(34, 197, 94, 0.4);
  transform: translateY(-1px);
}

.inline-editor-ai-apply:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

.entity-image-container {
  width: 100%;
  max-height: 200px;
  margin-bottom: 16px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.entity-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.entity-image:hover {
  transform: scale(1.05);
}

/* Entity Header Row (Icon + Name horizontal) */
.entity-header-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: 12px;
}

.entity-name-large {
  font-size: 20px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.2;
  word-wrap: break-word;
  margin: 0 0 4px 0;
}

/* Entity Aliases (v3.2) */
.entity-aliases {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 6px 0;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}

.aliases-label {
  color: rgba(255, 255, 255, 0.4);
  font-weight: 500;
}

.aliases-list {
  color: rgba(255, 255, 255, 0.6);
}

/* Entity Meta Row (Level + Parent) */
.entity-meta-row {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
  margin-top: 4px;
}

.entity-level-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  cursor: help;
}

.entity-parent-link {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 2px 8px;
  background: rgba(100, 150, 255, 0.15);
  border: 1px solid rgba(100, 150, 255, 0.3);
  border-radius: var(--radius-lg);
  font-size: 11px;
  font-weight: 500;
  color: rgba(100, 150, 255, 0.95);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.entity-parent-link:hover {
  background: rgba(100, 150, 255, 0.25);
  border-color: rgba(100, 150, 255, 0.5);
  transform: translateX(-2px);
}

/* Entity Type Badge (System/User) */
.entity-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 500;
}

.entity-type-system {
  background: rgba(255, 180, 50, 0.15);
  border: 1px solid rgba(255, 180, 50, 0.35);
  color: rgba(255, 200, 100, 0.9);
}

.entity-type-user {
  background: rgba(100, 200, 150, 0.15);
  border: 1px solid rgba(100, 200, 150, 0.35);
  color: rgba(150, 230, 180, 0.9);
}

/* ============================================
   PHASE 1: v3.0 Enhancements
   ============================================ */

/* Entity Meta Row Secondary (Type + Priority) */
.entity-meta-row-secondary {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
}

/* Status Dot */
.entity-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.entity-status-dot.status-active {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.entity-status-dot.status-planned {
  background: #3b82f6;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.6);
}

.entity-status-dot.status-archived {
  background: #6b7280;
  box-shadow: none;
}

/* Entity Type Pill */
.entity-type-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 2px 8px;
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: var(--radius-lg);
  font-size: 10px;
  font-weight: 500;
  color: rgba(56, 189, 248, 0.95);
}

/* Priority Stars */
.entity-priority {
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(251, 191, 36, 0.9);
}

/* Link Type Icons in Cross-Connections */
.link-type-icon {
  font-size: 12px;
  opacity: 0.8;
  margin-right: 4px;
  flex-shrink: 0;
}

.link-type-icon.link-related { color: #38bdf8; }
.link-type-icon.link-partof { color: #60a5fa; }
.link-type-icon.link-influences { color: #34d399; }
.link-type-icon.link-depends { color: #fbbf24; }
.link-type-icon.link-learned { color: #f472b6; }
.link-type-icon.link-works { color: #22d3ee; }
.link-type-icon.link-recommends { color: #4ade80; }
.link-type-icon.link-conflicts { color: #f87171; }

/* Link Name in Cross-Connection Pill */
.cross-connection-pill .link-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Link Weight Badge */
.link-weight {
  font-size: 9px;
  padding: 1px 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
  margin-left: auto;
}

/* Entity Footer */
.entity-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.1);
}

.entity-footer-content {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
}

.footer-item {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  cursor: help;
}

.footer-item:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* Footer Version Badge (v3.2) */
.footer-version {
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: 10px;
  padding: 2px 8px;
  font-weight: 600;
  color: rgba(14, 165, 233, 0.9);
}

.footer-version:hover {
  background: rgba(14, 165, 233, 0.25);
  color: rgba(14, 165, 233, 1);
}

.footer-divider {
  color: rgba(255, 255, 255, 0.2);
}

/* ============================================
   PHASE 2: AI Insights & Quick Actions
   ============================================ */

/* AI Recommendation Cards */
.ai-recommendation-card {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
  border: 1px solid rgba(14, 165, 233, 0.25);
  border-radius: var(--radius-lg);
  padding: 12px;
  margin-bottom: 10px;
}

.ai-rec-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: 8px;
}

.ai-rec-icon {
  font-size: 16px;
}

.ai-rec-title {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.ai-rec-values {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: 6px;
}

.ai-rec-current {
  font-size: 18px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
}

.ai-rec-arrow {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.4);
}

.ai-rec-recommended {
  font-size: 20px;
  font-weight: 700;
}

.ai-rec-recommended.positive {
  color: #34d399;
}

.ai-rec-recommended.negative {
  color: #f87171;
}

.ai-rec-accept-btn {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.2);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #34d399;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-rec-accept-btn:hover {
  background: rgba(52, 211, 153, 0.3);
  transform: scale(1.1);
}

.ai-rec-accept-btn.accepted {
  background: #34d399;
  color: white;
}

.ai-rec-reason {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
  line-height: 1.4;
}

/* AI Insights List */
.ai-insights-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-top: 10px;
}

.ai-insight-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  border-left: 3px solid rgba(14, 165, 233, 0.5);
}

.ai-insight-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.ai-insight-content {
  flex: 1;
}

.ai-insight-content strong {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2px;
}

.ai-insight-content p {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  line-height: 1.4;
}

/* No Insights State */
.ai-no-insights {
  text-align: center;
  padding: 20px;
  color: rgba(255, 255, 255, 0.5);
}

.ai-no-insights-icon {
  font-size: 24px;
  display: block;
  margin-bottom: 8px;
}

.ai-no-insights p {
  font-size: 12px;
  margin: 0;
  line-height: 1.5;
}

/* AI Analysis Inline Button */
.ai-analyze-section-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #0ea5e9, #38bdf8);
  color: white;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-2xl);
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-analyze-section-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #0369a1, #0ea5e9);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

.ai-analyze-section-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* AI Analysis Results */
.ai-analysis-summary,
.ai-analysis-strengths,
.ai-analysis-improvements,
.ai-analysis-links,
.ai-analysis-children {
  padding: 10px;
  margin: 8px 0;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  border-left: 3px solid rgba(14, 165, 233, 0.5);
}

.ai-analysis-summary {
  border-left-color: rgba(59, 130, 246, 0.5);
}

.ai-analysis-strengths {
  border-left-color: rgba(52, 211, 153, 0.5);
}

.ai-analysis-improvements {
  border-left-color: rgba(251, 191, 36, 0.5);
}

.ai-analysis-links {
  border-left-color: rgba(236, 72, 153, 0.5);
}

.ai-analysis-children {
  border-left-color: rgba(14, 165, 233, 0.5);
}

.ai-analysis-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 6px;
}

.ai-analysis-summary p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
  margin: 0;
}

.ai-analysis-strengths ul,
.ai-analysis-improvements ul {
  margin: 0;
  padding-left: 16px;
}

.ai-analysis-strengths li,
.ai-analysis-improvements li {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 4px;
  line-height: 1.4;
}

/* AI Suggested Tags */
.ai-suggested-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-tag-link,
.ai-tag-child {
  display: inline-block;
  padding: 4px 10px;
  font-size: 10px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-tag-link {
  background: rgba(236, 72, 153, 0.15);
  color: #ec4899;
  border: 1px solid rgba(236, 72, 153, 0.3);
}

.ai-tag-link:hover {
  background: rgba(236, 72, 153, 0.25);
  transform: scale(1.05);
}

.ai-tag-child {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.ai-tag-child:hover {
  background: rgba(14, 165, 233, 0.25);
  transform: scale(1.05);
}

/* Quick Actions Bar */
.quick-actions-bar {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.15);
}

.quick-actions-content {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  max-width: 80px;
}

.quick-action-btn:hover {
  background: rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.4);
  transform: translateY(-2px);
}

.quick-action-btn:active {
  transform: translateY(0);
}

.qa-icon {
  font-size: 18px;
}

.qa-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Entity Header Hover Area (for description tooltip) */
.entity-header-hover-area {
  cursor: help;
  transition: opacity 0.2s ease;
}

.entity-header-hover-area:hover {
  opacity: 0.9;
}

.entity-header-hover-area:hover .entity-icon-large {
  transform: scale(1.05);
}

/* My Data in Header (compact version) */
.my-data-container-header {
  display: flex;
  gap: var(--spacing-sm);
  margin: 0 0 16px 0;
  align-items: flex-start;
}

.my-data-container-header #my-data-textarea {
  flex: 1;
  min-height: 80px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  transition: all 0.2s ease;
  font-family: inherit;
}

.my-data-container-header #my-data-textarea:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.6);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.my-data-container-header #my-data-textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.btn-save-mini {
  width: 32px;
  height: 32px;
  padding: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(37, 99, 235, 0.8));
  border: 1px solid rgba(59, 130, 246, 0.6);
  border-radius: var(--radius-sm);
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-save-mini:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 1), rgba(37, 99, 235, 1));
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.btn-save-mini:active {
  transform: scale(0.95);
}

.btn-save-mini.success {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.8), rgba(22, 163, 74, 0.8));
  border-color: rgba(34, 197, 94, 0.6);
}

.btn-save-mini.error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.8), rgba(220, 38, 38, 0.8));
  border-color: rgba(239, 68, 68, 0.6);
}

.entity-description {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  border-left: 3px solid rgba(255, 255, 255, 0.3);
  font-style: italic;
}

.entity-metrics {
  display: flex;
  gap: var(--space-3);
  margin-bottom: 12px;
}

.metric-item {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  transition: all 0.2s ease;
  cursor: help;
}

.metric-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.metric-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 4px;
}

.metric-value {
  font-size: 18px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.metric-value-input {
  width: 100%;
  max-width: 80px;
  background: transparent;
  border: none;
  font-size: 18px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  padding: 4px 0;
  text-align: center;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
  box-sizing: border-box;
}

.metric-value-input:focus {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-xs);
  padding: 4px 6px;
}

.metric-value-input::-webkit-inner-spin-button,
.metric-value-input::-webkit-outer-spin-button {
  opacity: 0.5;
}

.editable-metric {
  cursor: pointer;
}

.editable-metric:hover .metric-value-input {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-xs);
  padding: 4px 6px;
}

/* Importance Bar */
.importance-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.importance-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease, background 0.4s ease;
  box-shadow: 0 0 8px currentColor;
}

.importance-fill.high {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.importance-fill.medium {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.importance-fill.low {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

/* Tags */
.entity-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.entity-tag {
  font-size: 11px;
  padding: 4px 10px;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: var(--radius-lg);
  color: rgba(147, 197, 253, 1);
  white-space: nowrap;
  transition: all 0.2s ease;
}

.entity-tag:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}


/* =============================================================================
   USER DATA SECTION
   ============================================================================= */

.user-data-section {
  margin-top: 16px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.user-data-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-data-icon {
  font-size: 14px;
}

.user-data-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.7);
}

.user-data-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.user-data-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  font-size: 12px;
}

.user-data-label {
  color: rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
  min-width: 80px;
}

.user-data-value {
  color: rgba(255, 255, 255, 0.9);
  text-align: right;
  word-break: break-word;
  flex: 1;
}


/* =============================================================================
   CONTENT SECTIONS
   ============================================================================= */

.context-panel-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.context-panel-section {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.collapsible-title {
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.collapsible-title:hover {
  color: rgba(255, 255, 255, 0.8);
}

.collapse-icon {
  margin-left: auto;
  font-size: 10px;
  transition: transform 0.2s ease;
}

.collapsible-content {
  max-height: 2000px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 1;
}

.collapsible-content.collapsed {
  max-height: 0;
  opacity: 0;
}

.section-icon {
  font-size: 16px;
}

.section-count {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
}

/* Add Connection Button */
.add-connection-btn {
  margin-left: auto;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(100, 180, 255, 0.2);
  color: rgba(100, 180, 255, 0.9);
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.add-connection-btn:hover {
  background: rgba(100, 180, 255, 0.4);
  color: #fff;
  transform: scale(1.1);
}


/* =============================================================================
   RELATED ENTITIES
   ============================================================================= */

.related-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.related-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.related-item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: var(--entity-hover-color, rgba(255, 255, 255, 0.08));
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.related-item:hover::before {
  opacity: 1;
}

.related-item:hover {
  transform: translateX(-4px);
  box-shadow: 0 4px 12px var(--entity-shadow-color, rgba(0, 0, 0, 0.3));
}

.related-item:active {
  transform: translateX(-2px) scale(0.98);
}

.related-icon {
  width: 40px;
  height: 40px;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
  overflow: hidden;
  position: relative;
  padding: 0;
}

.related-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.related-item:hover .related-icon {
  transform: scale(1.1);
}

.related-info {
  flex: 1;
  min-width: 0;
}

.related-name {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.related-meta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.connection-type {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.connection-icon {
  font-size: 10px;
}

.related-importance {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.related-item:hover .related-importance {
  transform: scale(1.1);
  box-shadow: 0 0 8px currentColor;
}

.related-importance.high {
  background: rgba(16, 185, 129, 0.2);
  color: rgba(16, 185, 129, 1);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.related-importance.medium {
  background: rgba(245, 158, 11, 0.2);
  color: rgba(245, 158, 11, 1);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.related-importance.low {
  background: rgba(239, 68, 68, 0.2);
  color: rgba(239, 68, 68, 1);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: rgba(255, 255, 255, 0.4);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.3;
}

.empty-state-text {
  font-size: 14px;
  line-height: 1.6;
}

/* Connection Suggestions */
.suggestions-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 16px;
  background: rgba(14, 165, 233, 0.05);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}

.suggestions-icon {
  font-size: 32px;
  line-height: 1;
}

.suggestions-text strong {
  display: block;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 4px;
}

.suggestions-text p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

.suggestions-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.suggestion-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: var(--space-3);
  padding: 12px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s ease;
  align-items: center;
}

.suggestion-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.suggestion-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid;
  flex-shrink: 0;
}

.suggestion-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.suggestion-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.suggestion-name {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-score {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.suggestion-reasons {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.suggestion-reason {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.4;
}

.suggestion-add-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: rgba(14, 165, 233, 0.2);
  border: 1px solid rgba(14, 165, 233, 0.4);
  color: rgba(14, 165, 233, 1);
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.suggestion-add-btn:hover {
  background: rgba(14, 165, 233, 0.3);
  border-color: rgba(14, 165, 233, 0.6);
  transform: scale(1.1);
}

.suggestion-add-btn:active {
  transform: scale(0.95);
}


/* =============================================================================
   SCROLLBAR STYLING
   ============================================================================= */

.context-panel-content::-webkit-scrollbar {
  width: 8px;
}

.context-panel-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}

.context-panel-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-xs);
}

.context-panel-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}


/* =============================================================================
   LOADING STATES
   ============================================================================= */

.loading-skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(255, 255, 255, 0.06) 50%,
    rgba(255, 255, 255, 0.03) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-header {
  height: 24px;
  width: 70%;
  margin-bottom: 12px;
}

.skeleton-metric {
  height: 40px;
  margin-bottom: 8px;
}

.skeleton-item {
  height: 56px;
  margin-bottom: 8px;
}


/* =============================================================================
   ANIMATIONS
   ============================================================================= */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

@keyframes slideInRight {
  from {
    transform: translateX(20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-in-right {
  animation: slideInRight 0.4s ease;
}


/* =============================================================================
   CONTEXT GRAPH WINDOW - In-Window Panel (Fullscreen-kompatibel)
   ============================================================================= */

/* Container: Absolut im Fenster positioniert, damit das Panel im Fullscreen sichtbar bleibt */
#context-graph-panel-container {
  position: absolute;
  inset: 0;
  z-index: 100; /* Über Canvas/Content, unter Modals */
  pointer-events: none;
  overflow: hidden;
}

/* Panel innerhalb des Windows: absolute statt fixed, height: 100% statt 100vh */
#context-graph-panel-container .context-panel {
  position: absolute;
  height: 100%;
  z-index: 100;
  pointer-events: auto;
}


/* =============================================================================
   RESPONSIVE (Mobile)
   ============================================================================= */

@media (max-width: 768px) {
  .context-panel {
    width: 100%;
    height: 60vh;
    top: auto;
    bottom: 0;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(100%);
  }

  .context-panel.visible {
    transform: translateY(0);
  }

  .context-panel-header {
    padding: 16px;
  }

  .entity-name-large {
    font-size: 20px;
  }

  .context-panel-section {
    padding: 16px;
  }
}


/* =============================================================================
   CROSS-CONNECTIONS SECTION
   ============================================================================= */

.cross-connections-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-top: 12px;
}

.cross-connection-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-2xl);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: all 0.2s ease;
}

.cross-connection-pill img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.cross-connection-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.4);
}

.cross-connection-pill.muted {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =============================================================================
   INCOMING LINKS SECTION (v3.2 SSOT)
   ============================================================================= */

.incoming-links-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.incoming-link-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: var(--radius-lg);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: all 0.2s ease;
}

.incoming-link-pill img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.incoming-link-pill:hover {
  transform: translateX(4px);
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.5);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15);
}

.incoming-link-pill.muted {
  opacity: 0.5;
  cursor: not-allowed;
}

.incoming-link-pill .link-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.incoming-link-pill .link-type-icon {
  font-size: 14px;
  opacity: 0.8;
}

.incoming-link-pill .link-weight {
  font-size: 10px;
  padding: 2px 6px;
  background: rgba(34, 197, 94, 0.2);
  border-radius: var(--radius-md);
  color: rgba(34, 197, 94, 0.9);
  font-weight: 600;
}

/* Slide-in animation for incoming links */
@keyframes slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-left {
  animation: slide-in-left 0.3s ease forwards;
}


/* =============================================================================
   MY DATA SECTION
   ============================================================================= */

.my-data-container {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

#my-data-textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  transition: all 0.2s ease;
}

#my-data-textarea:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.6);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#my-data-textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.btn-save {
  align-self: flex-end;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(37, 99, 235, 0.8));
  border: 1px solid rgba(59, 130, 246, 0.6);
  border-radius: var(--radius-sm);
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-save:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 1), rgba(37, 99, 235, 1));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-save.success {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.8), rgba(22, 163, 74, 0.8));
  border-color: rgba(34, 197, 94, 0.6);
}

.btn-save.error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.8), rgba(220, 38, 38, 0.8));
  border-color: rgba(239, 68, 68, 0.6);
}


/* =============================================================================
   ASSIGNED EXPERTAIZER SECTION
   ============================================================================= */

.assigned-experts-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-top: 12px;
}

.expert-pill {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.expert-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(-2px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.expert-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.expert-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.expert-name {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.expert-title {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}


/* =============================================================================
   NETWORK METRICS SECTION (Feature 11 Phase 2)
   ============================================================================= */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  padding: 0;
}

.metric-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    rgba(100, 150, 255, 0.5),
    rgba(100, 200, 255, 0.5));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.metric-card:hover::before {
  opacity: 1;
}

.metric-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(100, 150, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.metric-card-full {
  grid-column: 1 / -1;
}

.metric-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: 12px;
}

.metric-icon {
  font-size: 20px;
}

.metric-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  flex: 1;
}

.metric-info-icon {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.4);
  cursor: help;
  transition: color 0.2s ease;
}

.metric-info-icon:hover {
  color: rgba(100, 150, 255, 0.8);
}

.metric-value-large {
  font-size: 32px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 8px;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: var(--spacing-xs);
}

.metric-unit {
  font-size: 16px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
}

/* Progress Bar */
.metric-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
  position: relative;
}

.metric-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Animated shimmer effect */
.metric-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Color coding by category */

/* Progress Bar Background (only) */
.metric-bar-fill.hub {
  background: linear-gradient(90deg, #10b981, #059669);
}

.metric-bar-fill.well-connected {
  background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.metric-bar-fill.moderate {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.metric-bar-fill.isolated,
.metric-bar-fill.low {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.metric-bar-fill.high,
.metric-bar-fill.complete {
  background: linear-gradient(90deg, #10b981, #059669);
}

.metric-bar-fill.strong {
  background: linear-gradient(90deg, #0ea5e9, #0369a1);
}

.metric-bar-fill.weak {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.metric-bar-fill.insufficient {
  background: linear-gradient(90deg, #6b7280, #4b5563);
}

/* Text Color (bright and readable on dark background) */
.metric-value-large.hub,
.metric-value-large.high,
.metric-value-large.complete {
  color: #34d399 !important; /* Bright green */
}

.metric-value-large.well-connected {
  color: #60a5fa !important; /* Bright blue */
}

.metric-value-large.moderate {
  color: #fbbf24 !important; /* Bright amber/yellow */
}

.metric-value-large.isolated,
.metric-value-large.low,
.metric-value-large.weak {
  color: #f87171 !important; /* Bright red */
}

.metric-value-large.strong {
  color: #38bdf8 !important; /* Bright cyan */
}

.metric-value-large.insufficient {
  color: #9ca3af !important; /* Bright gray */
}

/* Metric Interpretation */
.metric-interpretation {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
}

/* Metric Breakdown (for connections) */
.metric-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.breakdown-item {
  font-size: 11px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Position Details */
.position-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: 8px;
}

.position-item {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.position-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.position-value {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-transform: capitalize;
}

/* Loading State */
.metrics-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: 40px 20px;
  color: rgba(255, 255, 255, 0.6);
}

/* Placeholder State (Lazy Load) */
.metrics-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: 30px 20px;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s ease;
}

.metrics-placeholder:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(14, 165, 233, 0.3);
  color: rgba(255, 255, 255, 0.7);
}

.placeholder-icon {
  font-size: 32px;
  opacity: 0.5;
}

.metrics-placeholder p {
  font-size: 13px;
  margin: 0;
  text-align: center;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: rgba(100, 150, 255, 0.8);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error State */
.metrics-error {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.8);
}

.error-icon {
  font-size: 24px;
}

.error-text strong {
  display: block;
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.9);
}

.error-text p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

/* Footer */
.metrics-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
}

/* Tippy.js Theme for Metrics */
.tippy-box[data-theme~='expertaizer'] {
  background-color: rgba(26, 32, 44, 0.98);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  z-index: 99999 !important;
}

.tippy-box[data-theme~='expertaizer'][data-placement^='top'] > .tippy-arrow::before {
  border-top-color: rgba(26, 32, 44, 0.98);
}

.tippy-box[data-theme~='expertaizer'][data-placement^='bottom'] > .tippy-arrow::before {
  border-bottom-color: rgba(26, 32, 44, 0.98);
}

.tippy-box[data-theme~='expertaizer'][data-placement^='left'] > .tippy-arrow::before {
  border-left-color: rgba(26, 32, 44, 0.98);
}

.tippy-box[data-theme~='expertaizer'][data-placement^='right'] > .tippy-arrow::before {
  border-right-color: rgba(26, 32, 44, 0.98);
}

/* ================================
   ADVANCED METRICS STYLES (Phase 3)
   ================================ */

/* Advanced Metrics Grid - 2 columns for better space usage */
.advanced-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
  margin-top: 12px;
}

/* Advanced Metric Cards - Wider, better proportioned */
.metric-card.advanced {
  background: linear-gradient(
    135deg,
    rgba(14, 165, 233, 0.05) 0%,
    rgba(59, 130, 246, 0.05) 100%
  );
  border: 1px solid rgba(14, 165, 233, 0.2);
  padding: 16px;
  min-height: 160px;
}

.metric-card.advanced:hover {
  background: linear-gradient(
    135deg,
    rgba(14, 165, 233, 0.08) 0%,
    rgba(59, 130, 246, 0.08) 100%
  );
  border-color: rgba(14, 165, 233, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.15);
}

/* Full-width card for Path to Hubs */
.metric-card.advanced.full-width {
  grid-column: 1 / -1;
  min-height: auto;
}

/* Advanced Metric Headers - Smaller fonts */
.metric-card.advanced .metric-header h4 {
  font-size: 13px;
  margin: 0;
}

.metric-card.advanced .metric-icon {
  font-size: 18px;
}

/* Advanced Metric Values - Slightly smaller */
.metric-card.advanced .metric-value-large {
  font-size: 28px;
  margin: 8px 0;
}

/* Approximation Badge */
.approx-badge {
  font-size: 16px;
  opacity: 0.7;
  margin-left: 4px;
}

/* Metric Note (for approximation message) */
.metric-note {
  font-size: 10px;
  color: rgba(251, 191, 36, 0.8);
  margin-top: 4px;
  font-style: italic;
}

/* Hub Paths List */
.hub-paths {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-top: 12px;
}

.hub-path-item {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: var(--spacing-sm);
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.hub-path-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

.hub-path-item.nearest {
  background: rgba(14, 165, 233, 0.08);
  border-color: rgba(14, 165, 233, 0.2);
}

.hub-rank {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
}

.hub-name {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-distance {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-lg);
  white-space: nowrap;
}

.hub-distance.is-hub {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #1a202c;
  font-size: 16px;
  padding: 2px 8px;
}

.hub-distance.connected {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
}

.hub-distance.disconnected {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

/* Advanced Metrics - Color Categories (Purple/Teal Theme) */

/* Betweenness Categories */
.metric-value-large.critical-bridge { color: #7dd3fc !important; } /* Sky 300 */
.metric-value-large.important-bridge { color: #38bdf8 !important; } /* Sky 400 */
.metric-value-large.moderate-bridge { color: #60a5fa !important; } /* Blue 400 */
.metric-value-large.minor-bridge { color: #9ca3af !important; } /* Gray 400 */

.metric-progress-bar.critical-bridge {
  background: linear-gradient(90deg, #7dd3fc 0%, #38bdf8 100%);
}
.metric-progress-bar.important-bridge {
  background: linear-gradient(90deg, #38bdf8 0%, #0ea5e9 100%);
}
.metric-progress-bar.moderate-bridge {
  background: linear-gradient(90deg, #60a5fa 0%, #3b82f6 100%);
}
.metric-progress-bar.minor-bridge {
  background: linear-gradient(90deg, #9ca3af 0%, #6b7280 100%);
}

/* Closeness Categories */
.metric-value-large.very-central { color: #22d3ee !important; } /* Cyan 400 */
.metric-value-large.central { color: #06b6d4 !important; } /* Cyan 500 */
.metric-value-large.peripheral { color: #fbbf24 !important; } /* Amber 400 */

.metric-progress-bar.very-central {
  background: linear-gradient(90deg, #22d3ee 0%, #06b6d4 100%);
}
.metric-progress-bar.central {
  background: linear-gradient(90deg, #06b6d4 0%, #0891b2 100%);
}
.metric-progress-bar.peripheral {
  background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
}

/* Influence Categories */
.metric-value-large.highly-influential { color: #fbbf24 !important; } /* Amber 400 */
.metric-value-large.influential { color: #60a5fa !important; } /* Blue 400 */
.metric-value-large.moderate-influence { color: #38bdf8 !important; } /* Sky 400 */
.metric-value-large.minimal-influence { color: #9ca3af !important; } /* Gray 400 */

.metric-progress-bar.highly-influential {
  background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
}
.metric-progress-bar.influential {
  background: linear-gradient(90deg, #60a5fa 0%, #3b82f6 100%);
}
.metric-progress-bar.moderate-influence {
  background: linear-gradient(90deg, #38bdf8 0%, #0ea5e9 100%);
}
.metric-progress-bar.minimal-influence {
  background: linear-gradient(90deg, #9ca3af 0%, #6b7280 100%);
}

/* Responsive: Stack to 2 columns on smaller screens */
@media (max-width: 768px) {
  .advanced-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric-card.advanced.full-width {
    grid-column: 1 / -1;
  }
}

/* Responsive: Stack to 1 column on mobile */
@media (max-width: 480px) {
  .advanced-metrics-grid {
    grid-template-columns: 1fr;
  }
}


/* =============================================================================
   TOAST NOTIFICATIONS
   ============================================================================= */

.context-panel-toast {
  position: fixed;
  top: 80px;
  right: 380px; /* Next to context panel */
  min-width: 300px;
  max-width: 400px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 500;
  z-index: 10000;

  /* Glassmorphism */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;

  /* Animation */
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.context-panel-toast.show {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* Success Toast */
.context-panel-toast.toast-success {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.9) 0%,
    rgba(5, 150, 105, 0.85) 100%
  );
  color: #fff;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Error Toast */
.context-panel-toast.toast-error {
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.9) 0%,
    rgba(220, 38, 38, 0.85) 100%
  );
  color: #fff;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Info Toast */
.context-panel-toast.toast-info {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.9) 0%,
    rgba(37, 99, 235, 0.85) 100%
  );
  color: #fff;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Warning Toast */
.context-panel-toast.toast-warning {
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.9) 0%,
    rgba(217, 119, 6, 0.85) 100%
  );
  color: #fff;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Toast positioning when context panel is closed */
@media (max-width: 1200px) {
  .context-panel-toast {
    right: 20px;
  }
}

/* Mobile positioning */
@media (max-width: 768px) {
  .context-panel-toast {
    top: 20px;
    right: 20px;
    left: 20px;
    min-width: auto;
    max-width: none;
    transform: translateY(-100px);
  }

  .context-panel-toast.show {
    transform: translateY(0);
  }
}



