/*  cBB Reactions StyleSheet
    --------------------------------------------------------------
	Style:	All
	Copyright (c) 2025 CaniDev ( https://www.canidev.com )
    --------------------------------------------------------------
*/

.reactions-dropdown {
	z-index: 1060; /* Prevents it from hovering above the tooltip */
}

.reactions-launcher,
li.reactions-launcher {
	float: left;
}

.reactions-launcher > .reaction-button {
	align-items: center;
	background: none;
	border: none;
	box-shadow: none;
	display: flex;
	gap: 5px;
	height: 18px;
	width: auto;
	margin-left: 0;
	padding: 0;
	position: relative;
	text-shadow: none;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
}

.reactions-launcher > .reaction-button:hover {
	background: none;
	box-shadow: none;
	text-shadow: none;
}

.reactions-launcher > .reaction-button.default-icon {
	width: 20px;
}

.reactions-launcher > .default-icon img {
	filter: grayscale(1);
	opacity: .7;
}

.reactions-launcher > .default-icon:hover img {
	filter: grayscale(.3);
	opacity: .8;
}

.reactions-launcher > .reaction-button span {
	font-size: 0.85em;
	font-weight: bold;
	text-transform: none;
}




.reaction-launcher-wrapper {
	display: flex;
	list-style: none;
	position: relative;
    justify-content: center;
}

.reaction-launcher-wrapper .reactions-launcher {
	float: none;
}

.reaction-score-list:not(.empty) + .reaction-launcher-wrapper {
	margin-left: 0;
	padding-left: 0;
}

.reaction-score-list:not(.empty) + .reaction-launcher-wrapper::before {
    display: none;
}

.reaction-button img {
	height: 100%;
	width: auto;
}

.reaction-selector {
	margin: 0;
	padding: 0;
	text-align: center;
}

.reaction-selector li {
	display: inline-block;
	margin: 4px 6px 4px 4px;
}

.reaction-selector img {
	height: 32px;
	transition: transform 200ms linear;
	width: 32px;
}

.reaction-selector a:hover img {
	transform: scale(1.3);
}

.reaction-post-bar {
    align-items: flex-start;
	clear: both;
	display: flex;
	justify-content: flex-start;
	margin: 12px 0;
    margin-left: -2px;
    flex-direction: column;
}

.reaction-post-bar::after {
    content: "";
    clear: both;
    display: block;
}

.reaction-score-list {
    display: flex;
    align-items: center;
    padding: 0;
}

.reaction-score-list.empty {
	display: none;
}

.reaction-score-list:after {
	content: "";
	clear: both;
	display: block;
}

.reaction-score-list a {
	border: 2px solid transparent;
	border-radius: 50%;
	float: left;
	line-height: 1px;
    position: relative;
}

.reaction-score-list .list-scores a:not(:first-child) {
	margin-left: -8px;
}

.reaction-score-list img {
	border-radius: 50%;
	height: 14px;
	width: 14px;
}

.reaction-score-list > ul {
	list-style-type: none;
}

.reaction-score-list > ul li.reactions-launcher {
	float: none;
}

.reaction-score-list > ul li.reactions-launcher.cbb-btn {
	padding: 4px 8px;
}

.reaction-score-list .reactions-launcher > .reaction-button {
	margin: 0;
}

/* Dialog
------------------------------ */
.reactions-loading,
.reactions-loading > span {
	height: 50px;
	width: 50px;
}

.cbb-dialog .reactions-loading {
	left: 50%;
	position: absolute;
	top: 30%;
	transform: translate(-50%);
}

.cbb-dropdown .reactions-loading {
	margin: 20px auto;
}

.cbb-dropdown .reactions-loading,
.cbb-dropdown .reactions-loading > span {
	height: 35px;
	width: 35px;
}

.reactions-view-dialog .cbb-dialog-content {
	display: flex;
}

.reactions-view-list li {
	align-items: center;
	display: flex;
	font-size: 11px;
	gap: 10px;
	padding: 6px 8px;
}

.reactions-view-list img {
	height: 24px;
	max-width: 24px;
}

.reactions-view-list .tab-counter {
	font-weight: bold;
	margin-left: auto;
}

.reactions-list {
	display: flex;
    flex-direction: column;
    flex: auto;
	max-width: 100%;
}

.reactions-list .tab-header {
	border-bottom: 1px solid #efefef;
	flex: none;
    overflow-x: auto;
	white-space: nowrap;
}

.reactions-list .tab-header a {
	border-bottom: 3px solid transparent;
	box-sizing: border-box;
	display: inline-block;
	height: 38px;
	line-height: 26px;
    padding: 0 15px 8px 15px;
	text-decoration: none;
	vertical-align: bottom;
}

.reactions-list .tab-header a.active {
    border-bottom-color: blue;
}

.reactions-list .tab-header a img {
	height: 26px;
	margin-right: 2px;
	width: 26px;
}

.reactions-list .tab-header a span {
	font-size: 12px;
    vertical-align: middle;
    display: inline-block;
    font-weight: bold;
}

.reactions-list .tab-content {
	flex: auto;
	list-style-type: none;
	overflow: auto;
	padding: 0 0.5em;
}

.reactions-list .tab-header::-webkit-scrollbar,
.reactions-list .tab-content::-webkit-scrollbar {
	width: 4px;
	height: 4px;
	-webkit-appearance: none;
	background: rgba(0, 0, 0, .1);
	border-radius: 3px;
}

.reactions-list .tab-header::-webkit-scrollbar-thumb,
.reactions-list .tab-content::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, .3);
	border-radius: 3px;
}

.reactions-list .tab-content li {
	display: flex;
    flex-direction: row;
    align-items: center;
    padding: 10px 0;
}

.reaction-row-pictures {
	margin-right: 10px;
	position: relative;
}

.reaction-row-pictures .reaction-image {
	bottom: 0;
	height: 22px;
	position: absolute;
	right: 0;
    width: 20px;
}

.reaction-row-pictures .user-avatar {
	height: 40px;
	width: 40px;
}

.reaction-row-pictures .user-avatar img,
.reaction-row-pictures .user-avatar .cbb-no-avatar {
	height: 100%;
	left: 50%;
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
}

.reaction-row-info {
	flex: auto;
	width: 50%;
}

.reaction-row-info .username,
.reaction-row-info .username-coloured {
	font-size: 1.1em;
    font-weight: bold;
}

.reaction-row-info img {
	max-width: 80%;
}

.reaction-row-time {
	padding: 0 10px;
	white-space: nowrap;
}

.reaction-row-actions a.icon-only {
	font-size: 14px;
}

/* RTL
------------------------------ */
.rtl .reactions-launcher,
.rtl li.reactions-launcher,
.rtl .reaction-launcher-wrapper,
.rtl .reaction-score-list {
	float: left;
}

.rtl .reaction-score-list {
	margin-left: 0;
	margin-right: 5px;
}

.rtl .reactions-launcher > .reaction-button {
	margin-left: unset;
	margin-right: 5px;
}

.rtl .reaction-row-pictures {
	margin-left: 10px;
	margin-right: unset;
}

.rtl .reaction-row-pictures .reaction-image {
	left: 0;
	right: unset;
}

.rtl .reactions-list .tab-header a img {
	margin-left: 2px;
	margin-right: 0;
}

/* Dòng trên: icon + text tên người react */
.reaction-post-bar-top {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 4px;                 /* khoảng cách nhỏ giữa icon và text */
}

/* Dòng dưới: nút Like / launch button */
.reaction-post-bar-bottom {
    margin-top: 14px;
    padding-top: 0;
    padding-left: 0;

}

/* 1) Cho nút reaction hiển thị icon + text trên 1 dòng */
.reactions-launcher > .reaction-button.button-icon-only {
    text-indent: 0;          /* phpBB mặc định ẩn text, mở lại */
    overflow: visible;
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* 2) Khi KHÔNG có reaction (class default-icon) -> màu mặc định là vàng */
.reactions-launcher > .reaction-button.default-icon {
    color: rgba(243, 187, 20, 0.75);          /* vàng */
}

/* Tự hiện chữ Like sau icon, dùng màu kế thừa từ <a> */
.reactions-launcher > .reaction-button.default-icon::after {
    content: 'Like';
    margin-left: 4px;
    font-size: 0.9em;
    font-weight: 500;
    color: inherit;          /* ăn theo color của button */
}

/* Hover nút Like mặc định -> đổi màu cả icon + chữ sang xanh Facebook */
.reactions-launcher > .reaction-button.default-icon:hover {
    color: #1877F2;
}

/* 3) Span text khi ĐÃ react (Love, Care, Sad...) */
.reactions-launcher > .reaction-button.button-icon-only span {
    display: inline-block;
    margin-left: 0px;
    font-size: 0.9em;
    font-weight: 500;
}

/* 4) Launcher icon SVG – màu cố định theo trạng thái default-icon */
/* Mặc định: icon launch vàng #f3bb14 */
.reactions-launcher > .reaction-button.default-icon .icon {
    stroke: currentColor;
    fill: rgba(243, 187, 20, 0.75) !important;
    height: 16px;
    transition: height 0.1s ease;
}

/* Hover: icon launch xanh #1877F2 + hiệu ứng thu nhỏ nhẹ */
.reactions-launcher > .reaction-button.default-icon:hover .icon {
    fill: #1877F2 !important;
    height: 14px;
}


/* 5) Màu chữ theo loại reaction – dựa trên tên file icon trong src */

/* Like -> xanh Facebook */
.reactions-launcher img[src*="like.svg"] + span {
    color: #1877F2 !important;
}

/* Love -> hồng */
.reactions-launcher img[src*="love.svg"] + span {
    color: #ff4081 !important;
}

/* Care, Haha, Wow, Sad -> vàng */
.reactions-launcher img[src*="matter.svg"] + span,   /* Care */
.reactions-launcher img[src*="enjoy.svg"] + span,    /* Haha */
.reactions-launcher img[src*="surprise.svg"] + span, /* Wow */
.reactions-launcher img[src*="sad.svg"] + span {     /* Sad */
    color: rgba(243, 187, 20, 0.9) !important;
}

/* Angry -> cam */
.reactions-launcher img[src*="angry.svg"] + span {
    color: #ff9800 !important;
}




/* Thu nhỏ font phần "A, B và X người khác" trong thanh reactions */
.reaction-post-bar .list-label,
.reaction-post-bar .list-label a,
.reaction-post-bar .list-label span {
    font-size: 1.1em;   
    color: rgba(243, 187, 20, 0.75) !important;
}


/* Dark Theme
------------------------------ */
.dark-theme .reactions-list .tab-header {
	border-color: #444;
}

.dark-theme .reaction-launcher-wrapper:not(:first-child)::before {
	background-color: #3f3f3f;
}

/* Responsive
------------------------------ */
@media only screen and (max-width: 500px) {
	.reaction-button span,
	.reaction-row-time {
		display: none;
	}
}

@media only screen and (min-width: 700px) {
    .post .inner {
        display: flex !important;
        flex-direction: row !important;
        align-items: stretch !important;
        position: relative !important;
    }

    .postbody:not(.post_answer) {
        float: none !important;
        flex-grow: 1 !important;
        width: auto !important;
        min-width: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        order: 1 !important;
        margin-right: 10px;
    }

    .postprofile {
        order: 2 !important;
        float: none !important;
        flex-shrink: 0 !important;
        width: 200px !important;
        box-sizing: border-box;
        border-left: 1px solid rgba(243, 187, 20, 0.2);
        padding-left: 1px;
    }

    .postbody:not(.post_answer)>div[id^="post_content"] {
        display: flex !important;
        flex-direction: column !important;
        flex-grow: 1 !important;
    }

    .postbody:not(.post_answer) .reaction-post-bar {
        margin-top: auto !important;
    }

    .back2top {
        position: absolute !important;
        bottom: 10px !important;
        right: 10px !important;
    }

    .postbody h3.first {
        display: none;
    }

    .postbody .author {
        border-bottom: 1px solid #f3bb1444 !important;
        padding-bottom: 20px;
    }
    .postbody .content {
        text-align: justify !important;
        text-justify: inter-word;
        hyphens: auto;
    }

    /* Ẩn icon bài viết */
    p.author a.unread i.icon {
        display: none !important;
    }

    /* Ẩn chữ "bởi" */
    p.author span.responsive-hide {
        font-size: 0 !important;
    }

    /* Hiển thị lại tên người dùng và badge */
    p.author span.responsive-hide strong {
        font-size: 16px !important;
        /* Thay đổi kích thước chữ tên tác giả tùy ý */
    }

    .postbody .post-buttons {
        position: absolute;
        max-width: 10px !important;
        top: 20px;
        right: 0;
        margin: 0;
        padding: 0;
        list-style: none;
        display: flex !important;
        flex-direction: column !important;
        /* xếp dọc xuống, không tràn ngang */
        align-items: flex-end;
        gap: 2px;
        z-index: 4 !important;
    }

    /* Nút 3 chấm gom menu trong post-buttons (viewtopic) */
    .postbody .post-buttons li.dropdown-container>a.button.button-icon-only,
    .postbody .post-buttons li.dropdown-container>a.dropdown-trigger {
        background-color: transparent;
        /* nền đen */
        color: #fff;
        /* màu text/icon mặc định */
        border: 1px solid #f3bb1466;
        padding-right: 5px;
    }

    /* Icon 3 chấm bên trong */
    .postbody .post-buttons li.dropdown-container>a.button.button-icon-only i.icon,
    .postbody .post-buttons li.dropdown-container>a.dropdown-trigger i.icon,
    .postbody .post-buttons li.dropdown-container>a.button.button-icon-only i.fa-ellipsis-v,
    .postbody .post-buttons li.dropdown-container>a.button.button-icon-only i.fa-ellipsis-h {
        color: #f3bb14;
        /* dấu ba chấm màu trắng */
    }

    /* === Hover / focus: viền trắng, icon trắng === */
    .postbody .post-buttons li.dropdown-container>a.button.button-icon-only:hover,
    .postbody .post-buttons li.dropdown-container>a.button.button-icon-only:focus,
    .postbody .post-buttons li.dropdown-container>a.dropdown-trigger:hover,
    .postbody .post-buttons li.dropdown-container>a.dropdown-trigger:focus {
        border: 1px solid #878787;
        color: #878787;
    }

    /* Icon đổi thành vàng khi hover/focus */
    .postbody .post-buttons li.dropdown-container>a.button.button-icon-only:hover i.icon,
    .postbody .post-buttons li.dropdown-container>a.button.button-icon-only:focus i.icon,
    .postbody .post-buttons li.dropdown-container>a.dropdown-trigger:hover i.icon,
    .postbody .post-buttons li.dropdown-container>a.dropdown-trigger:focus i.icon {
        color: #878787;
    }

    /* Ẩn hoàn toàn nút Like (dùng khi nút có class fw-like) */
    .postbody .post-buttons li.fw-like,
    .postbody .post-buttons .fw-like {
        display: none;
    }

    /* ensure post has-profile is the positioning context (you may already have this) */
    .post.has-profile {
        position: relative !important;
    }

    /* Trạng thái mặc định: Viền vàng, nền đen, chữ & icon màu vàng */
    .postprofile .cbb-btn.fwbutton.follow {
        background-color: #000000 !important;
        border: 1px solid #f3bb14 !important;
        color: #f3bb14 !important;
        transition: all 0.3s ease !important;
        /* Tạo hiệu ứng chuyển màu mượt mà */
    }

    /* Đảm bảo icon và tất cả thẻ span chữ bên trong cũng ăn theo màu vàng */
    .postprofile .cbb-btn.fwbutton.follow i,
    .postprofile .cbb-btn.fwbutton.follow span {
        color: #f3bb14 !important;
        transition: all 0.3s ease !important;
    }
    .quickreply-title {
        border-bottom: 1px solid #f3bb1433 !important;
    }
    .post.has-profile.bg1 {
        border: 1px solid #f3bb1433 !important;
    }
    .post.has-profile.bg2 {
        border: 1px solid #f3bb1433 !important;
    }
    .panel:has(.quickreply-title) {
        border: 1px dotted rgba(243, 187, 20, .7);
        border-radius: 10px;
        overflow: hidden;
        margin: 15px 0;
        background: linear-gradient(to bottom, #000 0%, #111 50%, #222 100%) top / 100% 40px no-repeat, #222;
    }

}