/* Global Font - using a system stack for speed/cleanliness, but effectively 'Inter' or similar */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600&display=swap');

:root {
  --bk-primary: #6366f1; /* Indigo-500 */
  --bk-primary-dark: #4f46e5;
  --bk-secondary: #ec4899; /* Pink-500 */
  --bk-bg: #ffffff;
  --bk-text: #1f2937;
  --bk-gray: #f3f4f6;
  --bk-border: #e5e7eb;
  --bk-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', sans-serif; /* Setup for the demo page */
  background-color: #f9fafb;
}

/* --- Chat Widget Container --- */
#bk-chat-widget-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: 'Outfit', sans-serif;
}

/* --- Toggle Button --- */
#bk-chat-toggle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bk-primary), var(--bk-secondary));
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#bk-chat-toggle:hover {
  transform: scale(1.1);
}

#bk-chat-toggle svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- Chat Window --- */
#bk-chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: 600px;
  max-height: 80vh;
  background: var(--bk-bg);
  border-radius: 20px;
  box-shadow: var(--bk-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transform-origin: bottom right;
  pointer-events: none;
  transition: all 0.3s ease;
  border: 1px solid var(--bk-border);
}

#bk-chat-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

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

.bk-header-info h3 {
  margin: 0;
  font-weight: 600;
  font-size: 1.1rem;
}

.bk-header-info p {
  margin: 4px 0 0 0;
  font-size: 0.85rem;
  opacity: 0.9;
}

.bk-close-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

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

/* Messages Area */
.bk-chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background-color: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bk-message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  animation: bkSlideUp 0.3s ease;
  word-wrap: break-word;
}

.bk-message.bot {
  background: white;
  color: var(--bk-text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  border: 1px solid var(--bk-border);
}

.bk-message.user {
  background: var(--bk-primary);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Input Area */
.bk-chat-input-area {
  padding: 16px;
  background: white;
  border-top: 1px solid var(--bk-border);
  display: flex;
  gap: 10px;
}

.bk-chat-input-area input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--bk-border);
  border-radius: 24px;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
  background-color: #f9fafb;
}

.bk-chat-input-area input:focus {
  border-color: var(--bk-primary);
  background-color: white;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

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

.bk-send-btn:hover {
  background: var(--bk-primary-dark);
  transform: scale(1.05);
}

.bk-send-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  transform: none;
}

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

/* Responsive */
@media (max-width: 480px) {
  #bk-chat-window {
    width: calc(100vw - 32px);
    right: 16px; /* Offset by container padding */
    bottom: 80px;
    height: calc(100vh - 120px);
  }

  #bk-chat-widget-container {
      right: 16px;
      bottom: 16px;
  }
}
