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

body {
	font-family: 'Roboto', sans-serif;
	background-color: #f0f0f0;
	overflow: hidden;
}

.container {
	display: flex;
	padding: 20px;
	gap: 20px;
	max-width: 1200px;
	margin: auto;
}

/* Marco del Teléfono */
.phone-frame {
	width: 550px;
	max-height: 1280px;
	height: calc(100vh - 40px);
	background: #1a1a1a;
	border-radius: 35px;
	padding: 12px;
	aspect-ratio: 9 / 16;
	box-shadow:
		0 0 0 8px #2a2a2a,
		0 0 30px rgba(0, 0, 0, 0.5),
		inset 0 0 0 2px #333;

}

.phone-screen {
	width: 100%;
	height: 100%;
	background: black;
	border-radius: 25px;
	overflow: hidden;
	position: relative;
}

/* Panel de Control */
.control-panel {
	flex: 1;
	background: white;
	border-radius: 15px;
	padding: 20px;
	overflow-y: auto;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
	max-height: calc(100vh - 40px);
}

.control-panel h2 {
	color: #075e54;
	margin-bottom: 20px;
	text-align: center;
}

.control-panel h3 {
	color: #333;
	margin: 20px 0 10px 0;
	border-bottom: 2px solid #25d366;
	padding-bottom: 5px;
}

/* Participantes */
.participants-section .participants {
	display: flex;
}

.participants-section .participant {
	margin-bottom: 15px;
	padding: 15px;
	background: #f8f8f8;
	border-radius: 8px;
	border-left: 4px solid #25d366;
}

.participants-section label {
	display: block;
	font-weight: 500;
	margin-bottom: 5px;
	color: #075e54;
}

.participants-section input {
	width: 100%;
	padding: 8px;
	margin-bottom: 8px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
}

.participants-section input:focus {
	outline: none;
	border-color: #25d366;
	box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.2);
}

/* Mensajes */
.messages-section {
	margin-top: 20px;
}

/* Configuración */
.config-section {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid #e0e0e0;
}

.config-controls {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.config-controls .btn {
	flex: 1;
	min-width: 140px;
	font-size: 14px;
	text-align: center;
}

/* Configuración General */
.general-config-section,
.local-config-section {
	margin-bottom: 20px;
	padding-bottom: 15px;
	border-bottom: 1px solid #e0e0e0;
}

.config-row {
	margin-bottom: 15px;
}

.config-row label {
	display: block;
	margin-bottom: 5px;
	font-weight: 500;
	color: #333;
}

/* Control de tamaño de fuente */
.font-size-control {
	display: flex;
	align-items: center;
	gap: 10px;
}

.font-size-control input[type="range"] {
	flex: 1;
	height: 6px;
	background: #e0e0e0;
	border-radius: 3px;
	outline: none;
	-webkit-appearance: none;
}

.font-size-control input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 18px;
	height: 18px;
	background: #25d366;
	border-radius: 50%;
	cursor: pointer;
}

.font-size-control input[type="range"]::-moz-range-thumb {
	width: 18px;
	height: 18px;
	background: #25d366;
	border-radius: 50%;
	cursor: pointer;
	border: none;
}

#font-size-value {
	min-width: 40px;
	font-weight: 500;
	color: #25d366;
}

/* Control de delay */
.delay-control {
	display: flex;
	align-items: center;
	gap: 10px;
}

.delay-control input[type="range"] {
	flex: 1;
	height: 6px;
	background: #e0e0e0;
	border-radius: 3px;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
	padding: 0;
}

.delay-control input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 18px;
	height: 18px;
	background: #25d366;
	border-radius: 50%;
	cursor: pointer;
}

.delay-control input[type="range"]::-moz-range-thumb {
	width: 18px;
	height: 18px;
	background: #25d366;
	border-radius: 50%;
	cursor: pointer;
	border: none;
}

.delay-value {
	min-width: 60px;
	font-weight: 500;
	font-size: 12px;
}

/* Control de avatar */
.avatar-upload-control {
	display: flex;
	gap: 15px;
	align-items: flex-start;
}

.avatar-preview {
	flex-shrink: 0;
}

.avatar-preview img {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid #e0e0e0;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.avatar-controls {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.avatar-controls .btn {
	padding: 6px 12px;
	font-size: 12px;
	border-radius: 6px;
}

.btn-small {
	padding: 6px 12px;
	font-size: 12px;
	border-radius: 6px;
}

@media (max-width: 768px) {
	.config-controls {
		flex-direction: column;
	}

	.config-controls .btn {
		width: 100%;
		margin-bottom: 5px;
	}
}


.form-row {
	display: flex;
	gap: 10px;
	justify-content: space-between;
}

.form-row .form-group {
	width: 100%;
}

.message-config {
	background: #f8f8f8;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 15px;
	margin-bottom: 10px;
	position: relative;
}

.message-config .message-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
}

.message-config .message-number {
	font-weight: bold;
	color: #075e54;
}

.message-config .delete-message {
	background: #ff4444;
	color: white;
	border: none;
	border-radius: 4px;
	padding: 5px 10px;
	cursor: pointer;
	font-size: 12px;
}

.message-config .delete-message:hover {
	background: #cc0000;
}

.message-config select,
.message-config input,
.message-config textarea {
	width: 100%;
	padding: 8px;
	margin-bottom: 8px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
}

.message-config textarea {
	min-height: 80px;
	resize: vertical;
	font-family: inherit;
	white-space: pre-wrap;
	overflow-wrap: break-word;
	line-height: 1.4;
}

.message-config label {
	display: block;
	font-weight: 500;
	margin-bottom: 5px;
	color: #333;
}

/* Botones */
.btn {
	padding: 10px 20px;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	transition: all 0.3s ease;
	margin: 5px;
}

.btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#add-message {
	background: #25d366;
	color: white;
	width: 100%;
}

#add-message:hover {
	background: #20b358;
}

.btn-primary {
	background: #075e54;
	color: white;
}

.btn-primary:hover {
	background: #064e45;
}

.btn-secondary {
	background: #666;
	color: white;
}

.btn-secondary:hover {
	background: #555;
}

.btn-info {
	background: #2196F3;
	color: white;
}

.btn-info:hover {
	background: #1976D2;
}

.btn-danger {
	background: #ff4444;
	color: white;
}

.btn-danger:hover {
	background: #cc0000;
}

.simulation-controls {
	margin-top: 20px;
	text-align: center;
}

/* Chat Container */
.chat-container {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	background: #e5ddd5;
	position: relative;
	background-image: url('assets/img/background.png');
	background-size: contain;
	background-repeat: repeat;
	background-color: #e5ddd5;
}

/* Barra de Estado del Teléfono */
.phone-status-bar {
	background: #fff;
	color: #666;
	padding: 8px 16px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 14px;
	font-weight: 700;
	height: 28px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.status-left {
	display: flex;
	align-items: center;
	gap: 4px;
}

.status-right {
	display: flex;
	align-items: center;
	gap: 4px;
}

.status-right span.icon {
	background-size: contain;
	background-repeat: no-repeat;
	width: 24px;
	height: 24px;
}

.status-right span.icon.wifi {
	background-image: url(assets/img/phone/signal_wifi_4_bar.svg);
}

.status-right span.cellular {
	display: flex;
	align-items: center;
}

.status-right span.cellular .icon.network {
	background-image: url(assets/img/phone/5g.svg);
	width: 18px;
}

.status-right span.cellular .icon.cellular {
	background-image: url(assets/img/phone/signal_cellular.svg);
}

.status-right span.icon.battery {
	background-image: url(assets/img/phone/battery_5_bar.svg);
}

/* Chat Header */
.chat-header {
	background: #fff;
	color: #0a0a0a;
	padding: 8px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	box-shadow: 0 4px 3px rgba(0, 0, 0, 0.2);
	height: 56px;
}

.header-left {
	display: flex;
	align-items: center;
	flex: 1;
}

.back-button {
	margin-right: 8px;
}

.back-button:hover {
	background: rgba(255, 255, 255, 0.1);
}

.chat-avatar img {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	margin-right: 12px;
	object-fit: cover;
}

.chat-info {
	flex: 1;
}

.chat-info h3 {
	margin: 0;
	font-size: 16px;
	font-weight: 450;
}

.chat-info p {
	margin: 2px 0 0 0;
	font-size: 13px;
	opacity: 0.8;
	line-height: 1.1;
}

.chat-info .typing-status {
	opacity: 1;
	font-size: 13px;
	margin: 2px 0 0 0;
	animation: typingGlow 2s ease-in-out infinite;
}

.chat-info .typing-status.hidden {
	display: none;
}

.header-actions {
	display: flex;
	align-items: center;
	gap: 24px;
}


@keyframes typingGlow {

	0%,
	100% {
		opacity: 0.8;
	}

	50% {
		opacity: 1;
	}
}

/* Chat Messages */
.chat-messages {
	flex: 1;
	padding: 10px;
	overflow-y: auto;
	background-image: url('assets/img/background.png');
	background-repeat: repeat;
	display: flex;
	flex-direction: column;
	font-size: 14px; /* Default font size, will be overridden by ChatConfigManager */
}

/* Separador de fecha */
.date-separator {
	text-align: center;
	margin: 16px 0 12px 0;
}

.date-separator span {
	background: rgba(0, 0, 0, 0.6);
	color: white;
	padding: 6px 12px;
	border-radius: 7.5px;
	font-size: 12.5px;
	font-weight: 400;
}

/* Mensajes */
.message {
	display: flex;
	margin-bottom: 7px;
	align-items: flex-end;
	opacity: 0;
	transform: translateY(20px);
	animation: messageAppear 0.3s ease forwards;
	clear: both;
	width: 100%;
	max-width: 500px;
	padding: 0 7px;
}

@keyframes messageAppear {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.message.sent {
	justify-content: flex-end;
}

.message.received {
	justify-content: flex-start;
}

.message-bubble {
	/* Posición relativa para que el "pico" se posicione en base a la burbuja */
	position: relative;
	color: #111b21;
	padding: 8px 12px;
	border-radius: 10px;
	width: fit-content;
	/* El ancho se ajusta al contenido */
	max-width: 80%;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
	margin: 2px 0;
	word-wrap: break-word;
}

/* Mensajes enviados (derecha) */
.message.sent .message-bubble {
	background-color: #dcf8c6;
	border-top-right-radius: 0;
	/* Esto une el "pico" con la burbuja */
	margin-left: auto;
}

/* Pico para mensajes enviados */
.message.sent .message-bubble::before {
	content: '';
	/* Es necesario para que el pseudo-elemento se muestre */
	position: absolute;

	/* Posicionamiento del pico */
	top: 0;
	/* Se alinea con la parte superior de la burbuja */
	right: -8px;
	/* Lo movemos 8px fuera de la burbuja, hacia la derecha */

	/* Creación de la forma de triángulo (el "pico") */
	width: 0;
	height: 0;
	border-top: 0px solid transparent;
	border-bottom: 10px solid transparent;
	border-left: 10px solid #dcf8c6;
	/* Este borde es el que forma el triángulo visible */
}

/* Mensajes recibidos (izquierda) */
.message.received .message-bubble {
	background-color: #ffffff;
	border-top-left-radius: 0;
	/* Esto une el "pico" con la burbuja */
}

/* --- Aquí está la magia --- */
/* Usamos el pseudo-elemento ::before para crear el "pico" */
.message.received .message-bubble::before {
	content: '';
	/* Es necesario para que el pseudo-elemento se muestre */
	position: absolute;

	/* Posicionamiento del pico */
	top: 0;
	/* Se alinea con la parte superior de la burbuja */
	left: -8px;
	/* Lo movemos 8px fuera de la burbuja, hacia la izquierda */

	/* Creación de la forma de triángulo (el "pico") */
	width: 0;
	height: 0;
	border-top: 0px solid transparent;
	border-bottom: 10px solid transparent;
	border-right: 10px solid #ffffff;
	/* Este borde es el que forma el triángulo visible */
}

.message-text {
	margin: 0;
	line-height: 1.4;
	word-wrap: break-word;
	font-size: inherit; /* Inherit from parent for dynamic sizing */
	color: #303030;
	white-space: pre-wrap;
	overflow-wrap: break-word;
}

.message-time {
	font-size: 11px;
	color: rgba(0, 0, 0, 0.45);
	margin-top: 2px;
	text-align: right;
	float: right;
	margin-left: 10px;
}

.message.received .message-time {
	color: rgba(0, 0, 0, 0.45);
}

/* Estilos específicos para mensajes de voz */
/* Mensajes de voz - Estilo WhatsApp */
.voice-message .message-bubble {
	min-width: 320px;
	max-width: 380px;
	padding: 12px;
	position: relative;
}

/* Contenedor principal del mensaje de voz */
.audio-message {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	position: relative;
}

/* Contenedor del avatar con ícono de micrófono */
.voice-avatar-container {
	position: relative;
	flex-shrink: 0;
}

.voice-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	overflow: hidden;
	background: #f0f0f0;
}

.voice-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Ícono de micrófono en esquina inferior derecha del avatar */
.voice-mic-icon {
	position: absolute;
	bottom: -2px;
	right: -2px;
	width: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.voice-mic-icon img {
	width: 22px;
	height: 22px;
}

/* Contenido principal (botón + waveform) */
.voice-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* Fila superior: botón play + waveform */
.voice-content>.audio-play-pause {
	align-self: flex-start;
}

.audio-waveform-container {
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex: 1;
}

/* Contenedor del waveform */
.audio-waveform {
	display: flex;
	align-items: center;
	flex: 1;
}

/* Reorganizar el layout para que sea horizontal */
.audio-message {
	display: flex;
	align-items: start;
	gap: 12px;
	flex-direction: row;
}

.message.received .audio-message {
	flex-direction: row-reverse;
}

.voice-content {
	flex: 1;
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 12px;
}

/* Botón de play/pause */
.audio-play-pause {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	flex-shrink: 0;
	position: relative;
}

.audio-play-pause:hover {
	transform: scale(1.05);
}

.audio-play-pause .play-icon,
.audio-play-pause .pause-icon {
	width: 28px;
	height: 28px;
	filter: brightness(0) saturate(100%) invert(67%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(67%) contrast(1);
	/* Color #aaaaaa */
	display: block;
}

.audio-play-pause .pause-icon {
	display: none;
}

/* Contenedor de waveform reorganizado */
.audio-waveform-container {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.audio-waveform {
	width: 100%;
}

/* SVG de forma de onda */
.audio-waveform svg {
	width: 100%;
	height: 24px;
	cursor: pointer;
}

.audio-waveform svg rect {
	fill: #aaaaaabb;
	transition: fill 0.2s ease;
}

.audio-waveform svg rect.played {
	fill: #6e6e6ebb;
}

/* Cursor de progreso animado */
.audio-cursor {
	fill: #0b77f3bb;
	transition: cx 0.05s linear;
}

/* Información debajo del waveform */
.audio-info {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 2px;
	flex-direction: row;
	padding: 0;
	margin: 0;
}

.audio-duration {
	font-size: 12px;
	color: #8e8e93;
	font-weight: 400;
}

.audio-time-status {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 11px;
	color: #8e8e93;
}

/* Estilos específicos para mensajes enviados */
.message.sent .audio-waveform svg rect {
	fill: #aaaaaaa8;
}

.message.sent .audio-waveform svg rect.played {
	fill: #5f5f5fa8;
}

.message.sent .audio-cursor {
	fill: #0e75f5;
	filter: drop-shadow(0 0 3px rgba(37, 211, 102, 0.5));
}

.message.sent .audio-duration,
.message.sent .audio-time-status {
	color: #4a4a4a;
}

.message.sent .message-status {
	color: #4fc3f7;
	letter-spacing: -9px;
	font-size: 15px;
}

/* Sobrescribir picos para mensajes de voz enviados */
.message.sent.voice-message .message-bubble::before {
	border-left-color: #dcf8c6;
	/* Mantener el color verde para mensajes enviados */
}

/* Sobrescribir picos para mensajes de voz recibidos */
.message.received.voice-message .message-bubble::before {
	border-right-color: #ffffff;
	/* Mantener el color blanco para mensajes recibidos */
}

/* Estados de reproducción */
.voice-message.playing .audio-play-pause {
	animation: pulse 1.5s ease-in-out infinite;
}

.voice-placeholder {
	text-align: center;
	color: #999;
	font-size: 12px;
	margin-top: 8px;
	padding: 4px;
	background: rgba(0, 0, 0, 0.05);
	border-radius: 4px;
}

@keyframes pulse {

	0%,
	100% {
		transform: scale(1);
	}

	50% {
		transform: scale(1.05);
	}
}

/* Responsive */
@media (max-width: 768px) {
	.voice-message .message-bubble {
		min-width: 280px;
		max-width: 320px;
	}
}

/* Estilos para configuración de mensajes de voz */
.voice-config-content {
	padding: 15px;
}

.audio-upload-area {
	border: 2px dashed #ccc;
	border-radius: 8px;
	padding: 20px;
	text-align: center;
	background: white;
	transition: all 0.3s ease;
}

.audio-upload-area.drag-over {
	border-color: #25d366;
	background: #f0f9f0;
}

.audio-upload-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}

.upload-icon {
	font-size: 48px;
	color: #25d366;
}

.upload-text {
	color: #666;
	line-height: 1.4;
}

.select-audio-btn {
	background: none;
	border: none;
	color: #25d366;
	cursor: pointer;
	text-decoration: underline;
}

.upload-formats {
	font-size: 12px;
	color: #999;
}

.audio-loaded {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.audio-filename {
	font-weight: 500;
	color: #333;
}

.audio-duration {
	color: #666;
	font-size: 12px;
}

.change-audio-btn,
.remove-audio-btn {
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	background: white;
	cursor: pointer;
	margin: 0 5px;
}

.change-audio-btn:hover {
	background: #25d366;
	color: white;
}

.remove-audio-btn:hover {
	background: #dc3545;
	color: white;
}

.audio-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	color: #25d366;
}

.loading-spinner {
	width: 24px;
	height: 24px;
	border: 3px solid #f3f3f3;
	border-top: 3px solid #25d366;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}

	100% {
		transform: rotate(360deg);
	}
}

.audio-preview {
	margin-top: 15px;
	padding: 10px;
	background: #f8f9fa;
	border-radius: 8px;
	border: 1px solid #e9ecef;
}

.preview-header {
	font-weight: 500;
	margin-bottom: 8px;
	color: #333;
}

.voice-message-preview {
	display: flex;
	align-items: center;
	gap: 8px;
}

.preview-play-btn {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: none;
	background: #25d366;
	color: white;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.preview-waveform {
	flex: 1;
	height: 24px;
	background: rgba(0, 0, 0, 0.1);
	border-radius: 12px;
	overflow: hidden;
}

.preview-progress-bar {
	width: 100%;
	height: 100%;
	position: relative;
	background: linear-gradient(90deg,
			rgba(255, 255, 255, 0.3) 0%,
			rgba(255, 255, 255, 0.1) 50%,
			rgba(255, 255, 255, 0.3) 100%);
}

.preview-progress {
	height: 100%;
	background: #25d366;
	border-radius: 12px;
	transition: width 0.1s ease;
}

.preview-duration {
	font-size: 11px;
	color: #666;
	min-width: 30px;
	text-align: right;
}

.message-controls {
	display: flex;
	gap: 10px;
	justify-content: center;
	flex-wrap: wrap;
}

.message-controls .btn {
	flex: 1;
	min-width: 140px;
}

/* Previsualizaciones de enlaces */
.link-preview {
	margin: 8px 0;
}


.link-preview.sent {
	margin-left: auto;
}

.link-preview.received {
	margin-right: auto;
}

/* Vista previa dentro del message-bubble */
.message-bubble .link-preview-content {
	border-radius: 8px;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.05);
	transition: background-color 0.2s;
	margin-bottom: 8px;
	border: 1px solid rgba(0, 0, 0, 0.1);
}

.message-bubble .link-preview-content:hover {
	background: rgba(0, 0, 0, 0.08);
}

/* Vista previa separada (legacy) */
.link-preview-content {
	border-radius: 8px;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.03);
	transition: background-color 0.2s;
}

.link-preview-content:hover {
	background: #f5f5f5;
}

.link-preview-content.basic-preview {
	display: flex;
	align-items: center;
}

.link-preview-inner {
	width: 100%;
}

.link-preview-inner.basic-preview {
	display: flex;
	align-items: center;
}

.link-preview-icon {
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	background: #f0f0f0;
	margin: 12px;
	border-radius: 8px;
	flex-shrink: 0;
}

.link-preview-image {
	width: 100%;
	object-fit: cover;
	display: block;
	border-radius: 30px;
	aspect-ratio: 1 / 1;
}

.link-preview-info {
	padding: 12px;
}

.link-preview-title {
	font-weight: 500;
	font-size: 14px;
	color: #333;
	margin-bottom: 4px;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.link-preview-description {
	font-size: 13px;
	color: #666;
	line-height: 1.3;
	margin-bottom: 6px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.link-preview-url {
	font-size: 12px;
	color: #888;
	text-transform: lowercase;
}

.link-preview-loading {
	padding: 16px;
	text-align: center;
	color: #666;
	font-size: 13px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.loading-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid #ddd;
	border-top: 2px solid #25d366;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}

	100% {
		transform: rotate(360deg);
	}
}

/* Indicador de escribiendo */
.typing-indicator {
	display: flex;
	align-items: center;
	padding: 10px 20px;
	background: rgba(255, 255, 255, 0.9);
	margin: 0 20px 20px 20px;
	border-radius: 18px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
	transition: all 0.3s ease;
}

.typing-indicator.hidden {
	display: none;
}

.typing-avatar img {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	margin-right: 10px;
	object-fit: cover;
}

.typing-animation {
	display: flex;
	flex-direction: column;
}

.typing-name {
	font-size: 12px;
	color: #075e54;
	font-weight: 500;
}

.typing-dots {
	display: flex;
	align-items: center;
	margin-top: 2px;
}

.typing-dots span {
	height: 8px;
	width: 8px;
	background: #999;
	border-radius: 50%;
	margin-right: 3px;
	animation: typingDots 1.5s infinite;
}

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

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

@keyframes typingDots {

	0%,
	60%,
	100% {
		transform: translateY(0);
		opacity: 0.4;
	}

	30% {
		transform: translateY(-10px);
		opacity: 1;
	}
}

/* Chat Input */
.chat-input {
	display: flex;
	padding: 15px 20px;
	gap: 10px
}

.chat-input .input {
	display: flex;
	justify-content: space-between;
	flex: 1;
	padding: 12px 16px;
	border: 1px solid #ddd;
	border-radius: 25px;
	outline: none;
	font-size: 14px;
	background: white;
}

.chat-input .input .input-right,
.chat-input .input .input-left {
	display: flex;
	align-items: center;
	gap: 10px;
}

.chat-input .input span.placeholder {
	color: #999;
}

.chat-input button {
	margin-left: 10px;
	padding: 12px 16px;
	background: #25d366;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	font-size: 16px;
	transition: all 0.3s ease;
}

.chat-input button:hover:not(:disabled) {
	background: #20b358;
}

.chat-input button:disabled {
	background: #ccc;
	cursor: not-allowed;
}

/* Responsive */

@media (max-width: 1200px) {

	.participants-section .participants {
		flex-direction: column;
	}
}

@media (max-width: 968px) {
	body {
		overflow: auto;
	}

	.container {
		flex-direction: column;
	}

	.participants-section .participants {
		flex-direction: row;
	}

	.phone-frame {
		width: auto;
		max-width: 576px;
		aspect-ratio: 9 / 16;
		margin: 0 auto;
	}
}

.voice-config-content {
	display: flex;
	flex-direction: column;
	gap: 15px;
	padding-top: 10px;
	/* Espacio para el botón X */
}

/* Fila para autor y retraso en la misma línea */
.voice-author-delay-row {
	display: flex;
	gap: 15px;
	align-items: center;
}

.voice-author-delay-row>div {
	flex: 1;
}

.voice-author-delay-row label {
	display: block;
	margin-bottom: 5px;
	font-size: 12px;
	font-weight: 500;
	color: #333;
}

.voice-author-delay-row select,
.voice-author-delay-row input {
	width: 100%;
	padding: 6px 8px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 12px;
}

/* Fila para botones de cambiar y eliminar audio */
.voice-audio-actions {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-top: 10px;
}

/* Estilos para carga de audio */
.audio-upload-area {
	border: 2px dashed #ddd;
	border-radius: 8px;
	padding: 20px;
	text-align: center;
	transition: all 0.3s ease;
	background: #fafafa;
}

.audio-upload-area.drag-over {
	border-color: #25d366;
	background: #f0fdf4;
}

.audio-upload-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}

.upload-icon {
	font-size: 48px;
	opacity: 0.6;
}

.upload-text {
	color: #666;
	line-height: 1.4;
}

.select-audio-btn {
	background: #25d366;
	color: white;
	border: none;
	padding: 6px 12px;
	border-radius: 4px;
	cursor: pointer;
	text-decoration: underline;
}

.select-audio-btn:hover {
	background: #128c7e;
}

.upload-formats {
	font-size: 12px;
	color: #999;
	margin-top: 5px;
}

.audio-loaded {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px;
}

.audio-filename {
	font-weight: 500;
	color: #333;
}

.audio-loaded .audio-controls {
	display: flex;
	align-items: center;
	gap: 10px;
}

.audio-duration {
	font-size: 12px;
	color: #666;
}

.change-audio-btn,
.remove-audio-btn {
	padding: 6px 12px;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 12px;
	font-weight: 500;
	transition: all 0.2s ease;
}

.change-audio-btn {
	background: #25d366;
	color: white;
}

.change-audio-btn:hover {
	background: #1fa851;
}

.remove-audio-btn {
	background: #ff4444;
	color: white;
}

.remove-audio-btn:hover {
	background: #cc0000;
}

.audio-loading {
	display: flex;
	align-items: center;
	gap: 10px;
	color: #666;
}

.loading-spinner {
	width: 20px;
	height: 20px;
	border: 2px solid #ddd;
	border-top: 2px solid #25d366;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}

	100% {
		transform: rotate(360deg);
	}
}

/* Vista previa de audio */
.audio-preview {
	margin-top: 15px;
	padding: 10px;
	background: white;
	border: 1px solid #ddd;
	border-radius: 4px;
}

.preview-header {
	font-weight: 500;
	margin-bottom: 8px;
	color: #333;
}

.voice-message-preview {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px;
	background: #f8f9fa;
	border-radius: 4px;
}

.preview-play-btn {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: none;
	background: #25d366;
	color: white;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.preview-play-btn:hover {
	background: #128c7e;
}

.preview-progress-container {
	flex: 1;
	height: 20px;
	display: flex;
	align-items: center;
	margin: 0 8px;
}

.preview-progress-bar {
	width: 100%;
	height: 6px;
	background: rgba(0, 0, 0, 0.1);
	border-radius: 3px;
	overflow: hidden;
	position: relative;
}

.preview-progress {
	height: 100%;
	background: #25d366;
	border-radius: 3px;
	transition: width 0.1s ease;
	width: 0%;
}

.preview-duration {
	font-size: 11px;
	color: #666;
	min-width: 30px;
	text-align: right;
}

/* Controles de mensajes */
.message-controls {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.message-controls .btn {
	flex: 1;
	min-width: 140px;
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
	width: 6px;
}

::-webkit-scrollbar-track {
	background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
	background: #25d366;
	border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
	background: #20b358;
}

/* Estilos para respuestas a mensajes */
.message-reply {
	background: rgba(0, 0, 0, 0.08);
	border-radius: 8px;
	padding: 10px 12px;
	margin-bottom: 8px;
	border-left: 3px solid #00a763;
	line-height: 1.4;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.message-reply:hover {
	background: rgba(0, 0, 0, 0.12);
}

.message.sent .message-reply {
	border-left-color: #5c46d6;
	background: rgba(92, 70, 214, 0.1);
}

.message.sent .message-reply:hover {
	background: rgba(92, 70, 214, 0.05);
}

.reply-author {
	font-weight: 600;
	margin-bottom: 4px;
}

.message.sent .reply-author {
	color: #272e50;
	font-weight: bold;
}

.reply-content {
	color: #555;
	opacity: 0.9;
}

/* Para respuestas con enlaces - miniatura al lado derecho */
.message-reply.has-link {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	justify-content: space-between;
}

.message-reply.has-link .reply-text {
	flex: 1;
	min-width: 0;
}

.message-reply.has-link .reply-thumbnail {
	width: 48px;
	height: 48px;
	border-radius: 6px;
	overflow: hidden;
	flex-shrink: 0;
	background: #f5f5f5;
	border: 1px solid rgba(0, 0, 0, 0.1);
}

.message-reply.has-link .reply-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.message-reply.has-link .reply-content {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 100%;
}