:root {
  /* Core Backgrounds - Modern Clean Light Theme */
  --chat-bg-base: #f8fafc;
  /* Soft ambient light background */
  --chat-bg-2: #ffffff;
  /* Container & card background */
  --chat-bg-3: #f1f5f9;
  /* Header & Input background */
  --chat-bg-4: #f8fafc;
  /* Subtle alternate depth */

  /* Text Colors */
  --chat-text: #1e293b;
  /* Slate dark text for crisp readability */
  --chat-text-muted: #64748b;
  /* Muted secondary text */
  --chat-text-on-accent: #ffffff;
  /* Contrast text on orange buttons */
  --chat-text-heading: #0f172a;
  /* Deep bold heading text */

  /* WOWInfotech Branded Accents (Extracted directly from logo) */
  --chat-accent: #e85d04;
  /* Core Vibrant WOW Orange */
  --chat-accent-dark: #dc2f02;
  /* Rich hover orange */
  --chat-accent-light: #fff3eb;
  /* Light soft orange glow background */
  --chat-accent-gradient: linear-gradient(135deg, #f77f00, #e85d04);

  /* Interaction & UI Elements */
  --chat-success: #10b981;
  /* Vibrant status green */
  --chat-error: #ef4444;
  /* Soft red */
  --chat-border: #e2e8f0;
  /* Ultra-clean light border */

  /* Layout and Typography */
  --chat-radius-base: 12px;
  --chat-radius-lg: 20px;

  --chat-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --chat-depth:
    0 20px 40px -15px rgba(232, 93, 4, 0.15),
    0 10px 25px -5px rgba(0, 0, 0, 0.08);
}

/* Floating Trigger Button */
.chatbot-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: #e86b1b;
  /* Primary brand color */
  color: #ffffff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease;
}

.chatbot-trigger:hover {
  transform: scale(1.05);
  background-color: #e86b1b;
}

.chatbot-trigger svg {
  width: 24px;
  height: 24px;
  position: absolute;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

/* Icon Toggling Logic */
.chatbot-trigger .icon-close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

.chatbot-trigger.active .icon-chat {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

.chatbot-trigger.active .icon-close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Chatbot Container Visibility & Positioning */
.chatbot {
  position: fixed;
  bottom: 92px;
  /* Placed right above the floating button */
  right: 24px;
  width: 360px;
  max-width: calc(100vw - 48px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 999;

  /* Hidden state defaults */
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

/* Active/Open State */
.chatbot.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* ── Chat Toggle Button ──────────────────────────────── */
.chat-toggle {
  margin-left: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--chat-border);
  background: var(--chat-bg-2);
  color: var(--chat-accent);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: var(--chat-transition);
  position: relative;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.chat-toggle:hover {
  background: var(--chat-accent);
  color: var(--chat-text-on-accent);
  border-color: var(--chat-accent);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 20px rgba(232, 93, 4, 0.3);
}

.chat-toggle svg {
  width: 20px;
  height: 20px;
}

.chat-badge {
  position: absolute;
  top: 0px;
  right: 0px;
  width: 10px;
  height: 10px;
  background: var(--chat-accent);
  border: 2px solid var(--chat-bg-2);
  border-radius: 50%;
}

/* ── Chatbot Container ───────────────────────────────── */
.chatbot {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 380px;
  max-height: 580px;
  background: var(--chat-bg-2);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--chat-radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: var(--chat-depth);
  z-index: 300;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition:
    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.chatbot.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
  z-index: 99999;
  backdrop-filter: blur(1px);
  background: transparent;
  box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
}

/* ── Header ─────────────────────────────────────────── */
.chatbot-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.2rem;
  background: #00000000;
  border-bottom: 1px solid var(--chat-border);
}

.chatbot-avatar {
  width: 40px;
  height: 40px;
  background: var(--chat-accent-gradient);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--chat-text-on-accent);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(232, 93, 4, 0.25);
}

.chatbot-avatar svg {
  width: 20px;
  height: 20px;
}

.chatbot-title {
  flex: 1;
}

.chatbot-name {
  display: block;

  font-weight: 700;
  font-size: 0.95rem;
  color: var(--chat-text-heading);
  letter-spacing: -0.2px;
}

.chatbot-status {
  font-size: 0.75rem;
  color: var(--chat-success);
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.chatbot-status::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--chat-success);
  border-radius: 50%;
}

.chatbot-actions {
  display: flex;
  gap: 0.3rem;
}

.chatbot-reset,
.chatbot-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--chat-text-muted);
  cursor: pointer;
  transition: var(--chat-transition);
  display: grid;
  place-items: center;
}

.chatbot-reset:hover {
  color: var(--chat-accent);
  background: var(--chat-accent-light);
}

.chatbot-close:hover {
  color: var(--chat-error);
  background: #fef2f2;
}

/* ── Messages Area ───────────────────────────────────── */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  background: #ff000000
  scroll-behavior: smooth;
}

.chatbot-messages::-webkit-scrollbar {
  width: 5px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

/* Message Bubbles */
.msg {
  max-width: 80%;
  padding: 0.7rem 1rem;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.5;

  animation: msgIn 0.25s ease-out forwards;
}

@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Bot Message Design */
.msg-bot {
  align-self: flex-start;
  background: var(--chat-bg-2);
  color: var(--chat-text);
  border: 1px solid var(--chat-border);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

/* User Message Design */
.msg-user {
  align-self: flex-end;
  background: var(--chat-accent-gradient);
  color: var(--chat-text-on-accent);
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(232, 93, 4, 0.2);
  font-weight: 500;
}

/* Typing Indicator */
.msg-typing {
  align-self: flex-start;
  background: var(--chat-bg-2);
  border: 1px solid var(--chat-border);
  border-bottom-left-radius: 4px;
  padding: 0.8rem 1.1rem;
}

.typing-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  background: var(--chat-accent);
  border-radius: 50%;
  animation: dot 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dot {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.3;
  }

  40% {
    transform: scale(1.1);
    opacity: 1;
  }
}

/* ── Input Area ──────────────────────────────────────── */
.chatbot-input-area {
  display: flex;
  gap: 0.6rem;
  padding: 0.9rem 1rem;
  background: transparent;
  border-top: 1px solid var(--chat-border);
  align-items: center;
}

.chatbot-input {
  flex: 1;
  background: var(--chat-bg-3);
  border: 1.5px solid transparent;
  border-radius: var(--chat-radius-base);
  padding: 0.65rem 1rem;
  color: var(--chat-text);

  font-size: 0.9rem;
  transition: var(--chat-transition);
}

.chatbot-input::placeholder {
  color: var(--chat-text-muted);
}

.chatbot-input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--chat-accent);
  box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.12);
}

.chatbot-send {
  width: 40px;
  height: 40px;
  border-radius: var(--chat-radius-base);
  border: none;
  background: var(--chat-accent-gradient);
  color: var(--chat-text-on-accent);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: var(--chat-transition);
  box-shadow: 0 4px 10px rgba(232, 93, 4, 0.25);
}

.chatbot-send:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 16px rgba(232, 93, 4, 0.35);
}

.chatbot-send svg {
  width: 16px;
  height: 16px;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .chatbot {
    width: calc(100vw - 2rem);
    right: 1rem;
    bottom: 1rem;
    max-height: 80vh;
  }
}
