/* chatbot-wp.css - Modern Dialogflow Style - FIXED with pbs- prefix */

* {
  box-sizing: border-box;
}

#pbs-chatbot-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 380px;
  height: 600px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  border-radius: 16px;
  overflow: hidden;
  background: rgb(99, 147, 179);
  transition: all 0.3s ease-in-out;
}

#pbs-chatbot-container.pbs-minimized {
  width: 80px;
  height: 80px;
  border-radius: 50%;
}

#pbs-chatbot-header {
  background: linear-gradient(135deg, #2b47c2 0%, #7387c9, #2b47c2 100%);
  color: white;
  padding: 20px;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  min-height: 80px;
}

#pbs-chatbot-container.pbs-minimized #pbs-chatbot-header {
  padding: 20px;
  text-align: center;
  border-radius: 50%;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#pbs-chatbot-header-content {
  display: flex;
  align-items: center;
  flex-grow: 1;
  min-width: 0;
  overflow: hidden;
}

#pbs-chatbot-container.pbs-minimized #pbs-chatbot-header-content {
  flex-direction: column;
  gap: 0;
}

.pbs-chatbot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-right: 12px;
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

#pbs-chatbot-container.pbs-minimized .pbs-chatbot-avatar {
  margin: 0;
  width: 35px;
  height: 35px;
  font-size: 16px;
}

.pbs-chatbot-info {
  min-width: 0;
  flex: 1;
}

.pbs-chatbot-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pbs-chatbot-status {
  font-size: 12px;
  opacity: 0.9;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#pbs-chatbot-container.pbs-minimized .pbs-chatbot-title,
#pbs-chatbot-container.pbs-minimized .pbs-chatbot-status {
  display: none;
}

.pbs-chatbot-toggle {
  width: 24px;
  height: 24px;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.pbs-chatbot-toggle:hover {
  opacity: 1;
}

#pbs-chatbot-container.pbs-minimized .pbs-chatbot-toggle {
  display: none;
}

#pbs-chatbot-body {
  background: #000000;
  display: flex;
  flex-direction: column;
  height: 520px;
  transition: all 0.3s ease-in-out;
}

#pbs-chatbot-container.pbs-minimized #pbs-chatbot-body {
  display: none;
}

#pbs-chatbot-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: linear-gradient(to bottom, #7aa0c4 0%, #c7d5e2, #7aa0c4 100%);
  scrollbar-width: thin;
  scrollbar-color: #ddd transparent;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

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

#pbs-chatbot-messages::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 3px;
}

.pbs-message {
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  animation: slideIn 0.3s ease-out;
  width: 100%;
  min-width: 0;
}

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

.pbs-message.user {
  flex-direction: row-reverse;
}

.pbs-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  margin: 0 8px;
  flex-shrink: 0;
}

.pbs-message.user .pbs-message-avatar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.pbs-message.bot .pbs-message-avatar {
  background: #e9ecef;
  color: #6c757d;
}

.pbs-message-content {
  min-width: 0;
/*   max-width: calc(100% - 50px); */
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  white-space: pre-wrap;
}

.pbs-message.user .pbs-message-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.pbs-message.bot .pbs-message-content {
  background: white;
  color: #333;
  border: 1px solid #e9ecef;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pbs-message-time {
  font-size: 11px;
  opacity: 0.6;
  margin-top: 4px;
  text-align: right;
  white-space: nowrap;
}

.pbs-message.bot .pbs-message-time {
  text-align: left;
}

#pbs-chatbot-input-container {
  padding: 16px 20px;
  background: linear-gradient(to bottom, #7aa0c4 0%, #7aa0c4, #7aa0c4 100%);
  border-top: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  gap: 12px;
}

#pbs-chatbot-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #e9ecef;
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  background: #f8f9fa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#pbs-chatbot-input:focus {
  border-color: #667eea;
  background: white;
}

#pbs-chatbot-send-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #2b47c2 0%, #7387c9, #2b47c2 100%);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

#pbs-chatbot-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#pbs-chatbot-send-btn:active {
  transform: scale(0.95);
}

#pbs-chatbot-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.pbs-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
}

.pbs-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6c757d;
  animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
  0%, 60%, 100% {
    transform: scale(1);
    opacity: 0.5;
  }
  30% {
    transform: scale(1.2);
    opacity: 1;
  }
}

.pbs-welcome-message {
  text-align: center;
  padding: 20px;
  color: #6c757d;
  font-size: 13px;
  border-bottom: 1px solid #e9ecef;
  background: white;
}

.pbs-welcome-message h4 {
  margin: 0 0 8px 0;
  color: #333;
  font-size: 15px;
}

.pbs-welcome-message p {
  margin: 0;
  line-height: 1.4;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  #pbs-chatbot-container {
    bottom: 10px;
    right: 10px;
    left: 10px;
    width: auto;
    max-width: none;
  }
  
  #pbs-chatbot-container.pbs-minimized {
    width: 60px;
    height: 60px;
    right: 15px;  
    left: auto;
  }
  
  .pbs-message-content {
    max-width: calc(100% - 40px);
    font-size: 13px;
  }
}
