/* ===========================
   JOBBSYNK CHATBOT STYLES
   Anpassad för JobbSynk design
   =========================== */

/* Floating bubble button */
.chatbot-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
  transition: all 0.3s ease;
  z-index: 9998;
  padding: 0;
}

.chatbot-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.5);
}

.chatbot-avatar-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
}

.chatbot-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.4);
  animation: pulse 2s infinite;
  z-index: -1;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

/* Chat window */
.chatbot-window {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 420px;
  max-width: calc(100vw - 48px);
  height: 600px;
  max-height: calc(100vh - 100px);
  background: white;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header */
.chatbot-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chatbot-header-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.chatbot-avatar-header {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.chatbot-header h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.2px;
}

.chatbot-status {
  font-size: 13px;
  opacity: 0.9;
  margin: 4px 0 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: blink 2s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.chatbot-header-actions {
  display: flex;
  gap: 10px;
}

.chatbot-action-btn,
.chatbot-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.chatbot-action-btn:hover,
.chatbot-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Messages container */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg-light);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

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

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

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* Individual message */
.chatbot-message {
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: messageSlide 0.3s ease;
}

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

.chatbot-message.user {
  align-items: flex-end;
}

.chatbot-message.bot {
  align-items: flex-start;
}

.chatbot-message-bubble {
  max-width: 85%;
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.5;
  position: relative;
  word-wrap: break-word;
}

.chatbot-message.user .chatbot-message-bubble {
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.chatbot-message.bot .chatbot-message-bubble {
  background: white;
  color: var(--text-dark);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.chatbot-message-time {
  font-size: 12px;
  color: var(--text-light);
  padding: 0 10px;
  font-weight: 500;
}

/* Feedback buttons */
.chatbot-feedback {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.chatbot-feedback button {
  background: var(--bg-light);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}

.chatbot-feedback button:hover {
  background: white;
  border-color: var(--primary);
  transform: scale(1.1);
}

/* Typing indicator */
.chatbot-typing {
  display: flex;
  gap: 5px;
  padding: 14px 18px;
  background: white;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  width: fit-content;
}

.chatbot-typing span {
  width: 9px;
  height: 9px;
  background: var(--text-light);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-12px);
    opacity: 1;
  }
}

/* Input container */
.chatbot-input-container {
  padding: 18px;
  background: white;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chatbot-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 14px;
  font-size: 15px;
  resize: none;
  max-height: 120px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  background: var(--bg-light);
}

.chatbot-input:focus {
  border-color: var(--primary);
  background: white;
}

.chatbot-input::placeholder {
  color: var(--text-light);
}

.chatbot-send {
  background: var(--primary);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  font-weight: bold;
}

.chatbot-send:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

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

/* Quick questions */
.chatbot-quick-questions {
  padding: 16px 18px;
  background: white;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chatbot-quick-questions p {
  font-size: 13px;
  color: var(--text-light);
  margin: 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chatbot-quick-questions button {
  background: var(--bg-light);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  transition: all 0.2s;
  color: var(--text-dark);
  font-weight: 500;
}

.chatbot-quick-questions button:hover {
  background: white;
  border-color: var(--primary);
  color: var(--primary);
  transform: translateX(4px);
}

/* Mobile responsive */
@media (max-width: 640px) {
  .chatbot-window {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .chatbot-bubble {
    bottom: 20px;
    right: 20px;
    width: 64px;
    height: 64px;
  }

  .chatbot-avatar-img {
    width: 64px;
    height: 64px;
  }

  .chatbot-header {
    padding: 16px;
  }

  .chatbot-messages {
    padding: 16px;
  }

  .chatbot-input-container {
    padding: 12px;
  }

  .chatbot-quick-questions {
    padding: 12px;
  }
}

/* Smooth animations */
.chatbot-window {
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
