/**
 * Messages Module - Universal Alpha Colors
 * Works with any theme (dark, light, blue, green, etc.)
 */

.msg-module { font-size: 14px; }

/* Card */
.msg-card {
	border: 1px solid rgba(128,128,128,0.2);
	border-radius: 6px;
	margin-bottom: 15px;
	background: rgba(128,128,128,0.02);
}
.msg-card-header {
	padding: 12px 15px;
	border-bottom: 1px solid rgba(128,128,128,0.15);
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}
.msg-card-body { padding: 15px; }

/* Header elements */
.msg-header-users a { font-weight: 600; }
.msg-header-topic {
	opacity: 0.7;
	font-size: 13px;
}
.msg-arrow {
	opacity: 0.4;
	margin: 0 6px;
}

/* Tabs */
.msg-tabs { display: flex; gap: 5px; color: inherit; }
.msg-tab {
	padding: 0px 14px;
	border: 1px solid rgba(128,128,128,0.25);
	border-radius: 4px;
	background: transparent;
	cursor: pointer;
	transition: all 0.15s;
	color: inherit;
}
.msg-tab:hover { background: rgba(128,128,128,0.1); }
.msg-tab-active {
	background: rgba(128,128,128,0.15);
	font-weight: 600;
}

/* Buttons */
.msg-btn {
	display: inline-block;
	padding: 6px 9px;
	border: 1px solid rgba(128,128,128,0.3);
	border-radius: 4px;
	background: transparent;
	cursor: pointer;
	text-decoration: none;
	color: inherit;
	transition: all 0.15s;
	font-size: 13px;
}
.msg-btn:hover {
	background: rgba(128,128,128,0.1);
	text-decoration: none;
	color: inherit;
}
.msg-btn-danger { border-color: rgba(180,80,80,0.4); max-width: 30px; 
	background: darkred;}
.msg-btn-danger:hover { background: red; }
.msg-btn-unread {
	background: rgba(128,128,128,0.12);
	font-weight: 600;
}

/* Forms */
.msg-form-row {
	margin-bottom: 15px;
}
.msg-form-row label {
	display: block;
	margin-bottom: 5px;
	font-weight: 600;
	opacity: 0.85;
}
.msg-input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid rgba(128,128,128,0.25);
	border-radius: 4px;
	background: rgba(255,255,255,0.03);
	color: inherit;
	font: inherit;
	box-sizing: border-box;
}
.msg-input:focus {
	outline: none;
	border-color: rgba(128,128,128,0.45);
	background: rgba(255,255,255,0.06);
}
.msg-form-actions {
	display: flex;
	gap: 10px;
	margin-top: 20px;
}

/* Actions bar */
.msg-actions {
	display: flex;
	justify-content: space-between;
	margin-bottom: 15px;
}

/* Load more */
.msg-load-more {
	text-align: center;
	padding: 10px;
	border-bottom: 1px solid rgba(128,128,128,0.1);
	margin-bottom: 15px;
}
.msg-load-more a {
	opacity: 0.7;
	font-size: 13px;
}

/* Conversation container */
.msg-conversation {
	max-height: 450px;
	overflow-y: auto;
	padding: 10px;
	background: rgba(128,128,128,0.03);
	border-radius: 6px;
	border: 1px solid rgba(128,128,128,0.1);
}

/* Message bubbles */
.msg-bubble {
	max-width: 80%;
	margin-bottom: 12px;
	padding: 10px 14px;
	border-radius: 12px;
	border: 1px solid rgba(128,128,128,0.12);
	background: rgba(255,255,255,0.04);
}
.msg-own {
	margin-left: auto;
	background: rgba(128,128,128,0.08);
	border-bottom-right-radius: 4px;
}
.msg-other {
	margin-right: auto;
	border-bottom-left-radius: 4px;
}
.msg-bubble-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
	font-size: 12px;
}
.msg-sender { font-weight: 600; }
.msg-sender a { color: inherit; }
.msg-time { opacity: 0.5; }
.msg-bubble-body {
	line-height: 1.5;
	word-wrap: break-word;
}
.msg-bubble-body img { max-width: 100%; border-radius: 4px; }
.msg-bubble-foot {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 8px;
	font-size: 11px;
}
.msg-del {
	margin-left: auto;
	opacity: 0.3;
	font-size: 16px;
	text-decoration: none;
	color: inherit;
	transition: opacity 0.15s;
}
.msg-bubble:hover .msg-del { opacity: 0.7; }

/* Badges */
.msg-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 10px;
	font-size: 11px;
	background: rgba(128,128,128,0.15);
}
.msg-new {
	background: rgba(220,80,80,0.2);
	animation: msg-pulse 2s infinite;
}
.msg-unread { background: rgba(200,180,80,0.2); }
.msg-seen { background: rgba(80,160,80,0.2); }
.msg-deleted { background: rgba(180,80,80,0.2); }

@keyframes msg-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.6; }
}

/* Typing indicator */
.msg-typing {
	padding: 8px 0;
	font-size: 13px;
	opacity: 0.7;
}

/* Reply box */
.msg-reply { margin-top: 15px; }
.msg-reply-row {
	display: flex;
	gap: 10px;
}
.msg-reply-row .msg-input {
	flex: 1;
	resize: none;
}
.msg-reply-row .msg-btn { white-space: nowrap; }

/* Notice */
.msg-notice {
	padding: 12px;
	text-align: center;
	background: rgba(200,180,80,0.1);
	border-radius: 4px;
	margin-top: 15px;
}

/* Empty state */
.msg-empty {
	text-align: center;
	padding: 40px;
	opacity: 0.6;
}

/* Message list */
.msg-list-item {
	padding: 12px;
	border-bottom: 1px solid rgba(128,128,128,0.1);
}
.msg-list-item:last-child { border-bottom: none; }
.msg-list-item.msg-unread { background: rgba(128,128,128,0.05); }
.msg-list-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
	font-size: 13px;
}
.msg-list-users a { font-weight: 500; }
.msg-list-date { opacity: 0.5; font-size: 12px; }
.msg-list-body {
	display: flex;
	gap: 8px;
	align-items: center;
}
.msg-list-body .msg-btn { flex: 1; text-align: left; }

/* Scrollbar */
.msg-conversation::-webkit-scrollbar,
#messages_box::-webkit-scrollbar { width: 6px; }
.msg-conversation::-webkit-scrollbar-track,
#messages_box::-webkit-scrollbar-track { background: rgba(128,128,128,0.05); }
.msg-conversation::-webkit-scrollbar-thumb,
#messages_box::-webkit-scrollbar-thumb {
	background: rgba(128,128,128,0.2);
	border-radius: 3px;
}
.msg-conversation::-webkit-scrollbar-thumb:hover,
#messages_box::-webkit-scrollbar-thumb:hover { background: rgba(128,128,128,0.35); }

/* Responsive */
@media (max-width: 600px) {
	.msg-bubble { max-width: 90%; }
	.msg-card-header { flex-direction: column; align-items: flex-start; }
	.msg-reply-row { flex-direction: column; }
	.msg-reply-row .msg-btn { width: 100%; }
}