/**
 * WhatsApp 2025 Style Bot Simulation
 * Authentischer WhatsApp-Look mit Typing Bubble links
 */

/* ========================================
   Container & Layout
   ======================================== */

.bot-simulation-container {
  height: 180px;
  min-height: 180px;
  max-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 20px;
  max-width: 100%;
  margin: 0 auto;
  position: relative;
}

.bot-simulation-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  height: 130px;
  min-height: 130px;
  max-height: 130px;
  transition: opacity 0.5s ease, transform 0.5s ease;
  position: relative;
}

/* ========================================
   Fade Animations
   ======================================== */

.bot-simulation-content.fade-in {
  opacity: 1;
  transform: translateY(0);
}

.bot-simulation-content.fade-out {
  opacity: 0;
  transform: translateY(-10px);
}

/* ========================================
   Visibility Helper
   ======================================== */

.bot-simulation-container .hidden {
  display: none !important;
}

/* ========================================
   User Question Bubble (Right Side - Glass Style)
   Glassmorphism Design wie User-Nachricht
   ======================================== */

.bot-question-wrapper {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  padding-right: 0;
  animation: slideInRight 0.5s ease;
}

.bot-question-bubble {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.95);
  padding: 14px 36px;
  border-radius: 30px;
  max-width: 95%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
  margin-right: 0;
  width: fit-content;
}

.bot-question-bubble .question-text {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.25;
  font-style: italic;
  color: rgba(255, 255, 255, 0.95);
  white-space: nowrap;
}

/* ========================================
   Bot Typing Indicator (Far Left - Glass Style)
   Glassmorphism mit Typing Animation
   ======================================== */

.bot-typing-wrapper {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  padding-left: 0;
  animation: slideInLeft 0.4s ease;
}

.bot-typing-bubble {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 12px 20px;
  border-radius: 25px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 70px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0;
}

/* WhatsApp-Style Typing Dots in Glass Bubble */
.typing-dots {
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
}

.typing-dots .dot {
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}

/* Staggered bounce effect - authentic WhatsApp style */
.typing-dots .dot:nth-child(1) {
  animation-delay: 0s;
}

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

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

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

/* ========================================
   Bot Answer Bubble (Centered - Glass Style)
   Glassmorphism mit grünem Akzent
   ======================================== */

.bot-answer-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  animation: slideIn 0.5s ease;
}

.bot-answer-bubble {
  background: rgba(37, 211, 102, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(37, 211, 102, 0.5);
  color: white;
  padding: 12px 36px;
  border-radius: 25px;
  max-width: 98%;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.2);
  position: relative;
  width: fit-content;
  margin: 0 auto;
}

.bot-answer-bubble .answer-text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
  color: white;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

/* ========================================
   Progress Indicator
   ======================================== */

.bot-progress {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 0;
  min-height: 24px;
}

.progress-dot {
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transition: all 0.3s ease;
  cursor: default;
}

.progress-dot.active {
  background: white;
  transform: scale(1.3);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

/* ========================================
   Slide Animations
   ======================================== */

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

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ========================================
   Mobile Responsive
   ======================================== */

@media (max-width: 768px) {
  .bot-simulation-container {
    height: 160px;
    min-height: 160px;
    max-height: 160px;
    padding: 16px 10px;
  }

  .bot-simulation-content {
    height: 110px;
    min-height: 110px;
    max-height: 110px;
  }

  .bot-question-wrapper {
    padding-right: 0;
  }

  .bot-typing-wrapper {
    padding-left: 0;
  }

  .bot-question-bubble {
    max-width: 95%;
    padding: 12px 30px;
    border-radius: 28px;
  }

  .bot-answer-bubble {
    max-width: 98%;
    padding: 11px 30px;
    border-radius: 24px;
  }

  .bot-question-bubble .question-text {
    font-size: 1rem;
    line-height: 1.25;
  }

  .bot-answer-bubble .answer-text {
    font-size: 0.95rem;
    line-height: 1.25;
  }

  .typing-dots .dot {
    width: 7px;
    height: 7px;
  }

  @keyframes typingBounce {
    0%, 60%, 100% {
      transform: translateY(0);
      opacity: 0.7;
    }
    30% {
      transform: translateY(-6px);
      opacity: 1;
    }
  }
}

@media (max-width: 480px) {
  .bot-simulation-container {
    height: 150px;
    min-height: 150px;
    max-height: 150px;
    padding: 12px 8px;
  }

  .bot-simulation-content {
    height: 100px;
    min-height: 100px;
    max-height: 100px;
    gap: 10px;
  }

  .bot-question-wrapper {
    padding-right: 0;
  }

  .bot-typing-wrapper {
    padding-left: 0;
  }

  .bot-question-bubble {
    max-width: 96%;
    padding: 11px 26px;
    border-radius: 26px;
  }

  .bot-answer-bubble {
    max-width: 98%;
    padding: 10px 26px;
    border-radius: 22px;
  }

  .bot-question-bubble .question-text {
    font-size: 0.95rem;
    line-height: 1.25;
  }

  .bot-answer-bubble .answer-text {
    font-size: 0.9rem;
    line-height: 1.25;
  }

  .typing-dots {
    gap: 4px;
  }

  .typing-dots .dot {
    width: 6px;
    height: 6px;
  }

  .progress-dot {
    width: 6px;
    height: 6px;
  }

  .bot-progress {
    gap: 6px;
  }

  @keyframes typingBounce {
    0%, 60%, 100% {
      transform: translateY(0);
      opacity: 0.7;
    }
    30% {
      transform: translateY(-5px);
      opacity: 1;
    }
  }
}

/* ========================================
   Accessibility: Reduced Motion
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  .bot-simulation-content,
  .bot-question-wrapper,
  .bot-typing-wrapper,
  .bot-answer-wrapper,
  .progress-dot {
    animation: none !important;
    transition: opacity 0.1s ease !important;
  }

  /* Vereinfachte Typing-Animation für reduced motion */
  .typing-dots .dot {
    animation: simplePulse 1.4s infinite ease-in-out;
  }

  @keyframes simplePulse {
    0%, 100% {
      opacity: 0.5;
    }
    50% {
      opacity: 1;
    }
  }

  @keyframes typingBounce {
    0%, 100% {
      transform: translateY(0);
      opacity: 0.5;
    }
    50% {
      transform: translateY(0);
      opacity: 1;
    }
  }
}

/* ========================================
   High Contrast Mode
   ======================================== */

@media (prefers-contrast: high) {
  .bot-question-bubble,
  .bot-typing-bubble,
  .bot-answer-bubble {
    border: 2px solid rgba(0, 0, 0, 0.2);
  }

  .progress-dot.active {
    outline: 2px solid white;
    outline-offset: 2px;
  }

  .typing-dots .dot {
    border: 1px solid rgba(0, 0, 0, 0.3);
  }
}

/* Removed duplicate dark theme support - already handled above */

/* ========================================
   Print Styles
   ======================================== */

@media print {
  .bot-simulation-container {
    display: none;
  }
}

/* ========================================
   Hover Effects & Transitions
   ======================================== */

/* Smooth transitions for all bubbles */
.bot-question-bubble,
.bot-typing-bubble,
.bot-answer-bubble {
  transition: all 0.3s ease;
}

/* Subtle hover effect */
.bot-question-bubble:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.bot-answer-bubble:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
}
