/* ═══ Comment Tools: Emoji Picker + Image Upload ═══ */

/* Hide the original Post button when toolbar is injected */
.ck-comment-form:has(.ck-comment-tools) .ck-comment-submit,
.ck-tp-composer:has(.ck-comment-tools) #ck-tp-reply-submit {
	display: none !important;
}

/* ── Comment Form Restructure ── */
.ck-comment-form,
.ck-tp-composer {
	position: relative;
}

/* Toolbar row */
.ck-comment-tools {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 4px 8px;
	border-top: 1px solid #f0f0f5;
	margin-top: 2px;
}
.ck-ct-left {
	display: flex;
	align-items: center;
	gap: 4px;
}
.ck-ct-right {
	display: flex;
	align-items: center;
}
.ck-ct-btn {
	background: none;
	border: none;
	cursor: pointer;
	padding: 6px;
	border-radius: 8px;
	color: #9ca3af;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all .2s;
}
.ck-ct-btn:hover {
	background: #f3f4f6;
	color: #6d28d9;
}
.ck-ct-send {
	background: #fef3c7;
	border: none;
	cursor: pointer;
	padding: 8px;
	border-radius: 50%;
	color: #d97706;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all .2s;
}
.ck-ct-send:hover {
	background: #fde68a;
	color: #b45309;
}

/* Image preview inside form */
.ck-ct-img-preview {
	display: flex;
	padding: 6px 12px;
	gap: 8px;
}
.ck-ct-img-thumb {
	position: relative;
	width: 60px;
	height: 60px;
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid #e5e7eb;
}
.ck-ct-img-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.ck-ct-img-remove {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 18px;
	height: 18px;
	background: rgba(0, 0, 0, .6);
	color: #fff;
	border: none;
	border-radius: 50%;
	font-size: 10px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	line-height: 1;
}

/* ── Emoji Picker ── */
.ck-emoji-picker {
	position: absolute;
	bottom: 100%;
	left: 0;
	width: 300px;
	max-height: 340px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .06);
	z-index: 9999;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: ckEmojiIn .15s ease;
}
@keyframes ckEmojiIn {
	from { opacity: 0; transform: translateY(8px) scale(.96); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Search */
.ck-emoji-search {
	padding: 8px 10px 4px;
}
.ck-emoji-search-input {
	width: 100%;
	padding: 6px 10px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	font-size: 12px;
	outline: none;
	background: #f9fafb;
	box-sizing: border-box;
}
.ck-emoji-search-input:focus {
	border-color: #6d28d9;
	background: #fff;
}

/* Category tabs */
.ck-emoji-tabs {
	display: flex;
	padding: 0 6px;
	gap: 2px;
	border-bottom: 1px solid #f0f0f5;
}
.ck-emoji-tab {
	background: none;
	border: none;
	padding: 6px 8px;
	font-size: 16px;
	cursor: pointer;
	border-bottom: 2px solid transparent;
	border-radius: 0;
	transition: all .15s;
	opacity: .5;
}
.ck-emoji-tab:hover { opacity: .8; }
.ck-emoji-tab.active {
	opacity: 1;
	border-bottom-color: #6d28d9;
}

/* Emoji body */
.ck-emoji-body {
	flex: 1;
	overflow-y: auto;
	padding: 4px 6px 8px;
	max-height: 230px;
}
.ck-emoji-body::-webkit-scrollbar { width: 4px; }
.ck-emoji-body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

.ck-emoji-cat { display: none; }
.ck-emoji-cat.active { display: block; }

.ck-emoji-cat-title {
	font-size: 11px;
	font-weight: 600;
	color: #9ca3af;
	padding: 6px 4px 4px;
	text-transform: uppercase;
	letter-spacing: .3px;
}

.ck-emoji-grid {
	display: grid;
	grid-template-columns: repeat(8, 1fr);
	gap: 2px;
}
.ck-emoji-item {
	background: none;
	border: none;
	font-size: 22px;
	padding: 4px;
	cursor: pointer;
	border-radius: 6px;
	transition: background .12s;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}
.ck-emoji-item:hover {
	background: #f3f4f6;
	transform: scale(1.15);
}
