@import '../common.less';

/* 底部输入区域容器 */
.footer-input-area {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 15px;
  background-color: #ffffff;
  border-top: none;
  position: relative;
  max-width: 450px;
  margin: 0 auto;
}

/* 输入区域外壳 - 添加 !important 以覆盖所有可能的样式 */
.input-wrapper {
  position: relative !important;
  width: 100% !important;
  border: 1px solid @border-color !important;
  border-radius: 18px !important;
  background: transparent !important;
  box-sizing: border-box !important;
  transition: all 0.2s ease !important;
  overflow: visible !important;
  padding: 0 !important;
  margin: 0 auto !important;
  margin-top: 8px !important; /* 增加顶部外边距，避免与按钮重叠 */
}

.input-wrapper:hover, 
.input-wrapper:focus-within {
  border-color: @primary-color !important;
  box-shadow: 0 0 0 1px rgba(6, 177, 171, 0.1) !important;
}

/* 底部区域的加载指示器 */
.footer-loading-indicator {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: 2px !important;
  background-color: transparent !important;
  overflow: hidden !important;
  z-index: 10 !important;
}

.footer-loading-indicator::after {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: -100% !important;
  width: 100% !important;
  height: 100% !important;
  background-color: @primary-color !important;
  animation: loading-progress 1.5s infinite ease-in-out !important;
}

@keyframes loading-progress {
  0% { left: -100% !important; }
  100% { left: 100% !important; }
}

/* Ant Design Form 相关样式 */
.footer-input-area .ant-form,
.footer-input-area .ant-form-item {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.footer-input-area .ant-form-item-control {
  line-height: normal !important;
}

/* 输入容器 */
.footer-input-area .textarea-container {
  position: relative !important;
  width: 100% !important;
  border-radius: 18px !important;
  overflow: hidden !important;
  background-color: transparent !important;
}

.footer-input-area .input-with-button {
  position: relative !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  background-color: transparent !important;
  border: none !important;
  padding: 0 !important;
}

/* 修改 .ant-input-textarea 的默认内容不会生效，使用更具体的选择器 */
.footer-input-area .ant-input-textarea {
  width: 100% !important;
  border-radius: 18px !important;
  background-color: transparent !important;
}

/* 直接选择textarea元素，高优先级覆盖Ant Design的默认样式 */
.footer-input-area textarea.ant-input {
  border: none !important;
  resize: none !important;
  padding: 12px 16px !important;
  padding-right: 45px !important;
  font-size: 14px !important;
  color: @text-primary !important;
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  line-height: 1.5 !important;
  width: 100% !important;
  height: auto !important;
  min-height: 24px !important;
  max-height: 80px !important;
  overflow-y: hidden !important;
  border-radius: 18px !important;
}

.footer-input-area textarea.ant-input:focus {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
  background: transparent !important;
}

.footer-input-area .ant-input::placeholder {
  color: #b0b0b0 !important;
}

/* 发送按钮 - 极高的特异性选择器，确保能覆盖所有样式 */
.footer-input-area .input-with-button .send-button.execute-button.ant-btn,
.footer-input-area .input-with-button .execute-button.ant-btn {
  position: absolute !important;
  right: 8px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 10 !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  background-color: @primary-color !important;
  border-color: @primary-color !important;
  box-shadow: none !important;
  opacity: 1 !important;
  border: none !important;
  transition: all 0.2s ease !important;
  overflow: hidden !important;
}

.footer-input-area .input-with-button .send-button.execute-button.ant-btn:hover,
.footer-input-area .input-with-button .execute-button.ant-btn:hover {
  background-color: darken(@primary-color, 5%) !important;
  transform: translateY(-50%) scale(1.05) !important;
}

/* 增强图标选择器，使用更多的特异性来确保优先级 */
.footer-input-area .input-with-button .execute-button.ant-btn .execute-button-icon,
.footer-input-area .input-with-button .send-button.execute-button.ant-btn .execute-button-icon,
.footer-input-area .ant-btn .execute-button-icon,
.footer-input-area .execute-button-icon {
  font-size: 14px !important;
  margin: 0 !important;
  transform: rotate(235deg) !important;
  color: #fff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: static !important;
}

/* 专门处理antd图标容器 */
.footer-input-area .input-with-button .execute-button.ant-btn .anticon,
.footer-input-area .input-with-button .send-button.execute-button.ant-btn .anticon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  line-height: 1 !important;
}

/* 调整Ant Design Form中内容边距，确保按钮定位正确 */
.footer-input-area .ant-form-item-control-input-content {
  position: relative !important;
  border-radius: 18px !important;
  overflow: hidden !important;
}

/* 解决 div#prompt.textarea-container 的问题 */
div#prompt.textarea-container {
  border-radius: 18px !important;
  overflow: hidden !important;
}

/* 重试按钮容器 */
.retry-button-container {
  text-align: center !important;
  margin: 0 0 8px 0 !important;
  padding: 6px 0 !important;
}

.retry-button-container .ant-btn {
  padding: 4px 12px !important;
  height: 30px !important;
  border-radius: 15px !important;
  background-color: rgba(0, 0, 0, 0.03) !important;
  color: @text-secondary !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  border: 1px solid @border-color !important;
  transition: all 0.2s ease !important;
  font-size: 13px !important;
}

.retry-button-container .ant-btn:hover {
  background-color: rgba(6, 177, 171, 0.08) !important;
  color: @primary-color !important;
  border-color: rgba(6, 177, 171, 0.2) !important;
}

.retry-icon {
  font-size: 13px !important;
  display: flex !important;
  align-items: center !important;
}

/* 环境配置模态框样式 */
.settings-modal {
  .ant-modal-header {
    margin-bottom: 0 !important;
    border-bottom: 1px solid #f0f0f0 !important;
  }

  .ant-modal-body {
    padding-top: 16px !important;
  }

  .ant-modal-title {
    font-size: 16px !important;
    font-weight: 500 !important;
  }

  textarea.ant-input {
    font-family: monospace !important;
    border-radius: 6px !important;
  }
} 