/* FloatingRobot.css */

/* 悬浮机器人容器 */
.floating-robot {
  position: fixed;
  z-index: 9998;
  display: flex;
  align-items: center;
  cursor: pointer;
}

/* 拖拽时的样式 */
.floating-robot.dragging {
  cursor: grabbing;
  z-index: 10000;
}

.floating-robot.dragging .robot-btn {
  transform: scale(1.1);
  box-shadow: 0 8px 32px var(--color-primary-opacity-50);
}

/* 右侧位置 */
.floating-robot.right {
  right: 16px;
}

/* 左侧位置 */
.floating-robot.left {
  left: 16px;
}

/* 机器人图标按钮 */
.robot-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  position: relative;
}

.robot-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px var(--color-primary-opacity-30);
}

/* 呼吸动画 */
.robot-btn::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--color-primary);
  opacity: 0.3;
  animation: robot-pulse 2s ease-in-out infinite;
}

@keyframes robot-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.1;
  }
}

/* 点击涟漪效果 */
.robot-btn.rippling::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: white;
  opacity: 0.5;
  animation: robot-ripple 0.6s ease-out forwards;
}

@keyframes robot-ripple {
  from {
    transform: scale(0.8);
    opacity: 0.5;
  }
  to {
    transform: scale(2);
    opacity: 0;
  }
}

/* SVG图标样式 */
.robot-icon {
  width: 36px;
  height: 36px;
}

/* 拖拽指示器 */
.drag-indicator {
  position: fixed;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-container);
  border: 1px solid var(--color-primary);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  color: var(--color-primary);
  font-size: 14px;
  z-index: 9999;
  animation: indicator-bounce 0.3s ease-out;
}

.drag-indicator.left {
  left: 8px;
}

.drag-indicator.right {
  right: 8px;
}

.drag-indicator-text {
  font-weight: 500;
}

@keyframes indicator-bounce {
  from {
    opacity: 0;
    transform: translateY(-50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
}

[data-theme='dark'] .drag-indicator {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* 展开面板 */
.robot-panel {
  position: absolute;
  width: 280px;
  background: var(--bg-container);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

/* 右侧面板位置（向下展开） */
.floating-robot.right .robot-panel {
  right: 56px;
  top: 0;
}

/* 左侧面板位置（向下展开） */
.floating-robot.left .robot-panel {
  left: 56px;
  top: 0;
}

/* 面板向上展开 */
.floating-robot.panel-upward.right .robot-panel {
  top: auto;
  bottom: 0;
  transform: translateY(-10px);
}

.floating-robot.panel-upward.left .robot-panel {
  top: auto;
  bottom: 0;
  transform: translateY(-10px);
}

.floating-robot.expanded .robot-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 反馈面板 */
.feedback-panel {
  position: absolute;
  width: 340px;
  background: var(--bg-container);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  padding: 16px;
  z-index: 9999;
}

/* 反馈面板在机器人右侧时，显示在左侧 */
.feedback-panel-left {
  right: 340px;
  top: 0;
}

/* 反馈面板在机器人左侧时，显示在右侧 */
.feedback-panel-right {
  left: 340px;
  top: 0;
}

/* 反馈面板向上展开 */
.feedback-panel-upward.feedback-panel-left {
  top: auto;
  bottom: 0;
}

.feedback-panel-upward.feedback-panel-right {
  top: auto;
  bottom: 0;
}

/* 深色模式适配 */
[data-theme='dark'] .robot-btn {
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

[data-theme='dark'] .robot-btn:hover {
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.15);
}

[data-theme='dark'] .robot-panel,
[data-theme='dark'] .feedback-panel {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border-color: var(--border-color);
}

/* 面板标题 */
.panel-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 面板信息项 */
.panel-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 8px;
  color: var(--text-primary);
  transition: background 0.2s ease;
}

.panel-item:hover {
  background: var(--color-primary-opacity-10);
}

.panel-item-icon {
  font-size: 18px;
  color: var(--color-primary);
}

.panel-item-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-item-label {
  font-size: 14px;
}

.panel-item-value {
  font-size: 13px;
  color: var(--text-secondary);
}

/* 可点击的链接项 */
.panel-item.clickable {
  cursor: pointer;
}

.panel-item.clickable:hover {
  background: var(--color-primary-opacity-15);
}

/* 反馈表单样式 */
.feedback-form-section {
  margin-bottom: 12px;
}

.feedback-form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.feedback-type-select {
  margin-bottom: 0;
}

.feedback-textarea {
  margin-bottom: 0;
}

.feedback-submit-btn {
  width: 100%;
  margin-top: 4px;
}

/* 图片预览区域 */
.feedback-images-section {
  margin-bottom: 12px;
}

.feedback-images-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.feedback-images-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.feedback-image-item {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.feedback-image-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feedback-image-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 10px;
  transition: background 0.2s ease;
}

.feedback-image-remove:hover {
  background: rgba(239, 68, 68, 0.9);
}

/* 空状态提示 */
.panel-empty {
  padding: 16px;
  text-align: center;
}

.panel-empty-text {
  color: var(--text-secondary);
  font-size: 13px;
}

/* 关闭按钮 */
.panel-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.panel-close:hover {
  background: var(--color-primary-opacity-10);
  color: var(--color-primary);
}