/* SalesAImate Custom Styles */

:root {
  --primary-blue: #2563eb;
  --primary-light: #eff6ff;
  --sidebar-bg: #f8f9fa;
  --border-color: #e5e7eb;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --ai-bubble-bg: #eef2ff;
  --user-bubble-bg: #2563eb;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Sidebar */
.sidebar {
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  transition: transform 0.3s ease;
}

/* New Chat Button */
.new-chat-btn {
  border: 1px solid #bfdbfe;
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
  color: var(--primary-blue);
  transition: all 0.2s ease;
}

.new-chat-btn:hover {
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
  border-color: #93c5fd;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

/* Search Box */
.search-box {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.search-box:focus-within {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

/* History Items */
.history-item {
  transition: all 0.15s ease;
  border-radius: 8px;
}

.history-item:hover {
  background-color: #f3f4f6;
}

.history-item.active {
  background-color: #eff6ff;
  color: var(--primary-blue);
}

/* Agent Selector */
.agent-selector {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.agent-selector::-webkit-scrollbar {
  display: none;
}

.agent-chip {
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  color: var(--text-primary);
  transition: all 0.2s ease;
  cursor: pointer;
}

.agent-chip:hover {
  border-color: #93c5fd;
  background-color: #eff6ff;
  color: var(--primary-blue);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.agent-chip.active {
  border-color: var(--primary-blue);
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.agent-chip.active:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  color: #ffffff;
}

/* Skill Tags */
.skill-tag {
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  color: var(--text-primary);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.skill-tag:hover {
  border-color: #93c5fd;
  background-color: #eff6ff;
  color: var(--primary-blue);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

/* AI Message Bubble */
.ai-bubble {
  background: linear-gradient(135deg, #eff6ff 0%, #eef2ff 100%);
  border: 1px solid #dbeafe;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}

/* User Message Bubble */
.user-bubble {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-radius: 16px;
  border-bottom-right-radius: 4px;
}

/* Input Area */
.input-area {
  background-color: #f9fafb;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.input-area:focus-within {
  border-color: #93c5fd;
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.send-btn {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  transition: all 0.2s ease;
}

.send-btn:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  transform: scale(1.05);
}

.send-btn:active {
  transform: scale(0.95);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Subscription Badge */
.sub-badge {
  background-color: #f0fdf4;
  border: 1px solid #86efac;
  color: #16a34a;
}

/* User Badge */
.user-badge {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  color: var(--primary-blue);
}

/* Mobile Overlay */
.mobile-overlay {
  background-color: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(2px);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-appear {
  animation: fadeIn 0.3s ease forwards;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.typing-dot {
  animation: pulse 1.4s ease-in-out infinite both;
}

.typing-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
  animation-delay: -0.16s;
}

/* Logo hover effect */
.logo-container {
  transition: transform 0.2s ease;
}

.logo-container:hover {
  transform: scale(1.02);
}

/* Skill tags scroll */
.skills-container {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.skills-container::-webkit-scrollbar {
  display: none;
}

/* Markdown-like message content */
.message-content p {
  margin: 0 0 0.75em 0;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content ul, .message-content ol {
  margin: 0.5em 0;
  padding-left: 1.5em;
}

.message-content li {
  margin: 0.25em 0;
}

.message-content strong {
  font-weight: 600;
}

/* Login Page */
.login-card {
  transition: transform 0.2s ease;
}

.login-input {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  background-color: #ffffff;
}

.login-input:hover {
  border-color: #d1d5db;
}

.login-input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
  background-color: #ffffff;
}

.login-tab,
.login-sub-tab {
  transition: color 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

#sendCodeBtn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* My Page menu rows */
.menu-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 0.75rem;
  font-size: 0.9rem;
  color: #374151;
  transition: background-color 0.15s ease;
  text-align: left;
}

.menu-row:hover {
  background-color: #f9fafb;
}

.menu-row span {
  flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 50;
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
}
