/* 自定义样式文件 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f8fafc;
  color: #1e293b;
  line-height: 1.6;
}

/* 侧边栏动画 */
.sidebar-collapsed {
  width: 80px !important;
  transition: width 0.3s ease;
}

.sidebar-expanded {
  width: 280px !important;
  transition: width 0.3s ease;
}

/* 侧边栏收起时的样式调整 */
.sidebar-collapsed .sidebar-text {
  display: none;
}

.sidebar-collapsed .sidebar-link {
  justify-content: center;
  padding: 12px !important;
}

.sidebar-collapsed .sidebar-link span {
  display: none;
}

.sidebar-collapsed .flex.items-center.space-x-3 {
  justify-content: center;
}

.sidebar-collapsed .flex.items-center.justify-between {
  justify-content: center;
}

.sidebar-collapsed .flex.items-center.space-x-3 > div:not(:first-child) {
  display: none;
}

.sidebar-collapsed .flex.items-center.space-x-3 > div:first-child {
  margin-right: 0;
}

/* 确保收起时用户信息区域也正确显示 */
.sidebar-collapsed .flex.items-center.space-x-3 > img {
  margin: 0 auto;
}

/* 卡片悬停效果 */
.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* 智能体节点样式 */
.agent-node {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 16px;
  color: white;
  cursor: grab;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.agent-node:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.agent-node:active {
  cursor: grabbing;
}

/* 画布样式 */
.canvas-area {
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  min-height: 500px;
  position: relative;
  background-image: 
    radial-gradient(circle at 1px 1px, #e2e8f0 1px, transparent 0);
  background-size: 20px 20px;
}

.canvas-area.drag-over {
  border-color: #667eea;
  background-color: rgba(102, 126, 234, 0.05);
}

/* 连接线样式 */
.connection-line {
  position: absolute;
  height: 2px;
  background: #667eea;
  pointer-events: none;
  z-index: 1;
}

/* 消息气泡样式 */
.message-bubble {
  max-width: 70%;
  word-wrap: break-word;
}

.message-user {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  margin-left: auto;
}

.message-ai {
  background: white;
  color: #374151;
  border: 1px solid #e5e7eb;
}

/* 状态指示器 */
.status-enabled {
  background: #10b981;
  color: white;
}

.status-disabled {
  background: #ef4444;
  color: white;
}

/* 搜索框样式 */
.search-input {
  transition: all 0.3s ease;
}

.search-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 按钮样式 */
.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .sidebar-expanded {
    width: 100% !important;
    position: fixed;
    z-index: 50;
  }
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 加载动画 */
.loading-spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 脉冲动画 */
.pulse-animation {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* 滑入动画 */
.slide-in {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 工具提示样式 */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 1000;
}

.tooltip:hover::after {
  opacity: 1;
}

/* 响应式侧边栏文字 */
@media (max-width: 1024px) {
  .sidebar-text {
    display: none;
  }
}
