/* public/css/chatbot.css - Premium AI Chatbot Widget Styling */

/* Variables */
:root {
  --chatbot-primary: #022B54;
  --chatbot-primary-light: #0d3c6c;
  --chatbot-accent: #EBB000;
  --chatbot-accent-hover: #d19c00;
  --chatbot-bg-light: #f8f9fa;
  --chatbot-text-dark: #333333;
  --chatbot-text-muted: #777777;
  --chatbot-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  --chatbot-border-radius: 12px;
}

/* Floating Launcher Bubble */
.chatbot-launcher {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--chatbot-primary) 0%, #00458a 100%);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(2, 43, 84, 0.4);
  cursor: pointer;
  z-index: 99999;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 2px solid var(--chatbot-accent);
}

.chatbot-launcher:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 6px 20px rgba(2, 43, 84, 0.6);
}

.chatbot-launcher svg {
  width: 28px;
  height: 28px;
  stroke: #ffffff;
}

/* Launcher Badge */
.chatbot-launcher__badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: var(--chatbot-accent);
  color: var(--chatbot-primary);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  border: 1.5px solid #ffffff;
  text-transform: uppercase;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* Floating Tooltip */
.chatbot-tooltip {
  position: fixed;
  bottom: 95px;
  right: 25px;
  background: rgba(2, 43, 84, 0.95);
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  pointer-events: none;
  border-left: 3px solid var(--chatbot-accent);
}

.chatbot-launcher:hover + .chatbot-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Chatbot Window */
.chatbot-window {
  position: fixed;
  bottom: 100px;
  right: 25px;
  width: 380px;
  height: 520px;
  background: #ffffff;
  border-radius: var(--chatbot-border-radius);
  box-shadow: var(--chatbot-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99999;
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.075, 0.82, 0.165, 1);
  transform-origin: bottom right;
}

/* Window Header */
.chatbot-header {
  background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-primary-light) 100%);
  color: #ffffff;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  border-bottom: 2px solid var(--chatbot-accent);
}

.chatbot-header__avatar {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.chatbot-header__avatar svg {
  color: var(--chatbot-accent);
}

.chatbot-header__info {
  flex-grow: 1;
}

.chatbot-header__name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.3px;
  font-family: 'Outfit', sans-serif;
}

.chatbot-header__status {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  margin-top: 2px;
}

.chatbot-status-dot {
  width: 7px;
  height: 7px;
  background-color: #2ec4b6;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
  box-shadow: 0 0 8px #2ec4b6;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

.chatbot-reset-btn {
  margin-right: 5px;
  padding: 4px 8px;
}

.chatbot-reset-btn:hover {
  opacity: 1 !important;
  color: #ff4d4d;
}

.chatbot-close-btn:hover {
  color: var(--chatbot-accent);
}

/* Registration Form */
.chatbot-reg {
  padding: 30px 25px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-grow: 1;
  background: radial-gradient(circle at top right, rgba(235, 176, 0, 0.05), #ffffff 70%);
}

.chatbot-reg__title {
  font-size: 24px;
  font-weight: 700;
  color: var(--chatbot-primary);
  margin-bottom: 10px;
  font-family: 'Outfit', sans-serif;
}

.chatbot-reg__desc {
  font-size: 13px;
  color: var(--chatbot-text-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

.chatbot-reg form .form-group {
  margin-bottom: 15px;
}

.chatbot-reg form .form-control {
  width: 100%;
  padding: 12px 15px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s;
  box-sizing: border-box;
  font-family: 'Roboto', sans-serif;
}

.chatbot-reg form .form-control:focus {
  border-color: var(--chatbot-accent);
  box-shadow: 0 0 0 3px rgba(235, 176, 0, 0.15);
  outline: none;
}

/* Gold Button style */
.btn-gold {
  background: linear-gradient(135deg, var(--chatbot-accent) 0%, #d19c00 100%);
  color: var(--chatbot-primary) !important;
  font-weight: 700;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-family: 'Outfit', sans-serif;
  transition: all 0.3s;
  box-shadow: 0 4px 10px rgba(235, 176, 0, 0.2);
}

.btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(235, 176, 0, 0.35);
}

/* Chat Messages Area */
.chatbot-messages {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
  background-color: #fafbfc;
  display: flex;
  flex-direction: column;
  gap: 15px;
  scroll-behavior: smooth;
}

/* Scrollbar styles */
.chatbot-messages::-webkit-scrollbar {
  width: 5px;
}
.chatbot-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
}
.chatbot-messages::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 5px;
}
.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

/* Individual Message Row */
.chatbot-msg-row {
  display: flex;
  width: 100%;
}

.chatbot-msg-row.user {
  justify-content: flex-end;
}

.chatbot-msg-row.bot,
.chatbot-msg-row.agent {
  justify-content: flex-start;
}

.chatbot-msg-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-line;
  font-family: 'Roboto', sans-serif;
}

.chatbot-msg-row.user .chatbot-msg-bubble {
  background-color: var(--chatbot-primary);
  color: #ffffff;
  border-bottom-right-radius: 2px;
  box-shadow: 0 3px 10px rgba(2, 43, 84, 0.15);
}

.chatbot-msg-row.bot .chatbot-msg-bubble,
.chatbot-msg-row.agent .chatbot-msg-bubble {
  background-color: #ffffff;
  color: var(--chatbot-text-dark);
  border-bottom-left-radius: 2px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid #ebebeb;
}

/* Product Card Inside Bubble */
.chatbot-product-card {
  margin-top: 10px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  transition: transform 0.2s ease;
}

.chatbot-product-card:hover {
  transform: translateY(-2px);
}

.chatbot-product-img {
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  display: block;
}

.chatbot-product-body {
  padding: 10px;
}

.chatbot-product-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--chatbot-primary);
  margin: 0 0 5px 0;
  font-family: 'Outfit', sans-serif;
}

.chatbot-product-price {
  font-size: 12px;
  color: #e53e3e;
  font-weight: 700;
}

/* Typing Indicator */
.chatbot-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: #ffffff;
  border-radius: 14px;
  border-bottom-left-radius: 2px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid #ebebeb;
  width: fit-content;
}

.chatbot-typing span {
  width: 6px;
  height: 6px;
  background: var(--chatbot-primary);
  border-radius: 50%;
  display: inline-block;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}

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

@keyframes typing-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1.0); }
}

/* Quick Suggestion Buttons */
.chatbot-quick-btns {
  padding: 8px 15px;
  background-color: #fafbfc;
  border-top: 1px solid #f0f0f0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
}

.chatbot-quick-btns::-webkit-scrollbar {
  height: 3px;
}

.quick-btn {
  background: #ffffff;
  border: 1px solid var(--chatbot-accent);
  color: var(--chatbot-primary);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
}

.quick-btn:hover {
  background: var(--chatbot-accent);
  color: var(--chatbot-primary);
  transform: translateY(-1px);
}

/* Input Area */
.chatbot-input-area {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  background: #ffffff;
  border-top: 1px solid #eef0f2;
}

.chatbot-input {
  flex-grow: 1;
  border: none;
  font-size: 14px;
  padding: 8px 10px;
  outline: none;
  font-family: 'Roboto', sans-serif;
  color: var(--chatbot-text-dark);
}

.chatbot-send {
  background: none;
  border: none;
  color: var(--chatbot-primary);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  border-radius: 50%;
}

.chatbot-send:hover {
  color: var(--chatbot-accent);
  background-color: rgba(2, 43, 84, 0.05);
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .chatbot-window {
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
}

/* Launcher Unread Indicator Dot */
.chatbot-launcher-unread {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background-color: #ff4d4d;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 8px rgba(255, 77, 77, 0.6);
  z-index: 100000;
  animation: pulse-launcher-unread 1.5s infinite;
}

@keyframes pulse-launcher-unread {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(255, 77, 77, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 77, 77, 0); }
}

/* Unread Message Toast Popover */
.chatbot-unread-toast {
  position: fixed;
  bottom: 95px;
  right: 25px;
  background: #ff4d4d;
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(255, 77, 77, 0.4);
  z-index: 99998;
  animation: float-toast 2s infinite ease-in-out;
  border: 1px solid #ffffff;
  font-family: 'Outfit', sans-serif;
}

/* Triangle pointer pointing down to the launcher */
.chatbot-unread-toast::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 24px;
  border-width: 6px 6px 0;
  border-style: solid;
  border-color: #ff4d4d transparent;
  display: block;
  width: 0;
}

/* Hide default tooltip when launcher has unread class */
.chatbot-launcher.has-unread:hover + .chatbot-tooltip {
  opacity: 0 !important;
  visibility: hidden !important;
}

@keyframes float-toast {
  0% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

