/* ========================================================================
   Chat Window (Mensajería)
   ======================================================================== */

/* Mensajes propios: azul un poco más oscuro que el primary de Limitless (#0c83ff), sin llegar a dark */
.chat-window .media-chat-item-reverse {
	--chat-message-bg: #0a69cc;
	--chat-message-color: var(--white);
}

/* Botones de editar/eliminar: compactos y alineados con la cabecera del mensaje */
.chat-message-actions .btn-icon {
	--btn-padding-x: 0.3125rem;
	--btn-padding-y: 0.3125rem;
	line-height: 1;
}

.chat-message-actions .btn-icon i {
	font-size: 1rem;
}

/* Fondo oscuro semitransparente: contrasta tanto sobre el gris como sobre el azul */
.chat-message-actions .chat-message-action {
	background-color: rgba(0, 0, 0, 0.45);
	color: var(--white);
}

.chat-message-actions .chat-message-action:hover,
.chat-message-actions .chat-message-action:focus {
	background-color: rgba(0, 0, 0, 0.65);
	color: var(--white);
}

.chat-message-actions .chat-message-action-delete:hover,
.chat-message-actions .chat-message-action-delete:focus {
	background-color: var(--danger);
	color: var(--white);
}

/* Contenedor con scroll de los mensajes */
.chat-messages-scroll {
	max-height: 400px;
	overflow-y: auto;
}

/* Respeta saltos de línea (Enter) y tabulaciones del mensaje, y parte palabras/URLs largas */
.chat-message-text {
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	word-break: break-word;
	tab-size: 4;
	-moz-tab-size: 4;
}

/* Imagen adjunta dentro de un mensaje */
.chat-message-attachment {
	max-width: 240px;
	max-height: 320px;
	object-fit: cover;
	cursor: zoom-in;
}

/* ========================================================================
   Adjuntos (fotos y documentos)
   ======================================================================== */

/* Tarjeta de documento dentro de un mensaje */
.chat-attachment-file {
	max-width: 280px;
	text-decoration: none;
	background-color: var(--card-bg, #fff);
}

.chat-attachment-file:hover {
	background-color: var(--gray-100, #f5f5f5);
}

/* Permite truncar el nombre del archivo dentro de un flex */
.chat-attachment-file-info {
	min-width: 0;
}

/* Archivo elegido pendiente de enviar */
.chat-attachment-pending {
	background-color: var(--gray-100, #f5f5f5);
}

.chat-attachment-thumb {
	width: 48px;
	height: 48px;
	object-fit: cover;
	flex-shrink: 0;
}

/* Input de archivo oculto (se activa desde el label) */
.chat-file-input {
	display: none;
}

/* ========================================================================
   Notas de voz
   ======================================================================== */

/* Reproductor dentro de la burbuja del mensaje */
.chat-voice-note-player {
	display: block;
	width: 260px;
	max-width: 100%;
	height: 40px;
}

.chat-voice-note {
	max-width: 100%;
}

/* Barra de grabación / escucha previa / subida */
.chat-voice-recorder {
	min-height: 38px;
}

.chat-voice-recorder .chat-voice-note-player {
	width: auto;
	min-width: 0;
}

.chat-voice-recorder-timer {
	font-variant-numeric: tabular-nums;
	min-width: 3rem;
}

/* Punto rojo parpadeante mientras se graba */
.chat-voice-recorder-dot {
	display: inline-block;
	width: 0.625rem;
	height: 0.625rem;
	border-radius: 50%;
	background-color: var(--danger);
	animation: chat-voice-recording-pulse 1s ease-in-out infinite;
}

@keyframes chat-voice-recording-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.25; }
}

@media (prefers-reduced-motion: reduce) {
	.chat-voice-recorder-dot {
		animation: none;
	}
}

/* Progreso de subida */
.chat-voice-upload-progress {
	height: 0.5rem;
	min-width: 0;
	accent-color: var(--primary);
}

/* Nivel del micrófono mientras se graba */
.chat-voice-level {
	height: 0.375rem;
	min-width: 2rem;
	max-width: 12rem;
	accent-color: var(--success);
}
