@use '../variables' as v;
@use '../mixins' as m;

// Automation canvas wrapper
.canvas-wrapper {
  @include m.card-base;
  height: calc(100vh - 180px);
  min-height: 540px;
  overflow: hidden;
  position: relative;
  background: #f8f9fb;
  background-image:
    radial-gradient(circle, v.$gray-300 1px, transparent 1px);
  background-size: 24px 24px;
}

.canvas-placeholder {
  @include m.flex-center;
  flex-direction: column;
  height: 100%;
  gap: 16px;
  text-align: center;
  padding: 40px;

  &-icon {
    width: 64px;
    height: 64px;
    background: v.$white;
    border: 1px solid v.$border-color;
    border-radius: v.$radius-xl;
    @include m.flex-center;
    box-shadow: v.$shadow;

    svg { width: 28px; height: 28px; color: v.$gray-400; }
  }

  h3 { font-size: v.$font-size-lg; font-weight: 600; color: v.$gray-700; }
  p  { font-size: v.$font-size-sm; color: v.$gray-400; max-width: 340px; line-height: 1.6; }
}

.canvas-toolbar {
  position: absolute;
  top: 16px;
  left: 16px;
  @include m.flex-start;
  gap: 6px;
  background: v.$white;
  border: 1px solid v.$border-color;
  border-radius: v.$radius;
  padding: 5px;
  box-shadow: v.$shadow-sm;
}

.canvas-minimap {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 160px;
  height: 100px;
  background: v.$white;
  border: 1px solid v.$border-color;
  border-radius: v.$radius;
  box-shadow: v.$shadow-sm;
  overflow: hidden;
}

// Workflow node (preview)
.workflow-node {
  @include m.card-base;
  padding: 12px 16px;
  min-width: 200px;
  max-width: 260px;
  display: inline-block;

  &-type {
    font-size: v.$font-size-2xs;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: v.$gray-400;
    margin-bottom: 6px;
    @include m.flex-start;
    gap: 5px;

    svg { width: 12px; height: 12px; }
  }

  &-title { font-size: v.$font-size-sm; font-weight: 600; color: v.$gray-800; }
  &-sub   { font-size: v.$font-size-xs; color: v.$gray-500; margin-top: 3px; }

  &--trigger {
    border-color: v.$primary-border;
    .workflow-node-type { color: v.$primary; }
  }

  &--action {
    border-color: v.$info-border;
    .workflow-node-type { color: v.$info; }
  }

  &--condition {
    border-color: v.$warning-border;
    .workflow-node-type { color: v.$warning; }
  }
}

// Automation list item
.automation-item {
  @include m.card-base;
  padding: 16px 20px;
  @include m.flex-between;
  gap: 16px;
  transition: box-shadow v.$transition-base;

  &:hover { box-shadow: v.$shadow; }

  &-info { flex: 1; min-width: 0; }
  &-name {
    font-size: v.$font-size-base;
    font-weight: 600;
    color: v.$gray-800;
    margin-bottom: 4px;
    @include m.truncate;
  }

  &-meta {
    @include m.flex-start;
    gap: 10px;
    font-size: v.$font-size-xs;
    color: v.$gray-400;

    svg { width: 13px; height: 13px; }
  }

  &-actions {
    @include m.flex-start;
    gap: 8px;
    flex-shrink: 0;
  }
}
