/* =============================================================================
   Chat Widget Styles - Talentum AI Customer Support
   ============================================================================= */

:root {
  --chat-primary: #2563eb;
  --chat-primary-hover: #1d4ed8;
  --chat-bg: #ffffff;
  --chat-bg-secondary: #f8fafc;
  --chat-text: #1e293b;
  --chat-text-muted: #64748b;
  --chat-border: #e2e8f0;
  --chat-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  --chat-bubble-user: #2563eb;
  --chat-bubble-bot: #f1f5f9;
  --chat-radius: 16px;
}

/* Chat Widget Container */
.chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Chat Toggle Button */
.chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--chat-primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.chat-toggle:hover {
  transform: scale(1.05);
  background: var(--chat-primary-hover);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.5);
}

.chat-toggle svg {
  width: 28px;
  height: 28px;
  color: white;
  transition: transform 0.2s ease;
}

.chat-toggle.open svg {
  transform: rotate(90deg);
}

/* Chat Window */
.chat-window {
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: var(--chat-bg);
  border-radius: var(--chat-radius);
  box-shadow: var(--chat-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.chat-window.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Chat Header */
.chat-header {
  padding: 16px 20px;
  background: var(--chat-primary);
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-header-avatar svg {
  width: 22px;
  height: 22px;
  color: white;
}

.chat-header-info {
  flex: 1;
}

.chat-header-title {
  font-weight: 600;
  font-size: 16px;
  margin: 0;
}

.chat-header-status {
  font-size: 12px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
}

.chat-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.chat-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.chat-close svg {
  width: 18px;
  height: 18px;
  color: white;
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--chat-bg-secondary);
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--chat-border);
  border-radius: 3px;
}

/* Message Bubbles */
.chat-message {
  display: flex;
  gap: 10px;
  max-width: 85%;
  animation: messageIn 0.3s ease;
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-message.bot {
  align-self: flex-start;
}

.chat-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--chat-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-message.user .chat-message-avatar {
  background: var(--chat-text-muted);
}

.chat-message-avatar svg {
  width: 16px;
  height: 16px;
  color: white;
}

.chat-message-content {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.chat-message.bot .chat-message-content {
  background: var(--chat-bg);
  color: var(--chat-text);
  border: 1px solid var(--chat-border);
  border-bottom-left-radius: 4px;
}

.chat-message.user .chat-message-content {
  background: var(--chat-bubble-user);
  color: white;
  border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.chat-typing {
  display: flex;
  gap: 10px;
  align-self: flex-start;
  max-width: 85%;
}

.chat-typing-bubble {
  padding: 14px 18px;
  background: var(--chat-bg);
  border: 1px solid var(--chat-border);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  display: flex;
  gap: 4px;
  align-items: center;
}

.chat-typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--chat-text-muted);
  animation: typingDot 1.4s infinite;
}

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

.chat-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingDot {
  0%, 60%, 100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

/* Chat Input */
.chat-input-container {
  padding: 16px 20px;
  background: var(--chat-bg);
  border-top: 1px solid var(--chat-border);
}

.chat-input-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--chat-border);
  border-radius: 24px;
  font-size: 14px;
  font-family: inherit;
  background: var(--chat-bg-secondary);
  color: var(--chat-text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-input:focus {
  border-color: var(--chat-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.chat-input::placeholder {
  color: var(--chat-text-muted);
}

.chat-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--chat-primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.1s ease;
}

.chat-send:hover {
  background: var(--chat-primary-hover);
}

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

.chat-send:disabled {
  background: var(--chat-border);
  cursor: not-allowed;
}

.chat-send svg {
  width: 20px;
  height: 20px;
  color: white;
}

/* Powered by footer */
.chat-footer {
  padding: 8px 20px 12px;
  text-align: center;
  font-size: 11px;
  color: var(--chat-text-muted);
  background: var(--chat-bg);
}

.chat-footer a {
  color: var(--chat-primary);
  text-decoration: none;
}

/* Welcome message */
.chat-welcome {
  text-align: center;
  padding: 20px;
  color: var(--chat-text-muted);
  font-size: 13px;
}

.chat-welcome-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  background: var(--chat-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-welcome-icon svg {
  width: 24px;
  height: 24px;
  color: white;
}

.chat-welcome h4 {
  font-size: 16px;
  color: var(--chat-text);
  margin: 0 0 8px;
}

/* Quick replies */
.chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  justify-content: center;
}

.chat-quick-reply {
  padding: 8px 14px;
  background: var(--chat-bg);
  border: 1px solid var(--chat-border);
  border-radius: 16px;
  font-size: 13px;
  color: var(--chat-text);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.chat-quick-reply:hover {
  border-color: var(--chat-primary);
  background: rgba(37, 99, 235, 0.05);
}

/* Mobile responsive */
@media (max-width: 480px) {
  .chat-widget {
    bottom: 16px;
    right: 16px;
  }
  
  .chat-window {
    width: calc(100vw - 32px);
    height: calc(100vh - 100px);
    bottom: 70px;
    right: -8px;
  }
  
  .chat-toggle {
    width: 54px;
    height: 54px;
  }
}

