/**
 * ALJANIA METAL LIVE CHAT - WhatsApp Native Style Metal Dark Theme
 * Ultra-Compact Single-Line Bubbles, Circular Avatars & Custom Google OAuth2 Button
 */

:root {
	--metal-red: #e50914;
	--metal-red-hover: #ff1e27;
	--metal-gold: #fbbf24;
	--metal-gold-glow: rgba(251, 191, 36, 0.45);
	--metal-red-glow: rgba(229, 9, 20, 0.55);
	--metal-dark-bg: #08090d;
	--metal-header-bg: #12151f;
	--metal-panel-bg: #0d1017;
	--metal-input-pill: #181c29;
	--metal-border: #1f2436;
	--metal-text-main: #f1f5f9;
	--metal-text-muted: #94a3b8;
	--wa-mine-bg-1: #450b10;
	--wa-mine-bg-2: #2b070a;
	--wa-mine-border: #6e151d;
	--wa-other-bg: #151925;
	--wa-other-border: #23293d;
}

/* ==========================================================================
   Ajustes de Página Dedicada (/chat/)
   ========================================================================== */
body.page:has(#aljania-metal-chat):not(.home) {
	background-color: #06070a !important;
	color: #f1f5f9 !important;
}

body.page:has(#aljania-metal-chat):not(.home) .page-header,
body.page:has(#aljania-metal-chat):not(.home) .entry-header,
body.page:has(#aljania-metal-chat):not(.home) .single-header,
body.page:has(#aljania-metal-chat):not(.home) h1.page-title,
body.page:has(#aljania-metal-chat):not(.home) h1.entry-title {
	display: none !important;
}

body.page:has(#aljania-metal-chat):not(.home) .rb-small-container,
body.page:has(#aljania-metal-chat):not(.home) .rb-container,
body.page:has(#aljania-metal-chat):not(.home) .entry-content {
	max-width: 1120px !important;
	width: 100% !important;
	margin-left: auto !important;
	margin-right: auto !important;
	padding-left: 16px !important;
	padding-right: 16px !important;
}

/* ==========================================================================
   Contenedor Principal del Chat
   ========================================================================== */
.aljania-chat-wrapper {
	width: 100%;
	max-width: 1100px;
	margin: 10px auto 18px auto;
	height: var(--chat-height, 640px);
	min-height: 500px;
	max-height: 82vh;
	background: var(--metal-dark-bg);
	border: 1px solid var(--metal-border);
	border-radius: 14px;
	box-shadow: 0 18px 45px rgba(0, 0, 0, 0.8), 0 0 28px rgba(229, 9, 20, 0.12);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	position: relative;
	box-sizing: border-box;
}

.aljania-chat-wrapper * {
	box-sizing: border-box;
}

/* ==========================================================================
   BLINDAJE DE AVATARES REDONDOS (Inmune a Elementor y Foxiz)
   ========================================================================== */
#aljania-metal-chat img.aljania-chat-avatar,
#aljania-metal-chat img.aljania-chat-bubble-avatar,
#aljania-metal-chat img.aljania-chat-group-avatar,
.aljania-chat-wrapper img.aljania-chat-avatar,
.aljania-chat-wrapper img.aljania-chat-bubble-avatar,
.aljania-chat-wrapper img.aljania-chat-group-avatar {
	border-radius: 50% !important;
	-webkit-border-radius: 50% !important;
	aspect-ratio: 1 / 1 !important;
	object-fit: cover !important;
	overflow: hidden !important;
	flex-shrink: 0 !important;
	display: block !important;
}

/* ==========================================================================
   1. CABECERA ESTILO WHATSAPP APP BAR
   ========================================================================== */
.aljania-chat-header {
	background: linear-gradient(180deg, #161a27 0%, #10131d 100%);
	border-bottom: 1px solid var(--metal-border);
	padding: 9px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-shrink: 0;
	z-index: 15;
}

.aljania-chat-header-title {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	flex: 1;
}

.aljania-chat-group-avatar-wrap {
	position: relative;
	width: 38px !important;
	height: 38px !important;
	border-radius: 50% !important;
	flex-shrink: 0;
}

.aljania-chat-group-avatar {
	width: 38px !important;
	height: 38px !important;
	border-radius: 50% !important;
	object-fit: cover !important;
	border: 1.5px solid rgba(229, 9, 20, 0.65) !important;
	background: #090a0f;
}

.aljania-live-pulse-dot {
	position: absolute;
	bottom: 0;
	right: 0;
	width: 10px;
	height: 10px;
	background: #10b981;
	border: 2px solid #10131d;
	border-radius: 50% !important;
	display: inline-block;
	box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
	animation: aljaniaPulse 2s infinite;
}

@keyframes aljaniaPulse {
	0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
	70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
	100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.aljania-chat-title-texts {
	min-width: 0;
	flex: 1;
}

.aljania-chat-header-title h3 {
	margin: 0 !important;
	color: #ffffff;
	font-size: 13.5px;
	font-weight: 800;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.2 !important;
}

.aljania-chat-subtitle {
	color: var(--metal-text-muted);
	font-size: 11px;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin-top: 1px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.aljania-chat-subtitle svg {
	color: #e50914;
	flex-shrink: 0;
}

.aljania-chat-header-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.aljania-chat-online-badge {
	background: rgba(16, 185, 129, 0.12);
	border: 1px solid rgba(16, 185, 129, 0.35);
	color: #34d399;
	font-size: 11px;
	font-weight: 700;
	padding: 5px 11px;
	border-radius: 20px !important;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.aljania-chat-online-badge:hover {
	background: rgba(16, 185, 129, 0.22);
	border-color: #34d399;
}

.aljania-chat-icon-btn {
	background: #1b2030;
	border: 1px solid #2a3147;
	color: #cbd5e1;
	width: 34px;
	height: 34px;
	border-radius: 50% !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s ease;
	padding: 0;
}

.aljania-chat-icon-btn:hover {
	background: var(--metal-red);
	border-color: var(--metal-red);
	color: #ffffff;
}

.aljania-chat-icon-btn.is-muted {
	color: #64748b;
	border-color: #1f2436;
}

/* ==========================================================================
   2. BARRA DE PERFIL / MODO ESPECTADOR & BOTÓN GOOGLE PREMIUM
   ========================================================================== */
.aljania-chat-user-strip {
	background: #0c0e15;
	border-bottom: 1px solid #181c29;
	padding: 6px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	font-size: 12px;
	flex-shrink: 0;
	z-index: 12;
}

.aljania-chat-my-profile {
	display: flex;
	align-items: center;
	gap: 9px;
	min-width: 0;
}

.aljania-chat-my-info {
	display: flex;
	align-items: center;
	gap: 7px;
	flex-wrap: wrap;
	min-width: 0;
}

.aljania-chat-avatar {
	width: 28px !important;
	height: 28px !important;
	border-radius: 50% !important;
	object-fit: cover !important;
	flex-shrink: 0;
}

/* BORDES Y GLOWS DE ROLES REDONDOS */
.aljania-chat-avatar.role-admin,
.aljania-chat-bubble-avatar.role-admin {
	border: 2px solid var(--metal-red) !important;
	box-shadow: 0 0 7px var(--metal-red-glow) !important;
}

.aljania-chat-avatar.role-moderator,
.aljania-chat-bubble-avatar.role-moderator {
	border: 2px solid var(--metal-gold) !important;
	box-shadow: 0 0 7px var(--metal-gold-glow) !important;
}

.aljania-chat-avatar.role-member,
.aljania-chat-bubble-avatar.role-member {
	border: 1.5px solid #475569 !important;
}

.aljania-chat-my-name {
	color: #f8fafc;
	font-weight: 700;
	font-size: 12px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.aljania-role-pill {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 9.5px;
	font-weight: 800;
	padding: 2px 7px;
	border-radius: 12px !important;
	letter-spacing: 0.4px;
	text-transform: uppercase;
}

.aljania-role-pill svg {
	flex-shrink: 0;
}

.aljania-role-pill.role-admin {
	background: rgba(229, 9, 20, 0.18);
	color: #ff5c65;
	border: 1px solid rgba(229, 9, 20, 0.45);
}

.aljania-role-pill.role-moderator {
	background: rgba(251, 191, 36, 0.16);
	color: #fbbf24;
	border: 1px solid rgba(251, 191, 36, 0.45);
}

.aljania-role-pill.role-member {
	background: rgba(100, 116, 139, 0.16);
	color: #94a3b8;
	border: 1px solid rgba(100, 116, 139, 0.35);
}

.aljania-chat-logout-btn {
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid #262c3f;
	color: #94a3b8;
	font-size: 10.5px;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 6px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	transition: all 0.2s;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	flex-shrink: 0;
}

.aljania-chat-logout-btn:hover {
	background: rgba(229, 9, 20, 0.15);
	border-color: var(--metal-red);
	color: #ff5c65;
}

/* Modo Espectador */
.aljania-chat-guest-strip {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	gap: 10px;
	flex-wrap: wrap;
}

.aljania-guest-info {
	display: flex;
	align-items: center;
	gap: 7px;
	color: #cbd5e1;
	font-size: 11.5px;
}

.aljania-guest-eye {
	color: #e50914;
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
}

/* Botón Google Personalizado Dark Metal (Sin iframes recortados) */
.aljania-custom-google-btn {
	display: inline-flex !important;
	align-items: center !important;
	gap: 9px !important;
	background: linear-gradient(180deg, #1d2233 0%, #121622 100%) !important;
	border: 1px solid #323c59 !important;
	border-radius: 24px !important;
	padding: 4px 14px 4px 5px !important;
	color: #f8fafc !important;
	font-size: 12px !important;
	font-weight: 700 !important;
	letter-spacing: 0.2px !important;
	cursor: pointer !important;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
	transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
	white-space: nowrap !important;
	text-decoration: none !important;
	outline: none !important;
}

.aljania-custom-google-btn:hover {
	background: linear-gradient(180deg, #252c42 0%, #171c2b 100%) !important;
	border-color: #e50914 !important;
	box-shadow: 0 4px 14px rgba(229, 9, 20, 0.4), 0 0 0 1px rgba(229, 9, 20, 0.25) !important;
	transform: translateY(-1px) !important;
	color: #ffffff !important;
}

.aljania-custom-google-btn:active {
	transform: translateY(0) !important;
}

.aljania-custom-google-btn.is-loading {
	opacity: 0.7 !important;
	pointer-events: none !important;
}

.aljania-g-icon-circle {
	width: 24px !important;
	height: 24px !important;
	border-radius: 50% !important;
	background: #ffffff !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	flex-shrink: 0 !important;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35) !important;
}

.aljania-g-btn-label {
	line-height: 1 !important;
}

/* ==========================================================================
   3. CUERPO PRINCIPAL DEL CHAT (MENSAJES + SIDEBAR)
   ========================================================================== */
.aljania-chat-body {
	display: flex;
	flex: 1;
	min-height: 0;
	overflow: hidden;
	position: relative;
}

.aljania-chat-messages-pane {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-width: 0;
	background-color: #08090d;
	background-image: 
		radial-gradient(rgba(229, 9, 20, 0.045) 1px, transparent 1px),
		radial-gradient(rgba(255, 255, 255, 0.02) 1px, #08090d 1px);
	background-size: 26px 26px;
	background-position: 0 0, 13px 13px;
	position: relative;
	overflow: hidden;
}

.aljania-chat-messages-pane::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 180px;
	height: 180px;
	transform: translate(-50%, -50%);
	background: url('https://www.legiondelmetal.net/wp-content/uploads/2025/01/solologo-150x150.png') no-repeat center center;
	background-size: contain;
	opacity: 0.045;
	pointer-events: none;
	z-index: 1;
}

.aljania-chat-encryption-pill {
	position: relative;
	z-index: 2;
	align-self: center;
	background: rgba(16, 19, 28, 0.72);
	border: 1px solid rgba(255, 255, 255, 0.05);
	color: #64748b;
	font-size: 10px;
	margin: 2px auto 6px auto;
	padding: 2px 10px;
	border-radius: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	text-align: center;
	white-space: nowrap;
	flex-shrink: 0;
}

.aljania-chat-encryption-pill svg {
	color: #fbbf24;
	flex-shrink: 0;
}

.aljania-chat-encryption-pill strong {
	color: #94a3b8;
}

.aljania-chat-stream {
	position: relative;
	z-index: 2;
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: auto !important;
	overscroll-behavior-y: auto !important;
	-webkit-overflow-scrolling: touch;
	touch-action: pan-y;
	padding: 8px 14px 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	scrollbar-width: thin;
	scrollbar-color: #23283b #08090d;
}

.aljania-chat-stream::-webkit-scrollbar {
	width: 5px;
}
.aljania-chat-stream::-webkit-scrollbar-track {
	background: transparent;
}
.aljania-chat-stream::-webkit-scrollbar-thumb {
	background: #23283b;
	border-radius: 3px;
}

.aljania-chat-loading,
.aljania-chat-empty-state {
	text-align: center;
	color: #64748b;
	font-size: 12px;
	margin: auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 20px;
}

.aljania-empty-icon-circle {
	width: 48px;
	height: 48px;
	border-radius: 50% !important;
	background: rgba(229, 9, 20, 0.08);
	border: 1px solid rgba(229, 9, 20, 0.25);
	color: #e50914;
	display: flex;
	align-items: center;
	justify-content: center;
}

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

.aljania-spin {
	animation: aljaniaSpinAnim 1.1s linear infinite;
}

/* ==========================================================================
   4. BURBUJAS DE MENSAJES ESTANDARIZADAS (NOMBRE -> MENSAJE -> HORA)
   ========================================================================== */
.aljania-chat-bubble-wrap {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	max-width: 82%;
	position: relative;
	margin: 2px 0 !important;
	animation: aljaniaFadeIn 0.18s ease-out;
}

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

.aljania-chat-bubble-wrap.is-mine {
	align-self: flex-end;
	flex-direction: row-reverse;
}

.aljania-chat-bubble-wrap.is-other {
	align-self: flex-start;
}

.aljania-chat-bubble-avatar {
	width: 28px !important;
	height: 28px !important;
	border-radius: 50% !important;
	object-fit: cover !important;
	flex-shrink: 0;
	margin: 0 0 2px 0 !important;
}

.aljania-chat-bubble {
	background: var(--wa-other-bg);
	border: 1px solid var(--wa-other-border);
	border-radius: 6px 12px 12px 12px;
	padding: 6px 11px 5px 11px !important;
	position: relative;
	min-width: 145px !important;
	max-width: 440px !important;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.aljania-chat-bubble-wrap.is-mine .aljania-chat-bubble {
	background: linear-gradient(135deg, var(--wa-mine-bg-1) 0%, var(--wa-mine-bg-2) 100%);
	border-color: var(--wa-mine-border);
	border-radius: 12px 6px 12px 12px;
}

/* Estructura estandarizada en 3 niveles: 1. Nombre -> 2. Mensaje -> 3. Hora/Acciones */
.aljania-bubble-compact-row {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 3px;
	line-height: 1.35 !important;
	margin: 0 !important;
}

.aljania-bubble-author-group {
	display: flex;
	align-items: center;
	gap: 5px;
	width: 100%;
}

.aljania-bubble-author {
	font-size: 12px;
	font-weight: 800;
	color: #38bdf8;
	line-height: 1.2;
}

.aljania-chat-bubble-wrap.is-mine .aljania-bubble-author {
	color: #fca5a5;
}

.aljania-bubble-author.role-admin {
	color: #ff4d58 !important;
}

.aljania-bubble-author.role-moderator {
	color: #fbbf24 !important;
}

.aljania-bubble-colon {
	display: none;
}

.aljania-bubble-role-badge {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	font-size: 8.5px;
	font-weight: 800;
	padding: 1px 5px;
	border-radius: 3px;
	letter-spacing: 0.2px;
	line-height: 1;
}

.aljania-bubble-role-badge.role-admin {
	background: rgba(229, 9, 20, 0.25);
	color: #ff6b72;
	border: 1px solid rgba(229, 9, 20, 0.4);
}

.aljania-bubble-role-badge.role-moderator {
	background: rgba(251, 191, 36, 0.2);
	color: #fbbf24;
	border: 1px solid rgba(251, 191, 36, 0.4);
}

.aljania-bubble-content {
	display: block;
	width: 100%;
	color: #f1f5f9;
	font-size: 13.5px;
	line-height: 1.4 !important;
	word-break: break-word;
	margin: 1px 0 2px 0 !important;
	padding: 0 !important;
}

.aljania-bubble-content.is-removed-text {
	color: #64748b;
	font-size: 11.5px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.aljania-bubble-sticker {
	display: block;
	margin: 3px 0;
}

.aljania-bubble-sticker img {
	max-width: 76px !important;
	max-height: 76px !important;
	width: auto !important;
	height: auto !important;
	border-radius: 6px !important;
	display: block !important;
	margin: 2px 0 !important;
	transition: transform 0.2s;
}

.aljania-bubble-sticker img:hover {
	transform: scale(1.08);
}

.aljania-bubble-meta {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 4px;
	width: 100%;
	font-size: 10px;
	color: #64748b;
	line-height: 1;
	margin-top: 1px;
}

.aljania-chat-bubble-wrap.is-mine .aljania-bubble-meta {
	color: rgba(254, 202, 202, 0.75);
}

.aljania-double-check {
	display: inline-flex;
	align-items: center;
	color: #38bdf8;
}

.aljania-bubble-reply-btn,
.aljania-bubble-actions-btn {
	background: transparent;
	border: none;
	color: #94a3b8;
	cursor: pointer;
	padding: 1px 3px;
	border-radius: 4px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	opacity: 0.55;
	transition: opacity 0.18s, color 0.18s, background 0.18s;
}

.aljania-chat-bubble-wrap:hover .aljania-bubble-reply-btn,
.aljania-chat-bubble-wrap:hover .aljania-bubble-actions-btn {
	opacity: 1;
}

.aljania-bubble-reply-btn:hover {
	color: #38bdf8;
	background: rgba(56, 189, 248, 0.14);
}

.aljania-bubble-actions-btn:hover {
	color: #ffffff;
	background: rgba(255, 255, 255, 0.1);
}

/* Cita / Respuesta incrustada dentro de la burbuja (Estilo WhatsApp Quote) */
.aljania-bubble-quoted {
	background: rgba(0, 0, 0, 0.28);
	border-left: 3px solid #38bdf8;
	border-radius: 3px 6px 6px 3px;
	padding: 2px 7px;
	margin-bottom: 3px;
	display: flex;
	align-items: baseline;
	gap: 6px;
	cursor: pointer;
	max-width: 100%;
	overflow: hidden;
	transition: background 0.18s;
}

.aljania-chat-bubble-wrap.is-mine .aljania-bubble-quoted {
	background: rgba(0, 0, 0, 0.34);
	border-left-color: #fbbf24;
}

.aljania-bubble-quoted:hover {
	background: rgba(255, 255, 255, 0.07);
}

.aljania-quoted-author {
	font-size: 10.5px;
	font-weight: 800;
	color: #38bdf8;
	flex-shrink: 0;
}

.aljania-chat-bubble-wrap.is-mine .aljania-quoted-author {
	color: #fbbf24;
}

.aljania-quoted-text {
	font-size: 11px;
	color: #cbd5e1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Efecto de resaltado al saltar al mensaje original citado */
.aljania-chat-bubble-wrap.is-highlighted-reply .aljania-chat-bubble {
	box-shadow: 0 0 0 2px #38bdf8, 0 0 16px rgba(56, 189, 248, 0.55) !important;
	transition: box-shadow 0.25s ease;
}

/* ==========================================================================
   5. PANEL LATERAL DERECHO: CONECTADOS
   ========================================================================== */
.aljania-chat-sidebar-backdrop {
	display: none;
}

.aljania-chat-users-sidebar {
	width: 235px;
	background: var(--metal-panel-bg);
	border-left: 1px solid var(--metal-border);
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	z-index: 20;
}

.aljania-users-sidebar-head {
	padding: 9px 13px;
	border-bottom: 1px solid var(--metal-border);
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: rgba(255, 255, 255, 0.015);
}

.aljania-users-sidebar-head h4 {
	margin: 0 !important;
	color: #e2e8f0;
	font-size: 11px;
	font-weight: 800;
	display: flex;
	align-items: center;
	gap: 6px;
	letter-spacing: 0.5px;
}

.aljania-users-sidebar-head h4 svg {
	color: #10b981;
}

.aljania-close-sidebar-btn {
	display: none;
	background: transparent;
	border: none;
	color: #94a3b8;
	cursor: pointer;
	padding: 3px;
	border-radius: 6px;
	align-items: center;
	justify-content: center;
}

.aljania-close-sidebar-btn:hover {
	color: #ffffff;
	background: rgba(255, 255, 255, 0.08);
}

.aljania-users-list {
	flex: 1;
	overflow-y: auto;
	padding: 8px;
	display: flex;
	flex-direction: column;
	gap: 5px;
	scrollbar-width: thin;
	scrollbar-color: #23283b transparent;
}

.aljania-users-empty {
	color: #64748b;
	font-size: 11px;
	text-align: center;
	padding: 16px 8px;
}

.aljania-user-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 5px 8px;
	border-radius: 8px;
	background: #131722;
	border: 1px solid #1c2233;
	transition: all 0.2s ease;
	position: relative;
}

.aljania-user-item.has-mod-actions {
	cursor: pointer;
}

.aljania-user-item:hover {
	background: #1a2030;
	border-color: #2a334d;
}

.aljania-user-actions-btn {
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.07);
	color: #94a3b8;
	width: 26px;
	height: 26px;
	border-radius: 6px !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	flex-shrink: 0;
	margin-left: auto;
	transition: all 0.18s ease;
}

.aljania-user-item:hover .aljania-user-actions-btn,
.aljania-user-actions-btn:hover {
	background: rgba(229, 9, 20, 0.18);
	border-color: rgba(229, 9, 20, 0.5);
	color: #ffffff;
}

.aljania-user-avatar-box {
	position: relative;
	width: 28px !important;
	height: 28px !important;
	border-radius: 50% !important;
	flex-shrink: 0;
}

.aljania-user-online-dot {
	position: absolute;
	bottom: -1px;
	right: -1px;
	width: 8px;
	height: 8px;
	border-radius: 50% !important;
	background: #10b981;
	border: 1.5px solid #131722;
}

.aljania-user-item-info {
	flex: 1;
	min-width: 0;
}

.aljania-user-item-name {
	color: #f1f5f9;
	font-size: 11.5px;
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	display: block;
	line-height: 1.2;
}

.aljania-user-item-badge {
	font-size: 9.5px;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	gap: 3px;
	margin-top: 1px;
}

.aljania-user-item-badge.badge-admin {
	color: #ff5c65;
}

.aljania-user-item-badge.badge-moderator {
	color: #fbbf24;
}

.aljania-user-item-badge.badge-member {
	color: #94a3b8;
}

/* ==========================================================================
   6. BANDEJAS FLOTANTES (SÍMBOLOS & STICKERS)
   ========================================================================== */
.aljania-chat-emojis-tray,
.aljania-chat-stickers-tray {
	position: absolute;
	bottom: 62px;
	left: 14px;
	background: #151926;
	border: 1px solid #283048;
	border-radius: 12px;
	padding: 10px;
	box-shadow: 0 14px 35px rgba(0, 0, 0, 0.8);
	z-index: 100;
	width: 300px;
}

.aljania-tray-header,
.aljania-stickers-tray-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
	padding-bottom: 6px;
	border-bottom: 1px solid #22283b;
	color: #e2e8f0;
	font-size: 11.5px;
	font-weight: 700;
}

.aljania-tray-close-btn {
	background: transparent;
	border: none;
	color: #94a3b8;
	cursor: pointer;
	padding: 2px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
}

.aljania-tray-close-btn:hover {
	color: #ffffff;
	background: rgba(255, 255, 255, 0.08);
}

.aljania-emojis-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
}

.aljania-emoji-item {
	background: rgba(255, 255, 255, 0.02);
	border: 1px solid transparent;
	font-size: 18px;
	cursor: pointer;
	border-radius: 6px;
	padding: 4px 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s, background 0.15s;
}

.aljania-emoji-item:hover {
	background: #232a3e;
	border-color: #333d59;
	transform: scale(1.12);
}

.aljania-btn-add-sticker-modal {
	background: rgba(229, 9, 20, 0.18);
	border: 1px solid rgba(229, 9, 20, 0.5);
	color: #ff6b72;
	font-size: 10px;
	font-weight: 700;
	padding: 2px 7px;
	border-radius: 5px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.aljania-btn-add-sticker-modal:hover {
	background: var(--metal-red);
	color: #ffffff;
}

.aljania-stickers-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 7px;
	max-height: 200px;
	overflow-y: auto;
}

.aljania-sticker-select-btn {
	background: #0c0e16;
	border: 1px solid #1f2537;
	border-radius: 8px;
	padding: 6px;
	cursor: pointer;
	transition: all 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
}

.aljania-sticker-select-btn:hover {
	border-color: var(--metal-red);
	background: #171b29;
	transform: translateY(-2px);
}

.aljania-sticker-select-btn img {
	width: 52px;
	height: 52px;
	object-fit: contain;
}

/* ==========================================================================
   7. BARRA INFERIOR DE ENVÍO Y BANNER DE RESPUESTA (ESTILO NATIVO WHATSAPP)
   ========================================================================== */
.aljania-chat-footer {
	background: #0d1018;
	border-top: 1px solid var(--metal-border);
	padding: 8px 12px;
	flex-shrink: 0;
	position: relative;
	z-index: 15;
}

.aljania-chat-reply-preview {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #141926;
	border: 1px solid #242c42;
	border-radius: 10px;
	padding: 5px 10px;
	margin-bottom: 7px;
	position: relative;
}

.aljania-reply-preview-bar {
	width: 3px;
	align-self: stretch;
	background: #e50914;
	border-radius: 3px;
	flex-shrink: 0;
}

.aljania-reply-preview-content {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.aljania-reply-preview-author {
	font-size: 11px;
	font-weight: 800;
	color: #ff5c65;
	line-height: 1.2;
}

.aljania-reply-preview-text {
	font-size: 11.5px;
	color: #cbd5e1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.2;
}

.aljania-reply-preview-close {
	background: transparent;
	border: none;
	color: #94a3b8;
	cursor: pointer;
	padding: 3px;
	border-radius: 50% !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: color 0.18s, background 0.18s;
}

.aljania-reply-preview-close:hover {
	color: #ffffff;
	background: rgba(255, 255, 255, 0.08);
}

.aljania-chat-input-row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.aljania-wa-input-pill {
	flex: 1;
	display: flex;
	align-items: center;
	background: var(--metal-input-pill);
	border: 1px solid #262d42;
	border-radius: 24px !important;
	padding: 2px 7px;
	min-height: 40px;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.aljania-wa-input-pill:focus-within {
	border-color: rgba(229, 9, 20, 0.7);
	box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.18);
}

.aljania-chat-tool-btn {
	background: transparent;
	border: none;
	color: #94a3b8;
	width: 34px;
	height: 34px;
	border-radius: 50% !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: color 0.2s, background 0.2s;
	flex-shrink: 0;
	padding: 0;
}

.aljania-chat-tool-btn:hover,
.aljania-chat-tool-btn.is-active {
	color: #ffffff;
	background: rgba(255, 255, 255, 0.08);
}

.aljania-chat-tool-btn.is-active {
	color: var(--metal-red);
}

#aljania-chat-input {
	flex: 1;
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	color: #f1f5f9;
	font-size: 13.5px;
	padding: 6px 8px;
	outline: none !important;
	min-width: 0;
}

#aljania-chat-input::placeholder {
	color: #64748b;
}

.aljania-chat-send-btn {
	background: linear-gradient(135deg, #e50914 0%, #b8050e 100%);
	border: 1px solid #ff333e;
	color: #ffffff;
	width: 40px;
	height: 40px;
	border-radius: 50% !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 3px 12px rgba(229, 9, 20, 0.45);
	transition: transform 0.15s ease, box-shadow 0.2s ease;
	flex-shrink: 0;
	padding: 0;
}

.aljania-chat-send-btn:hover {
	transform: scale(1.06);
	box-shadow: 0 5px 16px rgba(229, 9, 20, 0.65);
}

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

.aljania-chat-locked-footer {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	color: #94a3b8;
	font-size: 12px;
	padding: 4px 8px;
	text-align: center;
}

.aljania-chat-locked-footer svg {
	color: var(--metal-red);
	flex-shrink: 0;
}

/* ==========================================================================
   8. MODALES (STICKERS & MODERACIÓN)
   ========================================================================== */
.aljania-chat-modal {
	position: fixed;
	top: 0; left: 0; right: 0; bottom: 0;
	background: rgba(0, 0, 0, 0.78);
	backdrop-filter: blur(3px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 999999;
	padding: 16px;
}

.aljania-chat-modal-box {
	background: #141824;
	border: 1px solid #283048;
	border-radius: 12px;
	width: 100%;
	max-width: 420px;
	padding: 18px 20px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
}

.aljania-chat-modal-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid #22283c;
	padding-bottom: 12px;
	margin-bottom: 14px;
}

.aljania-chat-modal-head h4 {
	margin: 0;
	color: #ffffff;
	font-size: 15px;
	font-weight: 800;
}

.aljania-modal-close {
	background: transparent;
	border: none;
	color: #94a3b8;
	cursor: pointer;
	padding: 4px;
	border-radius: 6px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.aljania-modal-close:hover {
	color: #ffffff;
	background: rgba(255, 255, 255, 0.08);
}

.aljania-chat-modal-body label {
	font-size: 12px;
	font-weight: 700;
	color: #cbd5e1;
	margin-bottom: 5px;
	display: block;
}

.aljania-chat-modal-body input.widefat {
	width: 100%;
	background: #0b0d14;
	border: 1px solid #262e45;
	border-radius: 6px;
	color: #ffffff;
	padding: 9px 12px;
	font-size: 13px;
}

.aljania-chat-modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 16px;
}

.aljania-btn-primary-metal {
	background: linear-gradient(135deg, #e50914 0%, #b8050e 100%);
	color: #ffffff;
	border: 1px solid #ff333e;
	border-radius: 6px;
	padding: 9px 18px;
	font-size: 12.5px;
	font-weight: 700;
	cursor: pointer;
}

.aljania-mod-user-card {
	display: flex;
	align-items: center;
	gap: 12px;
	background: #0d1018;
	border: 1px solid #22293d;
	border-radius: 10px;
	padding: 10px 12px;
	margin-bottom: 12px;
}

.aljania-mod-user-card .aljania-chat-avatar {
	width: 38px !important;
	height: 38px !important;
}

.aljania-mod-user-details {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.aljania-mod-user-top {
	display: flex;
	align-items: center;
	gap: 7px;
	flex-wrap: wrap;
}

.aljania-mod-user-name {
	color: #ffffff;
	font-size: 13.5px;
	font-weight: 800;
	line-height: 1.2;
}

.aljania-mod-user-email {
	color: #94a3b8;
	font-size: 11.5px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.aljania-mod-reason-group {
	margin-bottom: 12px;
}

.aljania-mod-reason-group label {
	font-size: 11px !important;
	color: #94a3b8 !important;
	margin-bottom: 4px !important;
}

.aljania-mod-reason-group input.widefat {
	padding: 7px 10px !important;
	font-size: 12px !important;
}

.aljania-mod-options-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.aljania-mod-option-btn {
	width: 100%;
	background: #1a1f2e;
	border: 1px solid #2a3147;
	color: #e2e8f0;
	border-radius: 8px;
	padding: 11px 14px;
	font-size: 13px;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	transition: all 0.2s;
	text-align: left;
}

.aljania-mod-option-btn:hover {
	background: #232a3d;
	border-color: #3b4666;
}

.aljania-mod-option-btn.is-gold {
	background: rgba(251, 191, 36, 0.12);
	border-color: rgba(251, 191, 36, 0.42);
	color: #fbbf24;
}

.aljania-mod-option-btn.is-gold:hover {
	background: rgba(251, 191, 36, 0.24);
	border-color: #fbbf24;
	color: #fde68a;
}

.aljania-mod-option-btn.is-gold.is-revoke {
	background: rgba(148, 163, 184, 0.12);
	border-color: rgba(148, 163, 184, 0.35);
	color: #cbd5e1;
}

.aljania-mod-option-btn.is-gold.is-revoke:hover {
	background: rgba(251, 191, 36, 0.18);
	border-color: #fbbf24;
	color: #fbbf24;
}

.aljania-mod-option-btn.is-warn:hover {
	border-color: #fbbf24;
	color: #fbbf24;
}

.aljania-mod-option-btn.is-danger {
	background: rgba(229, 9, 20, 0.12);
	border-color: rgba(229, 9, 20, 0.35);
	color: #ff6b72;
}

.aljania-mod-option-btn.is-danger:hover {
	background: var(--metal-red);
	border-color: var(--metal-red);
	color: #ffffff;
}

/* ==========================================================================
   9. DISEÑO RESPONSIVO MÓVIL (FORMATO NATIVO WHATSAPP EN CELULAR)
   ========================================================================== */
@media (max-width: 768px) {
	.aljania-chat-wrapper {
		margin: 4px auto 10px auto;
		height: 440px;
		min-height: 390px;
		max-height: 62dvh;
		border-radius: 12px;
	}

	/* En la página dedicada /chat/ sí puede ser más alto */
	body.page:has(#aljania-metal-chat):not(.home) .aljania-chat-wrapper {
		height: calc(100dvh - 96px);
		max-height: 82dvh;
	}

	.aljania-chat-header {
		padding: 8px 10px !important;
		gap: 6px !important;
	}

	.aljania-chat-header-title {
		flex: 1 1 0% !important;
		min-width: 0 !important;
		overflow: hidden !important;
		gap: 8px !important;
	}

	.aljania-chat-title-texts {
		flex: 1 1 0% !important;
		min-width: 0 !important;
		overflow: hidden !important;
	}

	.aljania-chat-group-avatar-wrap,
	.aljania-chat-group-avatar {
		width: 34px !important;
		height: 34px !important;
		flex: 0 0 34px !important;
	}

	.aljania-chat-header-title h3 {
		font-size: 12px !important;
		display: block !important;
		width: 100% !important;
		white-space: nowrap !important;
		overflow: hidden !important;
		text-overflow: ellipsis !important;
	}

	.aljania-chat-subtitle {
		font-size: 10px !important;
		display: flex !important;
		align-items: center !important;
		width: 100% !important;
		min-width: 0 !important;
		white-space: nowrap !important;
		overflow: hidden !important;
		text-overflow: ellipsis !important;
	}

	.aljania-chat-subtitle span {
		white-space: nowrap !important;
		overflow: hidden !important;
		text-overflow: ellipsis !important;
		display: block !important;
		min-width: 0 !important;
	}

	.aljania-chat-header-actions {
		flex: 0 0 auto !important;
		display: inline-flex !important;
		align-items: center !important;
		gap: 6px !important;
		margin-left: 4px !important;
		position: relative !important;
		z-index: 5 !important;
	}

	.aljania-online-label {
		display: none !important;
	}

	.aljania-chat-online-badge,
	button#aljania-toggle-users.aljania-chat-online-badge {
		padding: 0 10px !important;
		height: 32px !important;
		min-height: 32px !important;
		max-height: 32px !important;
		width: auto !important;
		border-radius: 16px !important;
		font-size: 11.5px !important;
		line-height: 1 !important;
		display: inline-flex !important;
		align-items: center !important;
		justify-content: center !important;
		gap: 5px !important;
		background: #0d2821 !important;
		border: 1px solid rgba(52, 211, 153, 0.45) !important;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5) !important;
		white-space: nowrap !important;
		flex-shrink: 0 !important;
	}

	.aljania-chat-icon-btn,
	button#aljania-chat-sound-toggle.aljania-chat-icon-btn {
		width: 32px !important;
		height: 32px !important;
		min-width: 32px !important;
		max-width: 32px !important;
		min-height: 32px !important;
		max-height: 32px !important;
		flex: 0 0 32px !important;
	}

	.aljania-chat-user-strip {
		padding: 6px 12px;
		font-size: 11px;
	}

	.aljania-chat-avatar {
		width: 24px !important;
		height: 24px !important;
	}

	.aljania-chat-my-name {
		font-size: 11.5px;
		max-width: 130px;
	}

	.aljania-role-pill {
		font-size: 8.5px;
		padding: 2px 6px;
	}

	.aljania-chat-guest-strip {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 8px;
	}

	.aljania-chat-encryption-pill {
		font-size: 9.5px;
		padding: 3px 8px;
		margin: 5px 8px 2px 8px;
	}

	.aljania-chat-stream {
		padding: 6px 8px 10px 8px;
		gap: 4px;
	}

	.aljania-chat-bubble-wrap {
		max-width: 92%;
		gap: 5px;
	}

	.aljania-chat-bubble-avatar {
		width: 22px !important;
		height: 22px !important;
	}

	.aljania-chat-bubble {
		padding: 3px 8px !important;
	}

	.aljania-bubble-content {
		font-size: 13px;
	}

	.aljania-bubble-actions-btn {
		opacity: 0.85;
	}

	/* Drawer lateral de Conectados estilo App Móvil */
	.aljania-chat-sidebar-backdrop.is-visible {
		display: block;
		position: absolute;
		top: 0; left: 0; right: 0; bottom: 0;
		background: rgba(0, 0, 0, 0.65);
		backdrop-filter: blur(2px);
		z-index: 40;
	}

	.aljania-chat-users-sidebar {
		position: absolute;
		top: 0;
		right: 0;
		bottom: 0;
		width: 250px;
		max-width: 82%;
		z-index: 50;
		box-shadow: -10px 0 30px rgba(0, 0, 0, 0.85);
		transform: translateX(100%);
		transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
	}

	.aljania-chat-users-sidebar.is-open {
		transform: translateX(0);
	}

	.aljania-close-sidebar-btn {
		display: inline-flex;
	}

	.aljania-chat-emojis-tray,
	.aljania-chat-stickers-tray {
		left: 8px;
		right: 8px;
		bottom: 56px;
		width: auto;
	}

	.aljania-chat-footer {
		padding: 6px 8px;
	}

	.aljania-chat-input-row {
		gap: 6px;
	}

	.aljania-wa-input-pill {
		min-height: 40px;
		padding: 2px 6px;
	}

	#aljania-chat-input {
		font-size: 15.5px;
		padding: 5px 6px;
	}

	.aljania-chat-send-btn {
		width: 40px;
		height: 40px;
	}
}
