/* Attachment Queue */
.copilotKitAttachmentQueue {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px;
  padding: 8px;
}

.copilotKitAttachmentQueueItem {
  position: relative;
  display: inline-flex;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--copilot-kit-separator-color);
  background: var(--copilot-kit-input-background-color);
}

.copilotKitAttachmentQueueItem--image,
.copilotKitAttachmentQueueItem--video {
  width: 72px;
  height: 72px;
}

.copilotKitAttachmentQueueItem--audio {
  min-width: 200px;
  max-width: 280px;
  flex-direction: column;
  padding: 4px;
}

.copilotKitAttachmentQueueItem--document {
  padding: 8px 12px;
  max-width: 200px;
}

.copilotKitAttachmentQueueOverlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.copilotKitAttachmentQueueSpinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: copilotKitSpin 0.6s linear infinite;
}

@keyframes copilotKitSpin {
  to {
    transform: rotate(360deg);
  }
}

.copilotKitAttachmentQueueRemoveButton {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 10px;
  padding: 0;
  z-index: 2;
  line-height: 1;
}

.copilotKitAttachmentQueueRemoveButton:hover {
  background: rgba(0, 0, 0, 0.8);
}

.copilotKitAttachmentQueuePreviewPlaceholder {
  width: 100%;
  height: 100%;
  background: var(--copilot-kit-input-background-color);
}

.copilotKitAttachmentQueuePreviewImage {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Audio preview in queue */
.copilotKitAttachmentQueuePreviewAudio {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.copilotKitAttachmentQueuePreviewAudio audio {
  width: 100%;
  height: 32px;
}

/* Video preview in queue */
.copilotKitAttachmentQueuePreviewVideo {
  width: 100%;
  height: 100%;
}

/* Document preview in queue */
.copilotKitAttachmentQueuePreviewDocument {
  display: flex;
  align-items: center;
  gap: 8px;
}

.copilotKitAttachmentQueueDocIcon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--copilot-kit-primary-color, #6366f1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
}

.copilotKitAttachmentQueueDocInfo {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.copilotKitAttachmentQueueFilename {
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copilotKitAttachmentQueueFileSize {
  font-size: 11px;
  color: var(--copilot-kit-secondary-contrast-color);
}

/* Drag-and-drop overlay */
.copilotKitDragOver {
  outline: 2px dashed var(--copilot-kit-primary-color, #6366f1);
  outline-offset: -4px;
  border-radius: 8px;
}

/* Attachment Rendering in Messages */
.copilotKitAttachment {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  max-width: 100%;
}

.copilotKitAttachmentAudio audio {
  max-width: 300px;
  width: 100%;
  height: 40px;
}

.copilotKitAttachmentVideo video {
  max-width: 400px;
  width: 100%;
  border-radius: 8px;
}

.copilotKitAttachmentDocument {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--copilot-kit-separator-color);
  border-radius: 8px;
  background: var(--copilot-kit-input-background-color);
}

.copilotKitAttachmentDocIcon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--copilot-kit-primary-color, #6366f1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
  flex-shrink: 0;
}

.copilotKitAttachmentDocInfo {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.copilotKitAttachmentDocName {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copilotKitAttachmentDocMeta {
  font-size: 11px;
  color: var(--copilot-kit-secondary-contrast-color);
}
