/**
 * Ultimate ushoutbox & Chatroom - Styles
 *
 * @package ushoutbox
 * @version 1.1.0
 * By: vbgamer45
 * https://www.smfhacks.com
 */

/* =========================================================================
   FamFamFam Silk Icon for menu/headers
   ========================================================================= */

.main_icons.ushoutbox {
	background: url(../images/ushoutbox/comments.png) center center no-repeat;
	background-size: 16px 16px;
}

.ushoutbox-icon {
	display: inline-block;
	width: 16px;
	height: 16px;
	vertical-align: middle;
	margin-right: 4px;
}

/* =========================================================================
   Variables (inherits SMF theme colors where possible)
   ========================================================================= */

:root {
	--ushoutbox-bg: #f5f5f5;
	--ushoutbox-header-bg: #3a5f8a;
	--ushoutbox-header-text: #fff;
	--ushoutbox-border: #ccc;
	--ushoutbox-msg-bg: #fff;
	--ushoutbox-msg-hover: #f0f4f8;
	--ushoutbox-input-bg: #fff;
	--ushoutbox-input-border: #ccc;
	--ushoutbox-text: #333;
	--ushoutbox-text-muted: #888;
	--ushoutbox-whisper-bg: #fff8e1;
	--ushoutbox-whisper-border: #f0c36d;
	--ushoutbox-action-color: #6a5acd;
	--ushoutbox-mention-color: #1a73e8;
	--ushoutbox-btn-primary: #3a5f8a;
	--ushoutbox-btn-primary-hover: #2c4a6e;
	--ushoutbox-online-dot: #4caf50;
	--ushoutbox-scrollbar-thumb: #bbb;
	--ushoutbox-scrollbar-track: #f0f0f0;
	--ushoutbox-bg-alt: #eee;
	--ushoutbox-hover: rgba(0, 0, 0, 0.06);
}

/* =========================================================================
   Widget Container
   ========================================================================= */

.ushoutbox-widget {
	margin-bottom: 12px;
	border: 1px solid var(--ushoutbox-border);
	border-radius: 6px;
	position: relative;
}

.ushoutbox-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 12px;
	background: var(--ushoutbox-header-bg);
	color: var(--ushoutbox-header-text);
	cursor: default;
	user-select: none;
	border-radius: 5px 5px 0 0;
}

.ushoutbox-title {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 6px;
	color: #fff !important;
}

.ushoutbox-title .main_icons {
	opacity: 0.9;
}

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

.ushoutbox-btn-link,
.ushoutbox-btn-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: none;
	background: transparent;
	color: var(--ushoutbox-header-text);
	cursor: pointer;
	border-radius: 4px;
	opacity: 0.8;
	transition: opacity 0.15s, background 0.15s;
	text-decoration: none;
}

.ushoutbox-btn-link:hover,
.ushoutbox-btn-icon:hover {
	opacity: 1;
	background: rgba(255, 255, 255, 0.15);
}

.ushoutbox-body {
	background: var(--ushoutbox-bg);
	transition: max-height 0.3s ease;
	overflow: hidden;
}

.ushoutbox-body.collapsed {
	max-height: 0 !important;
	padding: 0;
}

/* =========================================================================
   Messages Area
   ========================================================================= */

.ushoutbox-messages {
	height: var(--ushoutbox-widget-height, 280px);
	overflow-y: auto;
	padding: 8px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	scrollbar-width: thin;
	scrollbar-color: var(--ushoutbox-scrollbar-thumb) var(--ushoutbox-scrollbar-track);
}

.ushoutbox-messages::-webkit-scrollbar {
	width: 6px;
}

.ushoutbox-messages::-webkit-scrollbar-thumb {
	background: var(--ushoutbox-scrollbar-thumb);
	border-radius: 3px;
}

.ushoutbox-messages::-webkit-scrollbar-track {
	background: var(--ushoutbox-scrollbar-track);
}

.ushoutbox-messages-chatroom {
	height: calc(100vh - 280px);
	min-height: 400px;
}

.ushoutbox-loading {
	text-align: center;
	padding: 20px;
	color: var(--ushoutbox-text-muted);
	font-style: italic;
}

.ushoutbox-no-messages {
	text-align: center;
	padding: 30px 20px;
	color: var(--ushoutbox-text-muted);
}

/* Individual Message */

.ushoutbox-message {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 2px 8px;
	border-radius: 4px;
	transition: background 0.1s;
	position: relative;
	line-height: 1.4;
}

.ushoutbox-message:hover {
	background: var(--ushoutbox-msg-hover);
}

.ushoutbox-message-avatar {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	overflow: hidden;
}

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

.ushoutbox-message-content {
	flex: 1;
	max-width: 955px;
	font-size: 13px;
	color: var(--ushoutbox-text);
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.ushoutbox-message-author {
	font-weight: 600;
	color: inherit;
	text-decoration: none;
	margin-right: 4px;
}

.ushoutbox-message-author:hover {
	text-decoration: underline;
}

.ushoutbox-message-time {
	font-size: 11px;
	color: var(--ushoutbox-text-muted);
	margin-left: 4px;
	margin-right: 8px;
	white-space: nowrap;
}

.ushoutbox-message-edited {
	font-size: 10px;
	color: var(--ushoutbox-text-muted);
	font-style: italic;
}

/* Reaction Bar */
.ushoutbox-reactions-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: 4px;
}

.ushoutbox-reaction-pill {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	padding: 2px 6px;
	border: 1px solid var(--ushoutbox-border);
	border-radius: 12px;
	background: var(--ushoutbox-msg-bg);
	cursor: pointer;
	font-size: 11px;
	color: var(--ushoutbox-text);
	transition: background 0.15s, border-color 0.15s;
	font-family: inherit;
	line-height: 1;
}

.ushoutbox-reaction-pill:hover {
	background: var(--ushoutbox-msg-hover);
	border-color: #aaa;
}

.ushoutbox-reaction-pill.reacted {
	border-color: var(--ushoutbox-btn-primary);
	background: rgba(58, 95, 138, 0.08);
}

.ushoutbox-reaction-pill img {
	width: 14px;
	height: 14px;
	vertical-align: middle;
}

.reaction-count {
	font-weight: 600;
	font-size: 11px;
}

/* React Popup */
.ushoutbox-react-popup {
	position: absolute;
	display: flex;
	gap: 2px;
	padding: 6px 8px;
	background: var(--ushoutbox-msg-bg);
	border: 1px solid var(--ushoutbox-border);
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
	z-index: 10001;
}

.ushoutbox-react-popup-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border: none;
	background: transparent;
	border-radius: 4px;
	cursor: pointer;
	transition: transform 0.1s, background 0.1s;
	padding: 0;
}

.ushoutbox-react-popup-btn:hover {
	background: var(--ushoutbox-msg-hover);
	transform: scale(1.2);
}

.ushoutbox-react-popup-btn img {
	width: 16px;
	height: 16px;
}

.ushoutbox-message-body {
	display: inline;
}

.ushoutbox-message-body img.bbc_img {
	max-width: 250px;
	max-height: 200px;
	border-radius: 4px;
	display: block;
	margin: 4px 0;
}

.ushoutbox-message-body img {
	max-width: 250px;
	max-height: 200px;
	vertical-align: middle;
}

/* Inline quote styling */
.ushoutbox-inline-quote {
	display: block;
	border-left: 3px solid var(--ushoutbox-border);
	padding: 3px 8px;
	margin: 3px 0;
	background: var(--ushoutbox-bg-alt);
	border-radius: 0 4px 4px 0;
	font-size: 12px;
	line-height: 1.4;
}

.ushoutbox-quote-author {
	font-weight: 600;
	color: var(--ushoutbox-mention-color);
}

.ushoutbox-quote-text {
	color: var(--ushoutbox-text-muted);
	font-style: italic;
}

/* Whisper message styling */
.ushoutbox-message-whisper {
	background: var(--ushoutbox-whisper-bg);
	border-left: 3px solid var(--ushoutbox-whisper-border);
}

.ushoutbox-message-whisper:hover {
	background: #fff3cd;
}

.ushoutbox-whisper-badge {
	display: inline-block;
	padding: 1px 6px;
	font-size: 10px;
	font-weight: 600;
	background: var(--ushoutbox-whisper-border);
	color: #7a5d00;
	border-radius: 10px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-left: 4px;
	vertical-align: middle;
}

/* Admin message (/admin, /a) */
.ushoutbox-message-admin {
	background: #f3e8ff;
	border-left: 3px solid #9b59b6;
}

.ushoutbox-message-admin:hover {
	background: #eddcff;
}

.ushoutbox-admin-badge {
	display: inline-block;
	padding: 1px 6px;
	font-size: 10px;
	font-weight: 600;
	background: #9b59b6;
	color: #fff;
	border-radius: 10px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-left: 4px;
	vertical-align: middle;
}

/* Mutelist system message (local-only, not stored in DB) */
.ushoutbox-system-message {
	padding: 8px 12px;
	margin: 4px 0;
	background: var(--ushoutbox-msg-hover);
	border-radius: 4px;
	font-size: 12px;
	color: var(--ushoutbox-text-muted);
	line-height: 1.5;
}

.ushoutbox-system-message strong {
	color: var(--ushoutbox-text);
}

/* Action message (/me) */
.ushoutbox-message-action {
	font-style: italic;
	color: var(--ushoutbox-action-color);
}

.ushoutbox-message-action .ushoutbox-message-author {
	color: var(--ushoutbox-action-color);
}

/* Mention highlight */
.ushoutbox-mention {
	color: var(--ushoutbox-mention-color);
	font-weight: 600;
	cursor: pointer;
}

.ushoutbox-mention-self {
	background: rgba(26, 115, 232, 0.1);
	padding: 0 2px;
	border-radius: 2px;
}

/* Message actions (shown on hover) */
.ushoutbox-message-actions {
	position: absolute;
	right: 4px;
	top: 4px;
	display: none;
	gap: 2px;
}

.ushoutbox-message:hover .ushoutbox-message-actions {
	display: flex;
}

.ushoutbox-msg-action-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border: none;
	background: rgba(0, 0, 0, 0.06);
	color: var(--ushoutbox-text-muted);
	cursor: pointer;
	border-radius: 3px;
	font-size: 11px;
	transition: background 0.1s, color 0.1s;
}

.ushoutbox-msg-action-btn:hover {
	background: rgba(0, 0, 0, 0.12);
	color: var(--ushoutbox-text);
}

/* =========================================================================
   Input Area
   ========================================================================= */

.ushoutbox-input-area {
	display: flex;
	align-items: flex-end;
	gap: 6px;
	padding: 8px;
	background: var(--ushoutbox-msg-bg);
	border-top: 1px solid var(--ushoutbox-border);
}

.ushoutbox-input-wrapper {
	flex: 1;
	position: relative;
}

.ushoutbox-input {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--ushoutbox-input-border);
	border-radius: 6px;
	background: var(--ushoutbox-input-bg);
	color: var(--ushoutbox-text);
	font-size: 13px;
	font-family: inherit;
	resize: none;
	overflow: hidden;
	line-height: 1.4;
	box-sizing: border-box;
	transition: border-color 0.15s;
}

.ushoutbox-input:focus {
	outline: none;
	border-color: var(--ushoutbox-btn-primary);
	box-shadow: 0 0 0 2px rgba(58, 95, 138, 0.15);
}

.ushoutbox-char-count {
	position: absolute;
	right: 8px;
	bottom: 6px;
	font-size: 10px;
	color: var(--ushoutbox-text-muted);
	pointer-events: none;
}

.ushoutbox-char-count.warning {
	color: #e65100;
}

.ushoutbox-char-count.danger {
	color: #d32f2f;
	font-weight: 600;
}

.ushoutbox-input-buttons {
	display: flex;
	gap: 4px;
	flex-shrink: 0;
}

.ushoutbox-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 6px 12px;
	border: 1px solid var(--ushoutbox-input-border);
	border-radius: 6px;
	background: var(--ushoutbox-msg-bg);
	color: var(--ushoutbox-text);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
	white-space: nowrap;
}

.ushoutbox-btn:hover {
	background: var(--ushoutbox-msg-hover);
	border-color: #aaa;
}

.ushoutbox-btn-primary {
	background: var(--ushoutbox-btn-primary);
	color: #fff;
	border-color: var(--ushoutbox-btn-primary);
}

.ushoutbox-btn-primary:hover {
	background: var(--ushoutbox-btn-primary-hover);
	border-color: var(--ushoutbox-btn-primary-hover);
}

.ushoutbox-guest-notice {
	padding: 10px;
	text-align: center;
	color: var(--ushoutbox-text-muted);
	font-size: 13px;
	background: var(--ushoutbox-msg-bg);
	border-top: 1px solid var(--ushoutbox-border);
}

/* =========================================================================
   Chatroom Layout
   ========================================================================= */

.ushoutbox-chatroom {
	margin: 0;
}

.ushoutbox-chatroom-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
	padding: 12px 16px;
	background: var(--ushoutbox-header-bg);
	color: var(--ushoutbox-header-text);
	border-radius: 6px 6px 0 0;
}

.ushoutbox-chatroom-title {
	margin: 0;
	font-size: 18px;
	display: flex;
	align-items: center;
	gap: 8px;
	color: #fff !important;
}

.ushoutbox-chatroom-actions {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	align-items: stretch;
}

.ushoutbox-chatroom-actions .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	padding: 6px 14px;
	min-height: 30px;
	line-height: 1;
	box-sizing: border-box;
	white-space: nowrap;
	text-decoration: none;
	vertical-align: middle;
}

/* Room Tabs */

.ushoutbox-room-tabs {
	display: flex;
	overflow-x: auto;
	background: var(--ushoutbox-msg-bg);
	border: 1px solid var(--ushoutbox-border);
	border-top: none;
	padding: 0 8px;
	gap: 0;
	scrollbar-width: thin;
}

.ushoutbox-room-tabs::-webkit-scrollbar {
	height: 3px;
}

.ushoutbox-room-tabs::-webkit-scrollbar-thumb {
	background: var(--ushoutbox-scrollbar-thumb);
	border-radius: 3px;
}

.ushoutbox-room-tab {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 10px 16px;
	border: none;
	border-bottom: 2px solid transparent;
	background: transparent;
	color: var(--ushoutbox-text-muted);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	white-space: nowrap;
	transition: color 0.15s, border-color 0.15s, background 0.15s;
	font-family: inherit;
}

.ushoutbox-room-tab:hover {
	color: var(--ushoutbox-text);
	background: var(--ushoutbox-msg-hover);
}

.ushoutbox-room-tab.active {
	color: var(--ushoutbox-btn-primary);
	border-bottom-color: var(--ushoutbox-btn-primary);
	font-weight: 600;
}

.ushoutbox-room-lock {
	font-size: 11px;
	opacity: 0.7;
}

.ushoutbox-chatroom-layout {
	display: flex;
	gap: 0;
	border: 1px solid var(--ushoutbox-border);
	border-top: none;
	border-radius: 0 0 6px 6px;
	overflow: hidden;
}

.ushoutbox-chatroom-main {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.ushoutbox-chatroom-sidebar {
	width: 220px;
	flex-shrink: 0;
	background: var(--ushoutbox-msg-bg);
	border-left: 1px solid var(--ushoutbox-border);
	overflow-y: auto;
}

.ushoutbox-sidebar-section {
	padding: 12px;
}

.ushoutbox-sidebar-section h4 {
	margin: 0 0 10px;
	font-size: 13px;
	color: var(--ushoutbox-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.ushoutbox-input-area-chatroom {
	border-radius: 0;
}

.ushoutbox-input-area-chatroom .ushoutbox-btn {
	padding: 8px 16px;
	min-height: 34px;
	font-size: 13px;
}

/* Online Users */

.ushoutbox-online-users {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ushoutbox-online-user {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px 0;
}

.ushoutbox-online-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--ushoutbox-online-dot);
	flex-shrink: 0;
}

.ushoutbox-online-user a {
	font-size: 13px;
	color: var(--ushoutbox-text);
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ushoutbox-online-user a:hover {
	text-decoration: underline;
}

.ushoutbox-online-count {
	font-size: 12px;
	color: var(--ushoutbox-text-muted);
	padding-top: 6px;
	border-top: 1px solid var(--ushoutbox-border);
	margin-top: 4px;
}

/* =========================================================================
   File Upload
   ========================================================================= */

.ushoutbox-btn-uploading {
	animation: ushoutbox-pulse 1s ease-in-out infinite;
	pointer-events: none;
}

@keyframes ushoutbox-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.4; }
}

.ushoutbox-drop-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(58, 95, 138, 0.85);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	font-weight: 600;
	z-index: 1000;
	border-radius: 6px;
	pointer-events: none;
}

/* =========================================================================
   GIF Picker
   ========================================================================= */

.ushoutbox-gif-picker {
	position: fixed;
	width: 360px;
	max-height: 420px;
	background: var(--ushoutbox-msg-bg);
	border: 1px solid var(--ushoutbox-border);
	border-radius: 8px;
	z-index: 1000;
	display: flex;
	flex-direction: column;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.gif-picker-header {
	display: flex;
	padding: 8px;
	gap: 6px;
	border-bottom: 1px solid var(--ushoutbox-border);
	flex-shrink: 0;
}

.gif-search-input {
	flex: 1;
	padding: 6px 10px;
	border: 1px solid var(--ushoutbox-input-border);
	border-radius: 4px;
	background: var(--ushoutbox-input-bg);
	color: var(--ushoutbox-text);
	font-size: 13px;
}

.gif-search-input:focus {
	outline: none;
	border-color: var(--ushoutbox-btn-primary);
}

.gif-close-btn {
	background: none;
	border: none;
	color: var(--ushoutbox-text-muted);
	font-size: 20px;
	cursor: pointer;
	padding: 0 6px;
	line-height: 1;
}

.gif-close-btn:hover {
	color: var(--ushoutbox-text);
}

.gif-results {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 4px;
	padding: 4px;
	overflow-y: auto;
	flex: 1;
	min-height: 0;
	scrollbar-width: thin;
}

.gif-results img {
	width: 100%;
	height: 120px;
	object-fit: cover;
	border-radius: 4px;
	cursor: pointer;
	transition: transform 0.1s, outline-color 0.1s;
	outline: 2px solid transparent;
}

.gif-results img:hover {
	transform: scale(1.03);
	outline-color: var(--ushoutbox-btn-primary);
}

.gif-loading {
	text-align: center;
	padding: 16px;
	color: var(--ushoutbox-text-muted);
	font-size: 13px;
	flex-shrink: 0;
}

.gif-attribution {
	text-align: center;
	padding: 4px;
	font-size: 10px;
	color: var(--ushoutbox-text-muted);
	border-top: 1px solid var(--ushoutbox-border);
	flex-shrink: 0;
}

.gif-no-results {
	text-align: center;
	padding: 30px 20px;
	color: var(--ushoutbox-text-muted);
}

/* =========================================================================
   BBCode Toolbar
   ========================================================================= */

.ushoutbox-bbc-toolbar {
	display: flex;
	gap: 2px;
	padding: 4px 6px;
	border-bottom: 1px solid var(--ushoutbox-border);
	background: var(--ushoutbox-bg-alt);
}

.ushoutbox-bbc-btn {
	background: transparent;
	border: 1px solid var(--ushoutbox-border);
	border-radius: 3px;
	padding: 2px 8px;
	cursor: pointer;
	font-size: 12px;
	color: var(--ushoutbox-text);
	min-width: 28px;
	line-height: 1.4;
	font-family: inherit;
	transition: background 0.1s;
}

.ushoutbox-bbc-btn:hover {
	background: var(--ushoutbox-hover);
}

/* =========================================================================
   Smiley Picker Popup
   ========================================================================= */

.ushoutbox-smiley-picker {
 /*position: fixed;*/
 z-index: 10000;
 background: var(--ushoutbox-msg-bg);
 border: 1px solid var(--ushoutbox-border);
 border-radius: 6px;
 box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
 padding: 8px;
 /*max-width: 280px;*/
	max-height: 200px;
	overflow-y: auto;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	scrollbar-width: thin;
	scrollbar-color: var(--ushoutbox-scrollbar-thumb) var(--ushoutbox-scrollbar-track);
}

.ushoutbox-smiley-picker img {
	cursor: pointer;
	padding: 2px;
	border-radius: 3px;
 /*width: 20px;*/
	height: 20px;
	transition: background 0.1s;
}

.ushoutbox-smiley-picker img:hover {
	background: var(--ushoutbox-hover);
}

/* =========================================================================
   Mention Dropdown
   ========================================================================= */

.ushoutbox-mention-dropdown {
	position: absolute;
	background: var(--ushoutbox-msg-bg);
	border: 1px solid var(--ushoutbox-border);
	border-radius: 6px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
	z-index: 1001;
	max-height: 200px;
	overflow-y: auto;
	min-width: 180px;
}

.ushoutbox-mention-item {
	padding: 6px 12px;
	cursor: pointer;
	font-size: 13px;
	display: flex;
	align-items: center;
	gap: 8px;
	transition: background 0.1s;
}

.ushoutbox-mention-item:hover,
.ushoutbox-mention-item.active {
	background: var(--ushoutbox-msg-hover);
}

.ushoutbox-mention-item img {
	width: 24px;
	height: 24px;
	border-radius: 50%;
}

/* =========================================================================
   Command Autocomplete
   ========================================================================= */

.ushoutbox-command-item {
	padding: 8px 12px;
	cursor: pointer;
	transition: background 0.1s;
}

.ushoutbox-command-item:hover,
.ushoutbox-command-item.active {
	background: var(--ushoutbox-msg-hover);
}

.ushoutbox-command-name {
	font-weight: 600;
	font-size: 13px;
	color: var(--ushoutbox-text);
}

.ushoutbox-command-desc {
	font-size: 11px;
	color: var(--ushoutbox-text-muted);
	margin-top: 2px;
}

/* =========================================================================
   Context Menu
   ========================================================================= */

.ushoutbox-context-menu {
	position: fixed;
	background: var(--ushoutbox-msg-bg);
	border: 1px solid var(--ushoutbox-border);
	border-radius: 6px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
	z-index: 1002;
	min-width: 150px;
	padding: 4px 0;
}

.ushoutbox-context-item {
	padding: 8px 16px;
	cursor: pointer;
	font-size: 13px;
	display: flex;
	align-items: center;
	gap: 8px;
	transition: background 0.1s;
	border: none;
	background: none;
	width: 100%;
	text-align: left;
	color: var(--ushoutbox-text);
}

.ushoutbox-context-item:hover {
	background: var(--ushoutbox-msg-hover);
}

.ushoutbox-context-item.danger {
	color: #d32f2f;
}

.ushoutbox-context-item.danger:hover {
	background: #ffebee;
}

.ushoutbox-context-separator {
	height: 1px;
	background: var(--ushoutbox-border);
	margin: 4px 0;
}

/* =========================================================================
   Inline Edit
   ========================================================================= */

.ushoutbox-inline-edit {
	display: flex;
	align-items: center;
	gap: 4px;
	margin-top: 4px;
}

.ushoutbox-inline-edit input {
	flex: 1;
	padding: 4px 8px;
	border: 1px solid var(--ushoutbox-btn-primary);
	border-radius: 4px;
	font-size: 12px;
	background: var(--ushoutbox-input-bg);
	color: var(--ushoutbox-text);
}

.ushoutbox-inline-edit button {
	padding: 4px 10px;
	font-size: 11px;
	border: none;
	border-radius: 4px;
	cursor: pointer;
}

.ushoutbox-inline-edit .save-btn {
	background: var(--ushoutbox-btn-primary);
	color: #fff;
}

.ushoutbox-inline-edit .cancel-btn {
	background: var(--ushoutbox-border);
	color: var(--ushoutbox-text);
}

/* =========================================================================
   History Page
   ========================================================================= */

.ushoutbox-history {
	margin: 0;
}

.ushoutbox-history-filters {
	padding: 12px 0;
}

.ushoutbox-filter-row {
	display: flex;
	align-items: flex-end;
	gap: 12px;
	flex-wrap: wrap;
}

.ushoutbox-filter-group {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.ushoutbox-filter-group label {
	font-size: 12px;
	font-weight: 600;
	color: var(--ushoutbox-text-muted);
}

.ushoutbox-filter-group input {
	padding: 6px 10px;
	border: 1px solid var(--ushoutbox-input-border);
	border-radius: 4px;
	font-size: 13px;
}

.ushoutbox-filter-actions {
	display: flex;
	gap: 6px;
}

.ushoutbox-export-actions {
	display: flex;
	gap: 6px;
	margin-top: 8px;
}

.ushoutbox-history-messages {
	padding: 0;
}

.ushoutbox-history-message {
	padding: 10px 16px;
	border-bottom: 1px solid var(--ushoutbox-border);
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.ushoutbox-history-message:last-child {
	border-bottom: none;
}

.ushoutbox-history-message.ushoutbox-whisper {
	background: var(--ushoutbox-whisper-bg);
	border-left: 3px solid var(--ushoutbox-whisper-border);
}

.ushoutbox-history-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
}

.ushoutbox-history-time {
	color: var(--ushoutbox-text-muted);
	white-space: nowrap;
}

.ushoutbox-history-author {
	font-weight: 600;
	color: inherit;
	text-decoration: none;
}

.ushoutbox-history-author:hover {
	text-decoration: underline;
}

.ushoutbox-history-body {
	font-size: 13px;
	color: var(--ushoutbox-text);
	word-wrap: break-word;
}

.ushoutbox-history-body img {
	max-width: 200px;
	max-height: 150px;
}

.ushoutbox-no-results {
	text-align: center;
	padding: 30px;
	color: var(--ushoutbox-text-muted);
}

/* =========================================================================
   Notification Badge
   ========================================================================= */

.ushoutbox-unread-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	background: #d32f2f;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	border-radius: 10px;
	position: absolute;
	top: -4px;
	right: -4px;
}

/* =========================================================================
   Responsive Design
   ========================================================================= */

@media (max-width: 768px) {
	.ushoutbox-room-tab {
		padding: 8px 12px;
		font-size: 12px;
	}

	.ushoutbox-chatroom-layout {
		flex-direction: column;
	}

	.ushoutbox-chatroom-sidebar {
		width: 100%;
		border-left: none;
		border-top: 1px solid var(--ushoutbox-border);
		max-height: 200px;
		overflow-y: auto;
	}

	.ushoutbox-online-users {
		flex-direction: row;
		flex-wrap: wrap;
	}

	.ushoutbox-online-user {
		padding: 2px 4px;
	}

	.ushoutbox-messages-chatroom {
		height: 50vh;
		min-height: 300px;
	}

	.ushoutbox-chatroom-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.ushoutbox-gif-picker {
		width: 300px;
		max-height: 360px;
	}

	.ushoutbox-filter-row {
		flex-direction: column;
		align-items: stretch;
	}

	.ushoutbox-filter-group {
		width: 100%;
	}

	.ushoutbox-filter-group input {
		width: 100%;
	}
}

@media (max-width: 480px) {
	.ushoutbox-messages {
		height: 200px;
	}

	.ushoutbox-message-avatar {
		width: 22px;
		height: 22px;
	}

	.ushoutbox-message-content {
		font-size: 12px;
	}

	.ushoutbox-input {
		font-size: 14px; /* prevent zoom on iOS */
	}

	.ushoutbox-gif-picker {
		width: calc(100vw - 20px);
	}

	.ushoutbox-reaction-pill {
		padding: 1px 4px;
		font-size: 10px;
		gap: 2px;
	}

	.ushoutbox-reaction-pill img {
		width: 12px;
		height: 12px;
	}

	.reaction-count {
		font-size: 10px;
	}

	.ushoutbox-bbc-btn {
		padding: 2px 6px;
		font-size: 11px;
		min-width: 24px;
	}

	.ushoutbox-smiley-picker {
		max-width: 240px;
	}
}

/* =========================================================================
   Dark Theme Support
   SMF 2.1 doesn't have native dark mode, but many custom themes do.
   We detect via common patterns.
   ========================================================================= */

@media (prefers-color-scheme: dark) {
	:root {
		--ushoutbox-bg: #1e1e2e;
		--ushoutbox-header-bg: #2d3748;
		--ushoutbox-header-text: #e2e8f0;
		--ushoutbox-border: #4a5568;
		--ushoutbox-msg-bg: #2d2d3e;
		--ushoutbox-msg-hover: #3a3a4e;
		--ushoutbox-input-bg: #2d2d3e;
		--ushoutbox-input-border: #4a5568;
		--ushoutbox-text: #e2e8f0;
		--ushoutbox-text-muted: #a0aec0;
		--ushoutbox-whisper-bg: #3d3520;
		--ushoutbox-whisper-border: #d69e2e;
		--ushoutbox-scrollbar-thumb: #4a5568;
		--ushoutbox-scrollbar-track: #1e1e2e;
		--ushoutbox-bg-alt: #252538;
		--ushoutbox-hover: rgba(255, 255, 255, 0.08);
	}

	.ushoutbox-context-item.danger:hover {
		background: #4a2020;
	}

	.ushoutbox-reaction-pill.reacted {
		background: rgba(58, 95, 138, 0.2);
	}

	.ushoutbox-message-admin {
		background: #2d1f3d;
		border-left-color: #7c3aed;
	}

	.ushoutbox-message-admin:hover {
		background: #362548;
	}

	.ushoutbox-admin-badge {
		background: #7c3aed;
	}
}

/* Support for themes that use a .dark-theme or similar class */
body.dark-theme,
body[data-theme="dark"],
.dark_mode {
	--ushoutbox-bg: #1e1e2e;
	--ushoutbox-header-bg: #2d3748;
	--ushoutbox-header-text: #e2e8f0;
	--ushoutbox-border: #4a5568;
	--ushoutbox-msg-bg: #2d2d3e;
	--ushoutbox-msg-hover: #3a3a4e;
	--ushoutbox-input-bg: #2d2d3e;
	--ushoutbox-input-border: #4a5568;
	--ushoutbox-text: #e2e8f0;
	--ushoutbox-text-muted: #a0aec0;
	--ushoutbox-whisper-bg: #3d3520;
	--ushoutbox-whisper-border: #d69e2e;
	--ushoutbox-scrollbar-thumb: #4a5568;
	--ushoutbox-scrollbar-track: #1e1e2e;
	--ushoutbox-bg-alt: #252538;
	--ushoutbox-hover: rgba(255, 255, 255, 0.08);
}

body.dark-theme .ushoutbox-reaction-pill.reacted,
body[data-theme="dark"] .ushoutbox-reaction-pill.reacted,
.dark_mode .ushoutbox-reaction-pill.reacted {
	background: rgba(58, 95, 138, 0.2);
}

body.dark-theme .ushoutbox-message-admin,
body[data-theme="dark"] .ushoutbox-message-admin,
.dark_mode .ushoutbox-message-admin {
	background: #2d1f3d;
	border-left-color: #7c3aed;
}

body.dark-theme .ushoutbox-message-admin:hover,
body[data-theme="dark"] .ushoutbox-message-admin:hover,
.dark_mode .ushoutbox-message-admin:hover {
	background: #362548;
}

body.dark-theme .ushoutbox-admin-badge,
body[data-theme="dark"] .ushoutbox-admin-badge,
.dark_mode .ushoutbox-admin-badge {
	background: #7c3aed;
}

/* =========================================================================
   Print Styles
   ========================================================================= */

@media print {
	.ushoutbox-widget,
	.ushoutbox-chatroom {
		display: none !important;
	}
}