:host {
  display: block;
  position: relative;
}

.kanban-page {
  width: 100%;
  min-height: 100vh;
  padding: 24px;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.kanban-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;

  .page-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 4px 0;
  }

  .page-subtitle {
    font-size: 13px;
    color: #666;
    margin: 0;
  }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;

  .filter-label {
    font-size: 13px;
    font-weight: 500;
    color: #555;
  }
}

.custom-select-wrapper {
  position: relative;
  min-width: 220px;

  &::after {
    content: '▾';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    pointer-events: none;
    font-size: 14px;
  }
}

.custom-select {
  width: 100%;
  padding: 10px 28px 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;

  &:hover {
    border-color: #d0d0d0;
    background: #fafafa;
  }
  &:focus {
    border-color: #2563eb;
  }
}

.action-error-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13px;

  mat-icon {
    font-size: 18px;
    width: 18px;
    height: 18px;
  }

  .dismiss-btn {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: #b91c1c;
    display: flex;
    align-items: center;

    mat-icon {
      font-size: 16px;
      width: 16px;
      height: 16px;
    }
  }
}

.loading-state {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 40px 0;
  justify-content: center;
  color: #666;
  font-size: 14px;

  .spin {
    animation: gb-kanban-spin 1s linear infinite;
  }
}

@keyframes gb-kanban-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  background-color: #ffffff;
  border-radius: 12px;
  border: 1px solid #e8e8e8;
  text-align: center;

  .empty-icon {
    font-size: 56px;
    width: 56px;
    height: 56px;
    color: #d0d0d0;
    margin-bottom: 16px;
  }

  h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px 0;
  }

  p {
    font-size: 14px;
    color: #666;
    margin: 0;
    max-width: 420px;
  }
}

.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.kanban-column {
  flex: 0 0 280px;
  width: 280px;
  background: #f5f6f8;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 200px);
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #e8e8e8;

  .column-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
  }

  .column-count {
    background: #e5e7eb;
    color: #4b5563;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    padding: 2px 8px;
    min-width: 20px;
    text-align: center;
  }
}

.column-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 80px;
}

.column-empty {
  font-size: 12px;
  color: #999;
  text-align: center;
  padding: 20px 0;
}

.kanban-card {
  background: #ffffff;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: grab;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease;

  &:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }

  &.cdk-drag-preview {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  }

  &.cdk-drag-placeholder {
    opacity: 0.3;
  }
}

.card-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-name {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  font-size: 11px;
  color: #999;
}

.cdk-drag-animating {
  transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
}

.column-body.cdk-drop-list-dragging .kanban-card:not(.cdk-drag-placeholder) {
  transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
}
