/* Chat bubbles */
.msg-user {
  background: #E92129;
  color: white;
  border-radius: 18px 18px 4px 18px;
  padding: 10px 16px;
  max-width: 75%;
  align-self: flex-end;
  word-break: break-word;
}

.msg-bot {
  background: #f1f5f9;
  color: #1e293b;
  border-radius: 18px 18px 18px 4px;
  padding: 10px 16px;
  max-width: 75%;
  align-self: flex-start;
  word-break: break-word;
}

.dark .msg-bot {
  background: #1e293b;
  color: #f1f5f9;
}

/* Typing indicator */
.typing-dot {
  width: 8px;
  height: 8px;
  background: #94a3b8;
  border-radius: 50%;
  animation: typingBounce 1.2s infinite;
}

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

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

/* Fade in para secciones */
.section-enter {
  animation: fadeSlide 0.25s ease;
}

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

/* Lesson card hover */
.lesson-card {
  transition: border-color 0.15s, transform 0.15s;
}
.lesson-card:hover {
  border-color: #E92129;
  transform: translateY(-2px);
}

/* Scrollbar custom */
.custom-scroll::-webkit-scrollbar { width: 4px; }
.custom-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
.dark .custom-scroll::-webkit-scrollbar-thumb { background: #334155; }

/* Bot bubble wide (para mensajes con imágenes o videos) */
.msg-bot-wide {
  max-width: 90%;
}

/* Imágenes dentro del chat */
.msg-bot img, .msg-bot-wide img, .chat-img {
  max-width: 100%;
  border-radius: 12px;
  cursor: zoom-in;
  border: 1px solid #e2e8f0;
  margin-top: 6px;
  display: block;
  transition: opacity 0.15s;
}

.chat-img:hover { opacity: 0.88; }

.dark .msg-bot img, .dark .msg-bot-wide img {
  border-color: #334155;
}

/* Videos YouTube dentro del chat */
.chat-video-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: 12px;
  overflow: hidden;
  margin-top: 6px;
}

.chat-video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Lightbox overlay */
#chatImgLightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.85);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

#chatImgLightbox.open {
  display: flex;
}

#chatImgLightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.5);
}
