/* ===== CHATBOT STYLES ===== */

:root {
  --chat-bg: #1e293b;
  --chat-bubble-user: linear-gradient(135deg, #8b5cf6, #ec4899);
  --chat-bubble-bot: #2d3748;
  --chat-text: #e2e8f0;
  --chat-text-light: #94a3b8;
  --chat-border: rgba(255, 255, 255, 0.1);
  --chat-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  --chat-radius: 16px;
}

/* ============================================================
   TOGGLE BUTTON – with custom PNG icon
   ============================================================ */

.chat-toggle {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  border: none;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.5);
  cursor: pointer;
  z-index: 9999;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Hide Font Awesome icons (if any) */
  font-size: 0;
}

/* Custom image icon – always visible */
.chat-toggle::before {
  content: "";
  display: block;
  width: 70%;
  height: 70%;
  background: url("../images/autobots.png") center center / contain no-repeat;
  transition: all 0.3s ease;
}

/* Hover effect – subtle scale on the image */
.chat-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(139, 92, 246, 0.7);
}

.chat-toggle:hover::before {
  transform: scale(1.05);
}

/* Open state – keep the same image (optional: you could add a small close indicator) */
.chat-toggle.open {
  /* keep background and image, no change */
}

/* Hide any Font Awesome icons that might be in the HTML */
.chat-toggle .fa-comment-dots,
.chat-toggle .fa-times {
  display: none !important;
}

/* ============================================================
   CHAT WINDOW
   ============================================================ */

.chat-window {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 380px;
  max-width: calc(100vw - 60px);
  max-height: 600px;
  background: var(--chat-bg);
  border-radius: var(--chat-radius);
  box-shadow: var(--chat-shadow);
  border: 1px solid var(--chat-border);
  z-index: 9998;
  display: none;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  opacity: 0;
  transform: scale(0.9) translateY(20px);
  pointer-events: none;
}

.chat-window.open {
  display: flex;
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

/* ============================================================
   HEADER
   ============================================================ */

.chat-header {
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid var(--chat-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}

.chat-title {
  font-weight: 600;
  color: var(--white);
  font-size: 1rem;
}

.chat-status {
  font-size: 0.7rem;
  color: #4ade80;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-status::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

.chat-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.chat-clear-btn,
.chat-close-btn {
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
  font-size: 16px;
}

.chat-clear-btn:hover,
.chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ============================================================
   MESSAGES AREA
   ============================================================ */

.chat-messages {
  flex: 1;
  padding: 16px 16px 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
  max-height: 400px;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}
.chat-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}
.chat-messages::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

/* ============================================================
   MESSAGE BUBBLES
   ============================================================ */

.message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-wrap: break-word;
  animation: messageIn 0.3s ease;
}

@keyframes messageIn {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.user {
  align-self: flex-end;
  background: var(--gradient);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.message.bot {
  align-self: flex-start;
  background: var(--chat-bubble-bot);
  color: var(--chat-text);
  border-bottom-left-radius: 4px;
}

.message .timestamp {
  font-size: 0.6rem;
  color: var(--text-light);
  margin-top: 4px;
  display: block;
  opacity: 0.7;
}

.message .typing-dots {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.message .typing-dots span {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite both;
}

.message .typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.message .typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing-bounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-6px);
  }
}

.thinking-message {
  font-style: italic;
  color: var(--text-light);
  font-size: 0.85rem;
  opacity: 0.8;
}

/* ============================================================
   SUGGESTIONS
   ============================================================ */

.chat-suggestions {
  padding: 8px 16px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--chat-border);
  flex-shrink: 0;
}

.suggestion-btn {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--chat-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-light);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 32px;
}

.suggestion-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ============================================================
   INPUT AREA
   ============================================================ */

.chat-input-area {
  display: flex;
  padding: 10px 16px 16px;
  gap: 10px;
  border-top: 1px solid var(--chat-border);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 25px;
  border: 1px solid var(--chat-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--chat-text);
  font-size: 0.9rem;
  outline: none;
  transition: border 0.2s;
  min-height: 44px;
}

.chat-input::placeholder {
  color: var(--text-light);
}

.chat-input:focus {
  border-color: var(--primary);
}

.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--gradient);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

/* ============================================================
   THINKING MESSAGE
   ============================================================ */

.thinking-message-wrapper {
  background: var(--chat-bubble-bot) !important;
  color: var(--chat-text);
  animation: messageIn 0.3s ease;
}

.thinking-content {
  display: flex;
  align-items: center;
  gap: 6px;
}

.thinking-text {
  font-size: 0.9rem;
  color: var(--text-light);
}

.thinking-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.thinking-dots span {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  animation: thinkingBounce 1.2s infinite both;
}

.thinking-dots span:nth-child(1) {
  animation-delay: 0s;
}
.thinking-dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.thinking-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes thinkingBounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

/* ============================================================
   PROJECT CARDS
   ============================================================ */

.project-cards-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 8px 0;
  width: 100%;
}

.project-card-item {
  background: var(--dark-light);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--chat-border);
  transition: transform 0.2s ease;
  opacity: 0;
  animation: cardFadeIn 0.5s ease forwards;
}

@keyframes cardFadeIn {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.project-card-item:hover {
  transform: translateY(-2px);
}

.project-card-image {
  height: 140px;
  overflow: hidden;
  background: #1a1a2e;
}

.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card-content {
  padding: 12px 16px;
}

.project-card-content h4 {
  margin: 0 0 4px 0;
  font-size: 1rem;
  color: var(--white);
}

.project-card-content p {
  font-size: 0.85rem;
  color: var(--text-light);
  margin: 4px 0 8px 0;
}

.project-techs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0;
}

.tech-badge {
  background: rgba(139, 92, 246, 0.15);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: var(--text);
}

.project-status {
  display: inline-block;
  background: #4ade80;
  color: #000;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
}

.project-status-badge {
  margin: 4px 0;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.project-btn {
  padding: 4px 12px;
  border-radius: 20px;
  border: none;
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  min-height: 32px;
}

.github-btn {
  background: #333;
  color: #fff;
}
.github-btn:hover {
  background: #444;
}

.demo-btn {
  background: var(--primary);
  color: #fff;
}
.demo-btn:hover {
  background: var(--primary-dark);
}

.more-btn {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}
.more-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* ============================================================
   TIMELINE
   ============================================================ */

.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 8px 0;
  position: relative;
  padding-left: 20px;
  width: 100%;
}

.timeline-container::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--primary);
  opacity: 0.5;
}

.timeline-item {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  opacity: 0;
  animation: timelineFadeIn 0.5s ease forwards;
}

@keyframes timelineFadeIn {
  0% {
    opacity: 0;
    transform: translateX(-10px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.timeline-icon {
  width: 28px;
  height: 28px;
  background: var(--dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 2px solid var(--primary);
  flex-shrink: 0;
  z-index: 1;
  background: var(--dark-light);
}

.timeline-content {
  flex: 1;
}

.timeline-date {
  font-size: 0.75rem;
  color: var(--text-light);
}

.timeline-content h4 {
  margin: 2px 0;
  font-size: 1rem;
  color: var(--white);
}

.timeline-company {
  display: block;
  font-size: 0.85rem;
  color: var(--primary);
}

.timeline-content p {
  margin: 4px 0 0 0;
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ============================================================
   MARKDOWN STYLES
   ============================================================ */

.message.bot strong {
  color: var(--white);
}

.message.bot em {
  color: var(--primary);
}

.message.bot code {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.85em;
}

.message.bot pre {
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 8px 0;
}

.message.bot pre code {
  background: transparent;
  padding: 0;
}

.message.bot blockquote {
  border-left: 3px solid var(--primary);
  padding-left: 12px;
  margin: 8px 0;
  color: var(--text-light);
}

.message.bot ul,
.message.bot ol {
  margin: 6px 0;
  padding-left: 20px;
}

.message.bot li {
  margin: 2px 0;
}

.message.bot hr {
  border: none;
  border-top: 1px solid var(--chat-border);
  margin: 12px 0;
}

.message.bot .markdown-link {
  color: var(--primary);
  text-decoration: underline;
}

.message.bot .markdown-link:hover {
  color: var(--secondary);
}

/* ============================================================
   SCROLL TO BOTTOM
   ============================================================ */

.chat-messages .scroll-bottom {
  scroll-behavior: smooth;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* -------- Tablets & Small Laptops (≤ 992px) -------- */
@media (max-width: 992px) {
  .chat-window {
    bottom: 90px;
    right: 20px;
    width: 400px;
    max-width: calc(100vw - 40px);
    max-height: 550px;
  }

  .project-card-image {
    height: 120px;
  }
}

/* -------- Mobile Phones (≤ 768px) -------- */
@media (max-width: 768px) {
  .chat-window {
    bottom: 80px;
    right: 10px;
    left: 10px;
    width: auto;
    max-width: none;
    max-height: 70vh;
    border-radius: 16px;
    transform: scale(0.95) translateY(30px);
  }

  .chat-window.open {
    transform: scale(1) translateY(0);
  }

  .chat-toggle {
    width: 56px;
    height: 56px;
    bottom: 20px;
    right: 20px;
  }

  .chat-messages {
    max-height: 50vh;
    padding: 12px 12px 6px;
  }

  .message {
    max-width: 90%;
    font-size: 0.85rem;
    padding: 8px 12px;
  }

  .chat-header {
    padding: 12px 16px;
  }

  .chat-avatar {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .chat-title {
    font-size: 0.9rem;
  }

  .chat-suggestions {
    padding: 6px 12px 10px;
    gap: 6px;
  }

  .suggestion-btn {
    font-size: 0.75rem;
    padding: 6px 10px;
    min-height: 36px;
  }

  .chat-input-area {
    padding: 8px 12px 12px;
    gap: 8px;
  }

  .chat-input {
    font-size: 0.85rem;
    padding: 8px 12px;
    min-height: 40px;
  }

  .chat-send-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .project-card-image {
    height: 100px;
  }

  .project-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .project-btn {
    justify-content: center;
    min-height: 38px;
  }

  .timeline-container {
    padding-left: 16px;
  }

  .timeline-icon {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .timeline-content h4 {
    font-size: 0.9rem;
  }

  .thinking-text {
    font-size: 0.85rem;
  }

  .thinking-dots span {
    width: 5px;
    height: 5px;
  }
}

/* -------- Small Mobile Phones (≤ 576px) -------- */
@media (max-width: 576px) {
  .chat-window {
    bottom: 75px;
    right: 8px;
    left: 8px;
    max-height: 75vh;
    border-radius: 14px;
  }

  .chat-toggle {
    width: 52px;
    height: 52px;
    bottom: 16px;
    right: 16px;
  }

  .chat-messages {
    max-height: 55vh;
    padding: 10px 10px 4px;
  }

  .message {
    max-width: 92%;
    font-size: 0.8rem;
    padding: 8px 10px;
  }

  .chat-header {
    padding: 10px 14px;
  }

  .chat-avatar {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .chat-title {
    font-size: 0.85rem;
  }

  .chat-status {
    font-size: 0.6rem;
  }

  .chat-suggestions {
    padding: 4px 10px 8px;
    gap: 5px;
  }

  .suggestion-btn {
    font-size: 0.7rem;
    padding: 5px 8px;
    min-height: 32px;
  }

  .chat-input-area {
    padding: 6px 10px 10px;
    gap: 6px;
  }

  .chat-input {
    font-size: 0.8rem;
    padding: 6px 10px;
    min-height: 36px;
  }

  .chat-send-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .project-card-image {
    height: 80px;
  }

  .project-card-content {
    padding: 8px 12px;
  }

  .project-card-content h4 {
    font-size: 0.9rem;
  }

  .project-card-content p {
    font-size: 0.75rem;
  }

  .tech-badge {
    font-size: 0.6rem;
    padding: 1px 8px;
  }

  .project-btn {
    font-size: 0.65rem;
    padding: 4px 10px;
    min-height: 32px;
  }

  .timeline-container {
    padding-left: 12px;
  }

  .timeline-icon {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }

  .timeline-content h4 {
    font-size: 0.8rem;
  }

  .timeline-content p {
    font-size: 0.75rem;
  }

  .timeline-date {
    font-size: 0.65rem;
  }

  .thinking-text {
    font-size: 0.8rem;
  }

  .thinking-dots span {
    width: 4px;
    height: 4px;
  }
}

/* -------- Very Small Phones (≤ 400px) -------- */
@media (max-width: 400px) {
  .chat-window {
    bottom: 70px;
    right: 6px;
    left: 6px;
    max-height: 80vh;
    border-radius: 12px;
  }

  .chat-toggle {
    width: 48px;
    height: 48px;
    bottom: 14px;
    right: 14px;
  }

  .chat-messages {
    max-height: 60vh;
    padding: 8px 8px 4px;
  }

  .message {
    font-size: 0.75rem;
    padding: 6px 8px;
  }

  .chat-header {
    padding: 8px 12px;
  }

  .chat-avatar {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .chat-title {
    font-size: 0.8rem;
  }

  .chat-suggestions {
    gap: 4px;
  }

  .suggestion-btn {
    font-size: 0.65rem;
    padding: 4px 6px;
    min-height: 28px;
  }

  .chat-input {
    font-size: 0.75rem;
    min-height: 32px;
  }

  .chat-send-btn {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .project-card-image {
    height: 60px;
  }
}

/* ============================================================
   SAFE AREA SUPPORT (iPhone Notch, Android Gestures)
   ============================================================ */

@supports (padding: max(0px)) {
  .chat-window {
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }

  .chat-toggle {
    bottom: max(30px, env(safe-area-inset-bottom, 30px));
    right: max(30px, env(safe-area-inset-right, 30px));
  }

  @media (max-width: 768px) {
    .chat-window {
      padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .chat-toggle {
      bottom: max(20px, env(safe-area-inset-bottom, 20px));
      right: max(20px, env(safe-area-inset-right, 20px));
    }
  }

  @media (max-width: 576px) {
    .chat-toggle {
      bottom: max(16px, env(safe-area-inset-bottom, 16px));
      right: max(16px, env(safe-area-inset-right, 16px));
    }
  }
}

/* ============================================================
   ═══════════════════════════════════════════════════════════
   PREMIUM CHATBOT WIDGET ENHANCEMENTS (ADDED)
   ═══════════════════════════════════════════════════════════
   ============================================================ */

/* ---------- Chat Toggle Button Enhancements ---------- */
.chat-toggle {
  /* Existing styles remain */
  animation: idleFloat 4s ease-in-out infinite;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

/* Idle floating animation */
@keyframes idleFloat {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* Glow pulse on idle */
.chat-toggle::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--gradient);
  opacity: 0;
  z-index: -1;
  animation: idleGlow 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes idleGlow {
  0%,
  100% {
    opacity: 0;
    transform: scale(1);
    filter: blur(8px);
  }
  50% {
    opacity: 0.3;
    transform: scale(1.1);
    filter: blur(12px);
  }
}

/* Attention bounce */
.chat-toggle.attention-bounce {
  animation: attentionBounce 0.8s ease;
}

@keyframes attentionBounce {
  0% {
    transform: scale(1) translateY(0);
  }
  20% {
    transform: scale(0.95) translateY(-10px);
  }
  40% {
    transform: scale(1.05) translateY(-20px);
  }
  60% {
    transform: scale(0.98) translateY(-10px);
  }
  80% {
    transform: scale(1.02) translateY(-4px);
  }
  100% {
    transform: scale(1) translateY(0);
  }
}

/* ---------- Online Status Indicator ---------- */
.chat-toggle .online-status {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #4ade80;
  border: 2px solid var(--darker);
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
  animation: statusPulse 2s ease-in-out infinite;
  z-index: 2;
}

@keyframes statusPulse {
  0%,
  100% {
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.8);
  }
}

/* ---------- Greeting Speech Bubble ---------- */
.chat-greeting-bubble {
  position: fixed;
  bottom: 100px;
  right: 30px;
  background: var(--dark-light);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 16px;
  font-size: 0.9rem;
  font-weight: 500;
  max-width: 260px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--chat-border);
  backdrop-filter: blur(10px);
  z-index: 9997;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  font-family: "Inter", sans-serif;
  line-height: 1.4;
}

.chat-greeting-bubble.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Speech bubble tail */
.chat-greeting-bubble::after {
  content: "";
  position: absolute;
  bottom: -10px;
  right: 24px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid var(--dark-light);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* ---------- Floating Particles ---------- */
.chat-toggle-particles {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  overflow: visible;
}

.particle-dot {
  position: absolute;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.4);
  animation: particleFloat 6s ease-in-out infinite;
  pointer-events: none;
}

.particle-dot:nth-child(1) {
  width: 4px;
  height: 4px;
  top: -10px;
  left: 10px;
  animation-delay: 0s;
}

.particle-dot:nth-child(2) {
  width: 6px;
  height: 6px;
  bottom: -8px;
  right: -5px;
  animation-delay: 1.5s;
}

.particle-dot:nth-child(3) {
  width: 3px;
  height: 3px;
  top: -5px;
  right: 20px;
  animation-delay: 3s;
}

@keyframes particleFloat {
  0%,
  100% {
    opacity: 0;
    transform: translate(0, 0) scale(0);
  }
  25% {
    opacity: 0.6;
    transform: translate(8px, -12px) scale(1);
  }
  50% {
    opacity: 0.3;
    transform: translate(-4px, -20px) scale(0.8);
  }
  75% {
    opacity: 0.5;
    transform: translate(6px, -28px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(0, -36px) scale(0);
  }
}

/* ---------- Responsive Widget ---------- */
@media (max-width: 768px) {
  .chat-greeting-bubble {
    bottom: 85px;
    right: 20px;
    max-width: 200px;
    font-size: 0.8rem;
    padding: 10px 14px;
  }
  .chat-greeting-bubble::after {
    right: 18px;
  }
}

@media (max-width: 576px) {
  .chat-greeting-bubble {
    bottom: 75px;
    right: 16px;
    max-width: 170px;
    font-size: 0.75rem;
    padding: 8px 12px;
  }
  .chat-greeting-bubble::after {
    right: 14px;
    bottom: -8px;
    border-left-width: 8px;
    border-right-width: 8px;
    border-top-width: 8px;
  }
  .chat-toggle .online-status {
    width: 10px;
    height: 10px;
  }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .chat-toggle {
    animation: none !important;
  }
  .chat-toggle::after {
    animation: none !important;
  }
  .chat-toggle.attention-bounce {
    animation: none !important;
  }
  .chat-greeting-bubble {
    transition: none !important;
  }
  .chat-greeting-bubble.visible {
    opacity: 1;
    visibility: visible;
  }
  .particle-dot {
    animation: none !important;
    display: none;
  }
  .chat-toggle .online-status {
    animation: none !important;
  }
}
