/* ========================================
   Semantic Analysis Layer Styles (Phase 3.5)
   ======================================== */

/* ========================================
   CSS Variables - Cluster Color Palette
   ======================================== */
:root {
  --cluster-0: #5B8FF9;
  --cluster-1: #61DDAA;
  --cluster-2: #65789B;
  --cluster-3: #F6BD16;
  --cluster-4: #7262FD;
  --cluster-5: #78D3F8;
  --cluster-6: #F6903D;
}

/* ========================================
   Semantic Section Layout
   ======================================== */
#semantic-section {
  margin-top: 24px;
}

.semantic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 16px;
}

.semantic-left {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 16px;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.semantic-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ========================================
   SVG Bubble Map
   ======================================== */
#semantic-bubblemap {
  display: block;
  width: 100%;
  height: 420px;
}

.semantic-node {
  cursor: pointer;
  transition: all 0.3s;
}

.semantic-node:hover circle {
  opacity: 0.8;
  stroke-width: 3px;
}

.semantic-node.active circle {
  stroke-width: 4px;
  filter: drop-shadow(0 0 8px rgba(0,0,0,0.3));
}

.semantic-node circle {
  fill: var(--cluster-0);
  stroke: #ffffff;
  stroke-width: 2px;
  transition: all 0.3s;
}

.semantic-node.cluster-0 circle { fill: var(--cluster-0); }
.semantic-node.cluster-1 circle { fill: var(--cluster-1); }
.semantic-node.cluster-2 circle { fill: var(--cluster-2); }
.semantic-node.cluster-3 circle { fill: var(--cluster-3); }
.semantic-node.cluster-4 circle { fill: var(--cluster-4); }
.semantic-node.cluster-5 circle { fill: var(--cluster-5); }
.semantic-node.cluster-6 circle { fill: var(--cluster-6); }

.semantic-label {
  font-size: 12px;
  font-weight: bold;
  fill: #333;
  text-anchor: middle;
  pointer-events: none;
  dominant-baseline: middle;
}

/* ========================================
   Insight Pills (Top Summary Badges)
   ======================================== */
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: all 0.2s;
}

.pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.pill.new {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.pill.hot {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.pill-icon {
  font-size: 14px;
}

/* ========================================
   Concept Cards (Cluster Details)
   ======================================== */
.concept-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 8px;
}

.concept-list::-webkit-scrollbar {
  width: 6px;
}

.concept-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.concept-list::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.concept-list::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.concept-card {
  background: #ffffff;
  border-radius: 8px;
  border-left: 4px solid var(--cluster-0);
  padding: 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: all 0.2s;
}

.concept-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

.concept-card.active {
  border-left-width: 6px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.concept-card.cluster-0 { border-left-color: var(--cluster-0); }
.concept-card.cluster-1 { border-left-color: var(--cluster-1); }
.concept-card.cluster-2 { border-left-color: var(--cluster-2); }
.concept-card.cluster-3 { border-left-color: var(--cluster-3); }
.concept-card.cluster-4 { border-left-color: var(--cluster-4); }
.concept-card.cluster-5 { border-left-color: var(--cluster-5); }
.concept-card.cluster-6 { border-left-color: var(--cluster-6); }

/* ========================================
   Concept Card Header
   ======================================== */
.concept-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.concept-card-title {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  line-height: 1.4;
}

.concept-card-size {
  font-size: 12px;
  color: #999;
  white-space: nowrap;
  margin-left: 12px;
}

/* ========================================
   Concept Card Body
   ======================================== */
.concept-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.concept-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.keyword-tag {
  display: inline-block;
  background: #e9ecef;
  color: #333;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.2s;
}

.keyword-tag:hover {
  background: #dee2e6;
}

.keyword-tag.primary {
  background: linear-gradient(135deg, #667eea33 0%, #764ba233 100%);
  border: 1px solid #667eea;
  font-weight: 600;
}

/* ========================================
   Concept Metadata
   ======================================== */
.concept-metadata {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 12px;
}

.metadata-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.metadata-label {
  color: #666;
}

.metadata-value {
  font-weight: 600;
  color: #333;
}

.metadata-value.rising {
  color: #28a745;
}

.metadata-value.falling {
  color: #dc3545;
}

.metadata-value.stable {
  color: #6c757d;
}

/* ========================================
   Concept Brands
   ======================================== */
.concept-brands {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #666;
}

.concept-brands strong {
  color: #333;
}

.brand-tag {
  display: inline-block;
  background: #f8f9fa;
  color: #495057;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid #dee2e6;
}

/* ========================================
   Empty State
   ======================================== */
.semantic-empty {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.semantic-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.semantic-empty-message {
  font-size: 16px;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
  .semantic-grid {
    grid-template-columns: 1fr;
  }

  .semantic-left {
    min-height: 300px;
  }

  #semantic-bubblemap {
    height: 300px;
  }

  .concept-list {
    max-height: none;
  }

  .concept-card-header {
    flex-direction: column;
    gap: 8px;
  }

  .concept-card-size {
    margin-left: 0;
  }

  .concept-metadata {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .pill {
    font-size: 11px;
    padding: 5px 10px;
  }

  .concept-card-title {
    font-size: 14px;
  }

  .semantic-left {
    padding: 8px;
  }
}
