ui/components-lib/src/components/CommitInfo.scss
@use '../styles/colors' as *;

// Tooltip
.tooltip-container {
  position: absolute;
  top: 20px;
  left: 50px;
  z-index: 1000;
  pointer-events: auto; // Fix for tooltip flashing - allows tooltip to receive mouse events
}

.github-tooltip {
  background: #24292e;
  color: white;
  padding: 6px 8px;
  font-size: 12px;
  min-width: 120px;
  max-width: 400px;
  width: max-content;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  word-wrap: break-word;
  word-break: break-word;
  white-space: pre-wrap;
  line-height: 1.4;
}

.tooltip-subject {
  font-weight: 600;
  margin-bottom: 4px;
  white-space: pre-wrap;
}

.tooltip-body {
  white-space: pre-wrap;
}

.commits-section {
  position: relative;
  margin-top: -10px;
  margin-bottom: 10px;
  padding-bottom: 16px;
}

.commit-group {
  &.proposed {
    border-top: 3px solid $argo-running;
    margin: 10px -24px -24px -24px;
    background: linear-gradient(135deg, rgba(13, 173, 234, 0.06) 0%, rgba(13, 173, 234, 0.03) 100%);
    border-radius: 8px;
    padding: 24px 24px 0 24px;
  }
}

.commit-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -5px;
}

.commit-group-title {
  font-size: 16px;
  color: $argo-color-gray-7;
  letter-spacing: 0.3px;
  padding-left: 10px;
  gap: 12px;
  margin-left: -8px;
  line-height: 1;
  display: flex;
  align-items: center;
}

.pr-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: $argo-running;
  background: rgba(13, 173, 234, 0.08);
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid rgba(13, 173, 234, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;

  &:hover {
    background: rgba(13, 173, 234, 0.15);
    border-color: rgba(13, 173, 234, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(13, 173, 234, 0.2);
  }

  .pr-icon {
    font-size: 14px;
    color: $argo-running;
  }

  &.pr-merged {
    color: $argo-merged;
    background: rgba(111, 66, 193, 0.08);
    border: 1px solid rgba(111, 66, 193, 0.2);

    &:hover {
      background: rgba(111, 66, 193, 0.15);
      border-color: rgba(111, 66, 193, 0.4);
      box-shadow: 0 2px 4px rgba(111, 66, 193, 0.2);
    }

    .pr-icon {
      color: $argo-merged;
    }
  }
}

.commit-info {
  margin-bottom: 12px;
  padding: 16px 0;
  min-width: 180px;
  height: 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.commit-content {
  margin-left: 50px;
}

.commit-icon-wrapper {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 40px;
}

.commit-icon {
  font-size: 35px;
  color: $argo-color-gray-7;
  flex-shrink: 0;
  margin: 0;
}

.commit-code {
  margin-left: 50px;
  margin-top: -30px;
  position: relative;

  &::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 50%;
    width: 25px;
    height: 2px;
    background-color: $argo-color-gray-7;
  }

  &::after {
    content: '';
    position: absolute;
    left: -30px;
    top: 8px;
    width: 2px;
    height: 43%;
    background-color: $argo-color-gray-7;
  }
}

.commit-header {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}

.commit-meta {
  font-size: 12px;
  color: $argo-color-gray-5;
  min-height: 16px;
}

.commit-author {
  font-weight: 500;
  color: $argo-color-gray-6;
}

.commit-date {
  margin-left: 4px;
  color: $argo-color-gray-6;
}

.commit-sha {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Liberation Mono', 'Courier New', monospace;
  font-size: 12px;
  color: $argo-color-gray-7;
  background-color: #f5f5f5;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid #e0e0e0;
}

.commit-sha-link {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Liberation Mono', 'Courier New', monospace;
  font-size: 12px;
  color: $argo-color-gray-7;
  background-color: #f5f5f5;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid #e0e0e0;
  text-decoration: none;
  transition: all 0.2s ease;

  &:hover {
    text-decoration: underline;
    background-color: #e8f4fd;
    border-color: #007bff;
    color: #007bff;
  }

  &:focus {
    outline: 2px solid #007bff;
    outline-offset: 1px;
  }
}

.commit-subject {
  font-family: 'Heebo', sans-serif;
  font-size: 15px;
  color: $argo-color-gray-7;
  margin-left: 12px;
  flex: 0.9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
  position: relative;
}
