/* ==========================================================================
   GRUPOCHAT / NOVATECNOLOGY - MODERN DARK THEME CSS
   Pixel-perfect styling matching reference screenshot
   ========================================================================== */

:root {
  --bg-app: #08101a;
  --bg-sidebar: #09121d;
  --bg-topbar: rgba(9, 18, 29, 0.95);
  --bg-card: #0d1927;
  --bg-card-hover: #132235;
  --bg-active-chat: linear-gradient(90deg, #0d3839 0%, #0e2735 100%);
  --border-active-chat: rgba(0, 229, 153, 0.45);
  
  --color-primary: #00e599;
  --color-primary-hover: #00ffaa;
  --color-primary-glow: rgba(0, 229, 153, 0.35);
  --color-cyan: #38bdf8;
  --color-cyan-glow: rgba(56, 189, 248, 0.35);
  
  --text-main: #f8fafc;
  --text-muted: #8899a6;
  --text-dim: #546574;
  
  --bubble-incoming: #112234;
  --bubble-outgoing: #082d30;
  --bubble-outgoing-border: rgba(0, 229, 153, 0.28);
  
  --input-bg: #0c1827;
  --input-border: #1a2c3f;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Variables (si el usuario pulsa el botón del sol/luna) */
body.chat-light-theme {
  --bg-app: #f1f5f9;
  --bg-sidebar: #ffffff;
  --bg-topbar: rgba(255, 255, 255, 0.95);
  --bg-card: #f8fafc;
  --bg-card-hover: #e2e8f0;
  --bg-active-chat: linear-gradient(90deg, #e6fffa 0%, #ecfeff 100%);
  --border-active-chat: rgba(0, 180, 120, 0.5);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --bubble-incoming: #e2e8f0;
  --bubble-outgoing: #ccfbf1;
  --bubble-outgoing-border: rgba(13, 148, 136, 0.3);
  --input-bg: #ffffff;
  --input-border: #cbd5e1;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

/* Layout Principal */
.app-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* ==========================================================================
   FONDOS Y EFECTOS ATMOSFÉRICOS
   ========================================================================== */
.tech-bg-effects {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-gradient-radial {
  position: absolute;
  top: 15%;
  right: 25%;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.07) 0%, rgba(0, 229, 153, 0.04) 45%, transparent 70%);
  filter: blur(80px);
  animation: bgPulse 12s ease-in-out infinite alternate;
}

.glow-cyan-orbit {
  position: absolute;
  bottom: 5%;
  left: 20%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 153, 0.06) 0%, rgba(56, 189, 248, 0.03) 50%, transparent 75%);
  filter: blur(90px);
  animation: bgPulse 16s ease-in-out infinite alternate-reverse;
}

@keyframes bgPulse {
  0% { transform: scale(0.9) translate(0, 0); opacity: 0.7; }
  100% { transform: scale(1.1) translate(30px, -20px); opacity: 1; }
}

.circuit-svg-bottom-left {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 380px;
  height: 270px;
  opacity: 0.85;
}

.circuit-svg-top-right {
  position: absolute;
  top: 0;
  right: 0;
  width: 320px;
  height: 260px;
  opacity: 0.75;
}

/* ==========================================================================
   BARRA LATERAL IZQUIERDA (SIDEBAR)
   ========================================================================== */
.sidebar {
  width: 310px;
  min-width: 310px;
  max-width: 310px;
  height: 100%;
  background-color: var(--bg-sidebar);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 10;
  transition: transform var(--transition-smooth);
}

/* Cabecera de la Marca */
.brand-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 20px 20px 22px;
}

.brand-logo-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #00e599 0%, #00b480 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #04241a;
  font-size: 20px;
  box-shadow: 0 4px 18px var(--color-primary-glow);
  flex-shrink: 0;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.brand-status {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.heart-icon {
  font-size: 11px;
}

/* Fila de Título Chats con botón '+' */
.chats-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 22px 14px 22px;
}

.chats-title {
  font-family: 'Outfit', sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.btn-icon-plus {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #112030;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #00e599;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all var(--transition-fast);
}

.btn-icon-plus:hover {
  background: #162b42;
  color: #00ffaa;
  transform: translateY(-1px);
}

/* Buscador Lateral */
.search-box-wrapper {
  margin: 0 18px 16px 18px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon-left {
  position: absolute;
  left: 14px;
  color: var(--text-dim);
  font-size: 13px;
  pointer-events: none;
}

.search-icon-right {
  position: absolute;
  right: 14px;
  color: var(--text-dim);
  font-size: 13px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 38px 0 38px;
  background: #0d1927;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
}

.search-input::placeholder {
  color: var(--text-dim);
}

.search-input:focus {
  border-color: rgba(0, 229, 153, 0.4);
  background: #102033;
  box-shadow: 0 0 12px rgba(0, 229, 153, 0.15);
}

/* Lista de Conversaciones */
.conversations-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Scrollbar estilizado */
.conversations-list::-webkit-scrollbar,
.chat-canvas-container::-webkit-scrollbar {
  width: 6px;
}
.conversations-list::-webkit-scrollbar-thumb,
.chat-canvas-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
.conversations-list::-webkit-scrollbar-thumb:hover,
.chat-canvas-container::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 229, 153, 0.3);
}

/* Elemento de Chat en la Lista */
.chat-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  border-radius: 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: transparent;
  border: 1px solid transparent;
  position: relative;
}

.chat-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Estado Activo: Igual al de Novatecnology en la imagen */
.chat-item.active {
  background: var(--bg-active-chat);
  border: 1px solid var(--border-active-chat);
  box-shadow: 0 4px 20px rgba(0, 229, 153, 0.12);
}

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

.avatar-circle {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #ffffff;
}

.group-avatar-teal {
  background: linear-gradient(135deg, #0d5452 0%, #0a3d3c 100%);
  color: #5eead4;
}

.group-avatar-blue {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.4);
}

.avatar-takamura-dark {
  background: #17283c;
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-dot-online {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 11px;
  height: 11px;
  background-color: var(--color-primary);
  border: 2px solid var(--bg-sidebar);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-primary);
}

.chat-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chat-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-item-name {
  font-size: 14.5px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-you-pink {
  color: #f472b6;
  font-size: 12.5px;
  font-weight: 400;
}

.chat-item-time {
  font-size: 12px;
  color: var(--text-muted);
}

.chat-item-status {
  font-size: 12.5px;
  color: #a7f3d0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-item-handle {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Pie de la Barra Lateral */
.sidebar-footer {
  padding: 16px 18px 20px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.btn-edit-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 10px;
  width: 100%;
  transition: all var(--transition-fast);
}

.btn-edit-profile:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

.btn-edit-profile i {
  font-size: 16px;
  color: #00e599;
}

/* ==========================================================================
   ÁREA PRINCIPAL DEL CHAT (MAIN CHAT)
   ========================================================================== */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  z-index: 5;
  background: transparent;
}

/* Cabecera Superior */
.chat-topbar {
  height: 72px;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  background: var(--bg-topbar);
  backdrop-filter: blur(14px);
  z-index: 20;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-toggle-sidebar {
  display: none; /* Visible sólo en pantallas pequeñas */
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 18px;
  cursor: pointer;
  margin-right: 4px;
}

.room-details {
  display: flex;
  flex-direction: column;
}

.room-title {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.room-online-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
}

.room-online-badge .status-dot-online {
  position: static;
  width: 8px;
  height: 8px;
  border: none;
}

.room-status-text {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Acciones Derecha */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #0f1c2b;
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.topbar-btn:hover {
  background: #15263a;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Perfil JHON RUBIANO en cabecera */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-full);
  margin-left: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.user-profile-badge:hover {
  background: rgba(255, 255, 255, 0.05);
}

.badge-avatar-wrap {
  position: relative;
  width: 36px;
  height: 36px;
}

.badge-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.badge-online-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--color-primary);
  border: 1.5px solid var(--bg-sidebar);
}

.badge-texts {
  display: flex;
  flex-direction: column;
}

.badge-username {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.1;
}

.badge-userhandle {
  font-size: 11.5px;
  color: var(--text-muted);
}

.badge-chevron {
  font-size: 11px;
  color: var(--text-dim);
  margin-left: 2px;
}

/* ==========================================================================
   LIENZO DE MENSAJES Y ELEMENTOS CENTRALES
   ========================================================================== */
.chat-canvas-container {
  flex: 1;
  overflow-y: auto;
  position: relative;
  padding: 24px 36px 110px 36px;
  display: flex;
  flex-direction: column;
}

/* Frase Inspiracional Esquina Superior Derecha */
.quote-banner-topright {
  align-self: flex-end;
  margin-bottom: 20px;
  text-align: right;
  animation: fadeInDown 0.8s ease-out;
}

.quote-lines {
  display: flex;
  flex-direction: column;
  font-family: 'Inter', sans-serif;
  font-style: italic;
  font-size: 14.5px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.35;
  letter-spacing: 0.2px;
}

.quote-accent-bar {
  width: 60px;
  height: 3px;
  background: #00e599;
  margin-top: 8px;
  margin-left: auto;
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(0, 229, 153, 0.6);
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* HERO CENTRAL DE BIENVENIDA CON ORBE */
.welcome-hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 10px auto 36px auto;
  max-width: 600px;
  animation: heroPop 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes heroPop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.orbital-ring-box {
  position: relative;
  width: 170px;
  height: 170px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ring-pulse-back {
  position: absolute;
  inset: -15px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 153, 0.12) 0%, rgba(56, 189, 248, 0.08) 40%, transparent 70%);
  filter: blur(14px);
  animation: pulseGlow 4s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
  0% { transform: scale(0.95); opacity: 0.6; }
  100% { transform: scale(1.1); opacity: 1; }
}

.orbital-track {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.orbit-track-1 {
  width: 154px;
  height: 154px;
  border: 1px dashed rgba(0, 229, 153, 0.28);
  animation: rotateTrack 18s linear infinite;
}

.orbit-track-2 {
  width: 130px;
  height: 130px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  animation: rotateTrackReverse 24s linear infinite;
}

.orbit-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.dot-1 {
  top: 14px;
  left: 28px;
  background-color: #00e599;
  box-shadow: 0 0 8px #00e599;
}

.dot-2 {
  bottom: 18px;
  right: 22px;
  background-color: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
}

@keyframes rotateTrack {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes rotateTrackReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

.orbital-center-icon {
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.center-bubbles-svg {
  width: 90px;
  height: 90px;
  filter: drop-shadow(0 0 16px rgba(0, 229, 153, 0.45));
}

.welcome-title {
  font-family: 'Outfit', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}

.welcome-description {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 480px;
}

/* ==========================================================================
   MENSAJES DEL CHAT (BURBUJAS)
   ========================================================================== */
.chat-messages-area {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 10px;
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  max-width: 75%;
  animation: msgAppear 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Mensaje Entrante (Izquierda) */
.message-row.incoming {
  align-self: flex-start;
}

/* Mensaje Saliente (Derecha) */
.message-row.outgoing {
  align-self: flex-end;
}

.message-avatar-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  margin-bottom: 2px;
}

.msg-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.msg-avatar-takamura {
  background: #142436;
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.msg-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.msg-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  background-color: var(--color-primary);
  border-radius: 50%;
  border: 1.5px solid var(--bg-app);
}

.message-content-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Encabezado sobre la burbuja (Nombre, Tag, Hora) */
.message-meta-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 0 4px;
}

.incoming .message-meta-header {
  justify-content: flex-start;
}

.outgoing .message-meta-header {
  justify-content: flex-end;
}

.sender-name {
  font-weight: 600;
  color: #ffffff;
}

.tag-you-badge {
  background: #00e599;
  color: #04271c;
  font-size: 10px;
  font-weight: 800;
  padding: 1.5px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.message-header-time {
  color: var(--text-dim);
}

/* Burbujas */
.message-bubble {
  padding: 13px 18px;
  border-radius: 18px;
  position: relative;
  line-height: 1.5;
  font-size: 14.5px;
  word-break: break-word;
}

.incoming-bubble {
  background-color: var(--bubble-incoming);
  color: #f1f5f9;
  border-top-left-radius: 4px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.outgoing-bubble {
  background-color: var(--bubble-outgoing);
  color: #f8fafc;
  border-top-right-radius: 4px;
  border: 1px solid var(--bubble-outgoing-border);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}

.bubble-text {
  margin-bottom: 4px;
}

.bubble-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.outgoing-bubble .bubble-footer {
  color: #5eead4;
}

.check-read-icon {
  font-size: 11.5px;
  color: #38bdf8;
}

/* CHIPS DE RESPUESTA RÁPIDA (BOT) */
.quick-replies-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 6px 50px;
}

.quick-chip {
  background: #0d2833;
  border: 1px solid rgba(0, 229, 153, 0.35);
  color: #e2e8f0;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.quick-chip:hover {
  background: #0f3d4c;
  border-color: #00e599;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 229, 153, 0.2);
}

/* Indicador de Escribiendo... */
.typing-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
  align-self: flex-start;
}

.typing-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #112234;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00e599;
  font-size: 14px;
}

.typing-bubble {
  background: var(--bubble-incoming);
  padding: 10px 16px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--color-primary);
  animation: typingBlink 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBlink {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* ==========================================================================
   BARRA DE ENTRADA INFERIOR FLOTANTE (DOCK)
   ========================================================================== */
.chat-dock-footer {
  position: absolute;
  bottom: 24px;
  left: 36px;
  right: 36px;
  z-index: 30;
  pointer-events: none;
}

.input-dock-container {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
  pointer-events: auto;
}

/* Botón Plus */
.btn-dock-plus {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #102133;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #00e599;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.btn-dock-plus:hover {
  background: #152d44;
  color: #00ffaa;
  transform: scale(1.05);
}

/* Pastilla de Entrada de Texto */
.input-pill-wrapper {
  flex: 1;
  height: 52px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  padding: 0 16px 0 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  transition: all var(--transition-fast);
}

.input-pill-wrapper:focus-within {
  border-color: rgba(0, 229, 153, 0.45);
  box-shadow: 0 8px 30px rgba(0, 229, 153, 0.12), 0 0 0 1px rgba(0, 229, 153, 0.2);
}

.dock-text-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 14.5px;
  font-family: inherit;
}

.dock-text-input::placeholder {
  color: var(--text-dim);
}

.pill-right-icons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon-inside {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.btn-icon-inside:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

/* Botón Enviar Verde Brillante */
.btn-send-green {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00e599 0%, #00b480 100%);
  border: none;
  color: #04271c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 20px var(--color-primary-glow);
  transition: all var(--transition-fast);
}

.btn-send-green:hover {
  transform: scale(1.06);
  background: linear-gradient(135deg, #00ffaa 0%, #00cc8e 100%);
  box-shadow: 0 6px 26px rgba(0, 229, 153, 0.5);
}

.btn-send-green:active {
  transform: scale(0.96);
}

/* ==========================================================================
   MODAL EDITAR PERFIL & POPUPS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 14, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  width: 90%;
  max-width: 420px;
  background: #0d1a29;
  border: 1px solid rgba(0, 229, 153, 0.25);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 12px;
}

.modal-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
}

.modal-close-btn:hover {
  color: #ffffff;
}

.profile-avatar-preview {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.profile-avatar-preview img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid #00e599;
  box-shadow: 0 0 20px rgba(0, 229, 153, 0.3);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.modal-input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  background: #08111c;
  border: 1px solid #1a2a3c;
  border-radius: 10px;
  color: #ffffff;
  font-size: 14px;
  outline: none;
}

.modal-input:focus {
  border-color: #00e599;
}

.btn-save-profile {
  width: 100%;
  height: 44px;
  background: linear-gradient(135deg, #00e599 0%, #00b480 100%);
  border: none;
  border-radius: 12px;
  color: #04271c;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: all var(--transition-fast);
}

.btn-save-profile:hover {
  filter: brightness(1.1);
}

/* Popup de Emojis */
.emoji-popup-tray {
  position: absolute;
  bottom: 84px;
  right: 110px;
  background: #0d1a29;
  border: 1px solid rgba(0, 229, 153, 0.25);
  border-radius: 16px;
  padding: 10px 14px;
  display: flex;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 50;
  animation: fadeIn 0.2s ease-out;
}

.emoji-popup-tray span {
  font-size: 22px;
  cursor: pointer;
  transition: transform 0.15s ease;
  user-select: none;
}

.emoji-popup-tray span:hover {
  transform: scale(1.3);
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLETS & MÓVILES)
   ========================================================================== */
@media (max-width: 900px) {
  .quote-banner-topright {
    display: none;
  }
  .chat-dock-footer {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }
  .chat-canvas-container {
    padding: 16px 16px 90px 16px;
  }
  .message-row {
    max-width: 90%;
  }
}

@media (max-width: 768px) {
  .btn-toggle-sidebar {
    display: block;
  }
  .sidebar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .user-profile-badge .badge-texts,
  .user-profile-badge .badge-chevron {
    display: none;
  }
}
