/* ===== Diagnosis System Styles ===== */

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

/* ── Header ── */
.diag-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.diag-header h2 {
  margin: 0;
  font-size: 1.4em;
}
.diag-target-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.diag-target-selector select {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #d0d7de;
  font-size: 13px;
  background: #fff;
  color: #1e293b;
}
.btn-secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.btn-secondary:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
}

/* ── Overview Cards ── */
.diag-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.diag-card {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 1px solid #f0f0f0;
}
.diag-card-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
}
.diag-card-label {
  font-size: 13px;
  color: #64748b;
  margin-top: 4px;
}
.diag-card-sub {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

/* ── Sections ── */
.diag-section {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 1px solid #f0f0f0;
}
.diag-section h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

/* ── Recommendation List ── */
.diag-rec-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.diag-rec-item:hover {
  background: #f8fafc;
}
.diag-rec-rank {
  width: 20px;
  height: 20px;
  background: #eef2ff;
  color: #4338ca;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}
.diag-rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.diag-rec-name {
  flex: 1;
  font-size: 14px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.diag-rec-mastery {
  font-weight: 600;
  font-size: 14px;
  min-width: 36px;
  text-align: right;
}
.diag-rec-priority {
  font-size: 11px;
  min-width: 55px;
}
.diag-rec-badge {
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
}

/* ── Stat Badges ── */
.diag-stat-badge {
  background: #f8fafc;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  border: 1px solid #e2e8f0;
}

/* ── D3 Visualization Containers ── */
#mindmap-container,
#graph-container {
  background: #fafbfc;
}

/* ── Dark Mode Overrides ── */
@media (prefers-color-scheme: dark) {
  .diag-card,
  .diag-section {
    background: #161b22;
    border-color: #30363d;
    box-shadow: none;
  }
  .diag-card-value {
    color: #e2e8f0;
  }
  .diag-card-label {
    color: #94a3b8;
  }
  .diag-rec-item:hover {
    background: #1c2129;
  }
  .diag-stat-badge {
    background: #1c2129;
    border-color: #30363d;
    color: #cbd5e1;
  }
  .diag-target-selector select {
    background: #161b22;
    color: #c9d1d9;
    border-color: #30363d;
  }
  .btn-secondary {
    background: #1c2129;
    color: #cbd5e1;
    border-color: #30363d;
  }
  .btn-secondary:hover {
    background: #2d333b;
  }
  #mindmap-container,
  #graph-container {
    background: #0d1117;
    border-color: #30363d !important;
  }
  .diag-header h2 {
    color: #e2e8f0;
  }
  .syllabus-level-badge {
    background: #1c2129;
    color: #94a3b8;
    border-color: #30363d;
  }
}

/* ── Syllabus Level Badge ── */
.syllabus-level-badge {
  display: inline-block;
  background: #eef2ff;
  color: #4338ca;
  font-size: 10px;
  font-weight: 600;
  padding: 0 5px;
  border-radius: 3px;
  line-height: 16px;
  border: 1px solid #c7d2fe;
}
