/* ========================================================
   CEFIP LATAM — CEFIP Live Messenger (Estilo Windows Live Messenger)
   Inspirado en MSN Messenger / Windows Live Messenger adaptado a Trading Pro
   ======================================================== */

/* Variables específicas del Messenger */
:root {
  --wlm-cyan: #00A4EF;
  --wlm-cyan-dark: #0078D7;
  --wlm-cyan-glow: rgba(0, 164, 239, 0.25);
  --wlm-emerald: #22C55E;
  --wlm-amber: #EAB308;
  --wlm-crimson: #EF4444;
  --wlm-slate: #64748B;
  
  --wlm-bg-glass: rgba(13, 15, 32, 0.94);
  --wlm-bg-header: linear-gradient(180deg, #181d2f 0%, #121526 100%);
  --wlm-bg-input: #0d0f20;
  --wlm-border-glass: rgba(130, 132, 153, 0.28);
  --wlm-shadow-win: 0 16px 48px rgba(9, 11, 23, 0.8), 0 0 0 1px rgba(130, 132, 153, 0.16);
}

/* ----------------------------------------------------
   ANIMACIONES MSN
   ---------------------------------------------------- */
@keyframes wlm-nudge {
  0% { transform: translate(0, 0) rotate(0deg); }
  15% { transform: translate(-8px, 6px) rotate(-1.5deg); }
  30% { transform: translate(8px, -6px) rotate(1.5deg); }
  45% { transform: translate(-6px, -4px) rotate(-1deg); }
  60% { transform: translate(6px, 4px) rotate(1deg); }
  75% { transform: translate(-3px, 2px) rotate(-0.5deg); }
  90% { transform: translate(3px, -2px) rotate(0.5deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.wlm-nudge-active {
  animation: wlm-nudge 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both !important;
}

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

@keyframes wlm-typing-dot {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40% { transform: translateY(-4px); opacity: 1; }
}

/* ----------------------------------------------------
   BOTÓN FLOTANTE LAUNCHER (ESQUINA INFERIOR DERECHA COMPACTA)
   ---------------------------------------------------- */
.wlm-floating-trigger {
  position: fixed !important;
  bottom: 16px;
  right: 16px !important;
  left: auto !important;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 10px;
  background: rgba(18, 21, 38, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(101, 76, 244, 0.45);
  border-radius: 9999px;
  color: #FFFFFF;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(9, 11, 23, 0.65), 0 0 18px rgba(78, 75, 247, 0.28);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, opacity 0.2s ease;
  user-select: none;
}

.wlm-floating-trigger:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 32px rgba(9, 11, 23, 0.8), 0 0 24px rgba(101, 76, 244, 0.48);
  border-color: #7a4ef4;
}

.wlm-floating-trigger.is-compact {
  padding: 8px !important;
  gap: 0 !important;
  opacity: 0.78;
}

.wlm-floating-trigger.is-compact:hover {
  opacity: 1;
}

.wlm-floating-trigger.is-compact .wlm-trigger-label,
.wlm-floating-trigger.is-compact .wlm-trigger-min-btn {
  display: none !important;
}

.wlm-floating-trigger.is-compact .wlm-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  padding: 1px 5px;
  font-size: 10px;
  min-width: 17px;
}

.wlm-trigger-min-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 2px;
  border-radius: 50%;
  border: none;
  background: rgba(130, 132, 153, 0.2);
  color: #c4c9d9;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.wlm-trigger-min-btn:hover {
  background: rgba(101, 76, 244, 0.35);
  color: #ffffff;
}

/* Margen inferior de seguridad para que nunca tape botones ni filas finales */
body.cefip-has-messenger .admin-content,
body.cefip-has-messenger .admin-sidebar,
body.cefip-has-messenger .student-layout > main,
body.cefip-has-messenger main.container,
body.cefip-has-messenger main {
  padding-bottom: 88px !important;
}

.wlm-floating-trigger:active {
  transform: translateY(0) scale(0.98);
}

.wlm-logo-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.wlm-logo-icon svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.wlm-trigger-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #FFFFFF;
}

.wlm-badge {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  color: #FFF;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 9999px;
  min-width: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
  transform: translateZ(0);
}

.wlm-badge.hidden {
  display: none !important;
}

/* ----------------------------------------------------
   VENTANA FLOTANTE DOCKABLE (ESTILO WINDOWS LIVE MESSENGER)
   ---------------------------------------------------- */
.wlm-dock-window {
  position: fixed;
  bottom: 80px;
  right: 24px;
  left: auto;
  width: 380px;
  height: 580px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 110px);
  background: var(--wlm-bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--wlm-border-glass);
  border-radius: 12px;
  box-shadow: var(--wlm-shadow-win);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  overflow: hidden;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom right;
}

/* Si la ventana se está arrastrando con el ratón */
.wlm-dock-window.is-dragging {
  user-select: none !important;
  -webkit-user-select: none !important;
  transition: none !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.9), 0 0 35px rgba(0, 164, 239, 0.45) !important;
  opacity: 0.98;
}

.wlm-dock-window.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.94);
}

.wlm-dock-window.is-maximized {
  width: 920px !important;
  height: 680px !important;
  max-width: calc(100vw - 32px) !important;
  max-height: calc(100vh - 80px) !important;
}

.wlm-dock-window.is-maximized .wlm-dock-body {
  display: flex !important;
  flex-direction: row !important;
}

.wlm-dock-window.is-maximized .wlm-dock-sidebar {
  width: 320px !important;
  min-width: 290px !important;
  max-width: 340px !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  display: flex !important;
}

.wlm-dock-window.is-maximized .wlm-dock-main {
  flex: 1 !important;
  display: flex !important;
}

.wlm-dock-window.is-maximized #wlm-chat-back-btn {
  display: none !important;
}

/* Barra de Título Retro-Moderna de Windows con soporte Draggable */
.wlm-titlebar {
  height: 38px;
  background: linear-gradient(180deg, #181d2f 0%, #121526 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}

.wlm-titlebar:active {
  cursor: grabbing;
}

.wlm-titlebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #E2E8F0;
  letter-spacing: 0.3px;
}

.wlm-titlebar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wlm-win-btn {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: #94A3B8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.15s ease;
}

.wlm-win-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
}

.wlm-win-btn.close-btn:hover {
  background: #EF4444;
  color: #FFF;
}

/* ----------------------------------------------------
   HEADER DEL PERFIL (MSN PERSONAL STATUS)
   ---------------------------------------------------- */
.wlm-profile-card {
  padding: 14px 16px;
  background: var(--wlm-bg-header);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 12px;
  align-items: center;
  position: relative;
}

.wlm-avatar-wrapper {
  position: relative;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}

.wlm-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid #181d2f;
  background: #181d2f;
}

.wlm-status-dot {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #121526;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
}

.wlm-status-dot.en_linea { background: var(--wlm-emerald); }
.wlm-status-dot.ausente { background: var(--wlm-amber); }
.wlm-status-dot.ocupado { background: var(--wlm-crimson); }
.wlm-status-dot.desconectado { background: var(--wlm-slate); }

.wlm-profile-info {
  flex: 1;
  min-width: 0;
}

.wlm-profile-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.wlm-profile-name {
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wlm-status-badge-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: #E2E8F0;
  font-size: 11px;
  padding: 1px 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.wlm-status-badge-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.wlm-personal-msg {
  font-size: 12px;
  color: #94A3B8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 4px;
  margin-left: -4px;
  transition: background 0.15s ease, color 0.15s ease;
}

.wlm-personal-msg:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #E2E8F0;
}

/* Menú flotante de estados (Online, Away, Busy, Offline) */
.wlm-status-dropdown {
  position: absolute;
  top: 58px;
  left: 68px;
  background: #181d2f;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 10005;
  width: 170px;
  padding: 6px 0;
  display: none;
}

.wlm-status-dropdown.show {
  display: block;
}

.wlm-status-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 12px;
  color: #E2E8F0;
  cursor: pointer;
  transition: background 0.15s ease;
}

.wlm-status-item:hover {
  background: rgba(0, 164, 239, 0.18);
  color: #FFFFFF;
}

/* ----------------------------------------------------
   BARRA DE ICONOS MSN (ACCIONES RÁPIDAS)
   ---------------------------------------------------- */
.wlm-quickbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(25, 30, 42, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.wlm-quick-tabs {
  display: flex;
  gap: 4px;
}

.wlm-tab-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wlm-tab-btn:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.08);
}

.wlm-tab-btn.active {
  background: rgba(0, 164, 239, 0.2);
  color: #38BDF8;
  border: 1px solid rgba(0, 164, 239, 0.35);
}

.wlm-quick-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wlm-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #CBD5E1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wlm-icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.2);
}

/* ----------------------------------------------------
   BARRA DE BÚSQUEDA MSN
   ---------------------------------------------------- */
.wlm-search-box {
  padding: 8px 14px;
  background: #121526;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
}

.wlm-search-input {
  width: 100%;
  padding: 7px 12px 7px 32px;
  background: #0d0f20;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  color: #FFFFFF;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wlm-search-input:focus {
  border-color: var(--wlm-cyan);
  box-shadow: 0 0 10px rgba(0, 164, 239, 0.25);
}

.wlm-search-icon {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748B;
  font-size: 12px;
  pointer-events: none;
}

/* ----------------------------------------------------
   LISTA DE CONTACTOS / GRUPOS (PANEL IZQUIERDO)
   ---------------------------------------------------- */
.wlm-contacts-panel {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
}

.wlm-group-header {
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 800;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.wlm-group-header:hover {
  color: #94A3B8;
}

.wlm-contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
  position: relative;
}

.wlm-contact-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.wlm-contact-item.active {
  background: rgba(0, 164, 239, 0.12);
  border-left-color: var(--wlm-cyan);
}

.wlm-contact-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.wlm-contact-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  object-fit: cover;
  background: #181d2f;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.wlm-contact-avatar .avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #38BDF8;
  border: 1px solid rgba(0, 164, 239, 0.3);
}

.wlm-contact-details {
  flex: 1;
  min-width: 0;
}

.wlm-contact-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.wlm-contact-name {
  font-size: 13px;
  font-weight: 600;
  color: #E2E8F0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wlm-contact-role {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  text-transform: uppercase;
}

.wlm-contact-role.docente { background: rgba(0, 164, 239, 0.2); color: #38BDF8; border: 1px solid rgba(0, 164, 239, 0.45); }
.wlm-contact-role.admin { background: rgba(239, 68, 68, 0.2); color: #F87171; border: 1px solid rgba(239, 68, 68, 0.45); }
.wlm-contact-role.alumno { background: rgba(34, 197, 94, 0.15); color: #4ADE80; border: 1px solid rgba(34, 197, 94, 0.35); }
.wlm-contact-role.grupo { background: rgba(168, 85, 247, 0.2); color: #C084FC; border: 1px solid rgba(168, 85, 247, 0.4); }

.wlm-contact-sub {
  font-size: 11px;
  color: #64748B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ----------------------------------------------------
   VENTANA DE CONVERSACIÓN (PANEL DERECHO)
   ---------------------------------------------------- */
.wlm-chat-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #0d0f20;
}

.wlm-chat-header {
  padding: 10px 16px;
  background: linear-gradient(180deg, #181d2f 0%, #121526 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wlm-chat-peer {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.wlm-chat-peer-info {
  min-width: 0;
}

.wlm-chat-peer-name {
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wlm-chat-peer-status {
  font-size: 11px;
  color: #94A3B8;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wlm-chat-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Botón ¡Zumbido! MSN */
.wlm-btn-nudge {
  background: linear-gradient(135deg, #4e4bf7 0%, #7a4ef4 100%);
  border: 1px solid rgba(101, 76, 244, 0.45);
  color: #FFFFFF;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(78, 75, 247, 0.3);
  transition: all 0.2s ease;
}

.wlm-btn-nudge:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(101, 76, 244, 0.5);
  background: linear-gradient(135deg, #5d5af8 0%, #8b63f6 100%);
}

.wlm-btn-nudge:active {
  transform: translateY(1px);
}

/* Contenedor de Mensajes */
.wlm-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: radial-gradient(circle at top right, rgba(0, 164, 239, 0.05), transparent 40%), #090b17;
}

/* Notificación del Sistema MSN (Zumbidos, Avisos) */
.wlm-msg-system {
  align-self: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 11px;
  color: #94A3B8;
  text-align: center;
  margin: 6px 0;
  max-width: 85%;
}

.wlm-msg-system.nudge-alert {
  background: rgba(101, 76, 244, 0.16);
  border-color: rgba(101, 76, 244, 0.45);
  color: #a59dff;
  font-weight: 700;
}

/* Burbujas de Mensaje */
.wlm-message-card {
  display: flex;
  gap: 10px;
  max-width: 82%;
  align-self: flex-start;
}

.wlm-message-card.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.wlm-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.wlm-msg-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  background: #181d2f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.wlm-message-card.mine .wlm-msg-bubble {
  background: linear-gradient(135deg, #1A2E44 0%, #112030 100%);
  border-color: rgba(0, 164, 239, 0.35);
}

.wlm-msg-author {
  font-size: 11px;
  font-weight: 700;
  color: #38BDF8;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wlm-message-card.mine .wlm-msg-author {
  color: #a59dff;
  justify-content: flex-end;
}

.wlm-msg-body {
  font-size: 13px;
  color: #E2E8F0;
  line-height: 1.45;
  word-break: break-word;
}

.wlm-msg-time {
  font-size: 10px;
  color: #64748B;
  text-align: right;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.wlm-read-check {
  color: #38BDF8;
  font-weight: 800;
  font-size: 11px;
}

/* Adjuntos (Imágenes y Archivos) */
.wlm-attachment-img {
  max-width: 100%;
  max-height: 240px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 6px;
  transition: transform 0.2s ease;
}

.wlm-attachment-img:hover {
  transform: scale(1.02);
}

.wlm-attachment-doc {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin-top: 6px;
  text-decoration: none;
  color: #E2E8F0;
  transition: background 0.15s ease;
}

.wlm-attachment-doc:hover {
  background: rgba(0, 164, 239, 0.15);
  border-color: rgba(0, 164, 239, 0.3);
}

/* Indicador de escritura (Typing...) */
.wlm-typing-bar {
  padding: 4px 16px;
  font-size: 11px;
  color: #94A3B8;
  background: #0d0f20;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
}

.wlm-typing-dots {
  display: inline-flex;
  gap: 3px;
}

.wlm-typing-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #38BDF8;
  animation: wlm-typing-dot 1.2s infinite ease-in-out;
}

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

/* ----------------------------------------------------
   BARRA DE ENTRADA Y TOOLBAR DE EMOTICONOS MSN
   ---------------------------------------------------- */
.wlm-input-area {
  padding: 10px 14px;
  background: #121526;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.wlm-input-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.wlm-toolbar-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wlm-tool-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.wlm-tool-btn:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.08);
}

.wlm-input-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.wlm-textarea {
  flex: 1;
  background: var(--wlm-bg-input);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 9px 12px;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 13px;
  resize: none;
  max-height: 90px;
  min-height: 38px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wlm-textarea:focus {
  border-color: var(--wlm-cyan);
  box-shadow: 0 0 10px rgba(0, 164, 239, 0.2);
}

.wlm-send-btn {
  background: linear-gradient(135deg, #00A4EF 0%, #0078D7 100%);
  border: 1px solid rgba(0, 164, 239, 0.5);
  color: #FFF;
  font-weight: 700;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 164, 239, 0.35);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.wlm-send-btn:hover {
  background: linear-gradient(135deg, #1EB2FA 0%, #0C85E9 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 164, 239, 0.5);
}

.wlm-send-btn:active {
  transform: translateY(0);
}

/* Dropdown de Emoticonos Clásicos MSN */
.wlm-emoji-picker {
  position: absolute;
  bottom: 80px;
  left: 14px;
  background: #181d2f;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  z-index: 10006;
}

.wlm-emoji-picker.hidden {
  display: none !important;
}

.wlm-emoji-item {
  font-size: 20px;
  cursor: pointer;
  text-align: center;
  padding: 4px;
  border-radius: 6px;
  transition: transform 0.15s ease, background 0.15s ease;
}

.wlm-emoji-item:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.25);
}

/* ----------------------------------------------------
   PÁGINA DEDICADA DE MESSENGER (/alumno/messenger.html)
   ---------------------------------------------------- */
.wlm-full-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  height: calc(100vh - 120px);
  min-height: 580px;
  background: var(--wlm-bg-glass);
  border: 1px solid var(--wlm-border-glass);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.wlm-full-sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  background: #121526;
}

.wlm-full-main {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Empty State cuando no hay chat seleccionado */
.wlm-empty-chat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 30px;
  color: #64748B;
}

.wlm-empty-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 16px;
  opacity: 0.75;
}

/* ----------------------------------------------------
   MODAL DE ERROR / SIN MATRÍCULA
   ---------------------------------------------------- */
.wlm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 10010;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.wlm-modal-box {
  background: #121526;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  max-width: 440px;
  width: 100%;
  padding: 26px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  text-align: center;
}

/* ----------------------------------------------------
   RESPONSIVIDAD Y MÓVILES
   ---------------------------------------------------- */
@media (max-width: 768px) {
  .wlm-dock-window {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    bottom: 0 !important;
    right: 0 !important;
    border-radius: 0 !important;
  }

  .wlm-full-layout {
    grid-template-columns: 1fr;
    height: calc(100vh - 100px);
  }

  .wlm-full-sidebar.has-active-chat {
    display: none;
  }

  .wlm-full-main:not(.has-active-chat) {
    display: none;
  }
}
