/**
 * Lemax Top reactions — Refactored & Ordered
 * Base → Layout → Components → States → Animations → Media Queries
 */

/* =========================================================
   1. BLOCK CONTAINER
========================================================= */

.lemax-top-reactions-block {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

.lemax-top-reactions-content {
	min-height: 80px;
	position: relative;
}

/* =========================================================
   2. LIST LAYOUT (Legacy / Compact)
========================================================= */

.lemax-top-reactions-wrap,
.lemax-widget-top-reactions .lemax-top-reactions-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.lemax-top-reactions-list {
	display: block;
}

.lemax-top-reactions-item {
	margin-bottom: 0.5rem;
}

.lemax-top-reactions-item a {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	text-decoration: none;
	color: inherit;
}

.lemax-top-reactions-item a:hover {
	text-decoration: underline;
}

.lemax-top-reactions-img {
	flex-shrink: 0;
	width: 50px;
	height: 50px;
	overflow: hidden;
	border-radius: 4px;
}

.lemax-top-reactions-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.lemax-top-reactions-title {
	flex: 1;
	min-width: 0;
}

.lemax-top-reactions-count {
	opacity: 0.8;
	font-size: 0.9em;
}

.lemax-top-reactions-empty {
	margin: 0;
	opacity: 0.8;
}

/* =========================================================
   3. GRID LAYOUT (Cards)
========================================================= */
.lemax-top-reactions-block {
	margin-bottom: 100px;
}
.lemax-top-reactions-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.lemax-top-reactions-card {
	background-color: #ffffff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.lemax-top-reactions-card:hover {
	transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
	transition: transform 0.3s ease, box-shadow 0.3s ease
}

.lemax-top-reactions-card-link {
	display: flex;
	flex-direction: column;
	text-decoration: none !important;
	text-decoration-style: inherit !important;
	color: inherit;
	height: 100%;
}

.lemax-top-reactions-card-img {
	position: relative;
	display: block;
	/* padding-bottom: 75%; */
	/* background: #f8f8f8; */
	overflow: hidden;
}

.lemax-top-reactions-card-img img {
	width: 100%;
	height: auto;
}

.lemax-top-reactions-card-title {
	display: block;
	padding: 10px 0;
	font-size: 1rem;
	line-height: 1.35;
	font-weight: 600;
	text-align: center;
	color: #222;
	flex: 1;
}

.lemax-top-reactions-card-count-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 0.35rem;
	padding: 0 0 10px;
	font-size: 0.875rem;
	color: #555;
	min-height: 2.5rem;
}

.lemax-top-reactions-card-count-icon {
	width: 18px;
	height: 18px;
	object-fit: contain;
	flex-shrink: 0;
}

.lemax-top-reactions-card-count {
	font-weight: 600;
	color: #333;
}

.lemax-top-reactions-card-count-label {
	color: #666;
	font-weight: 400;
}

.lemax-top-reactions-card-btn {
	display: block;
	margin: 0;
	margin-top: auto;
	padding: 0.65rem 1rem;
	text-align: center;
	background: #4a4a4a;
	color: #fff;
	font-size: 0.9rem;
	font-weight: 500;
	border-radius: 6px;
	transition: background 0.2s ease;
}

.lemax-top-reactions-card-link:hover .lemax-top-reactions-card-btn {
	background: #333;
}

/* =========================================================
   4. REACTION BREAKDOWN
========================================================= */

.lemax-top-reactions-breakdown {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.5rem 0.75rem;
}

.lemax-top-reactions-breakdown-item {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	padding: 0.2rem 0.4rem;
	background: #f1f3f5;
	border-radius: 4px;
	font-size: 0.8rem;
	color: #495057;
	white-space: nowrap;
}

.lemax-top-reactions-breakdown-icon {
	width: 16px;
	height: 16px;
	object-fit: contain;
	flex-shrink: 0;
}

.lemax-top-reactions-breakdown-num {
	font-weight: 600;
	color: #212529;
}

/* =========================================================
   5. FILTER BAR
========================================================= */

.lemax-top-reactions-filters {
	display: flex;
	align-items: center;
	gap: 20px;
	margin: 20px 0;
	background: transparent;
}

.lemax-top-reactions-filters label {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.875rem;
	font-weight: 500;
	color: #495057;
}

.lemax-top-reactions-type-wrap {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	border: 0;
}

.lemax-top-reactions-type-wrap:focus-within {
	border-color: #4a4a4a;
}

.lemax-top-reactions-type-wrap .lemax-top-reactions-type-icon {
	width: 22px;
	height: 22px;
	object-fit: contain;
	flex-shrink: 0;
}

.lemax-top-reactions-filters select {
	min-width: 130px;
	padding: 0.5rem 1.75rem 0.5rem 0.65rem;
	border: 1px solid #dee2e6;
	border-radius: 6px;
	font-size: 0.875rem;
	background: #fff;
	color: #212529;
	cursor: pointer;
	appearance: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23495057' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.6rem center;
	height: auto;
}

.lemax-top-reactions-filters select:hover {
	border-color: #adb5bd;
}

.lemax-top-reactions-filters select:focus {
	outline: none;
	box-shadow: none;
}

/* =========================================================
   6. LOADING STATE
========================================================= */

.lemax-top-reactions-content.is-loading {
	opacity: 0.6;
	pointer-events: none;
}

.lemax-top-reactions-content.is-loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 32px;
	height: 32px;
	margin: -16px 0 0 -16px;
	border: 3px solid #e0e0e0;
	border-top-color: #4a4a4a;
	border-radius: 50%;
	animation: lemax-top-spin 0.7s linear infinite;
}

/* =========================================================
   7. ANIMATIONS
========================================================= */

@keyframes lemax-top-spin {
	to {
		transform: rotate(360deg);
	}
}

/* =========================================================
   8. MEDIA QUERIES (All at Bottom)
========================================================= */

@media (max-width: 1200px) {
	.lemax-top-reactions-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 1.25rem;
	}
}

@media (max-width: 991px) {
	.lemax-top-reactions-block {
		margin-bottom: 80px;
	}
	.lemax-top-reactions-filters {
		gap: 15px;
	}
}

@media (max-width: 767px) {
	.lemax-top-reactions-filters {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}
	.lemax-top-reactions-type-wrap {
		width: 100%;
	}
	.lemax-top-reactions-filters select {
		width: 100%;
	}
	.lemax-top-reactions-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 1rem;
	}
	.lemax-top-reactions-block {
		margin-bottom: 60px;
	}
}

@media (max-width: 480px) {
	.lemax-top-reactions-block {
		margin-bottom: 40px;
	}
	.lemax-top-reactions-grid {
		grid-template-columns: 1fr;
		gap: 1rem;
	}

	.lemax-top-reactions-filters {
		gap: 0.75rem 1rem;
	}

	.lemax-top-reactions-filters label {
		flex: 0 0 auto;
	}

	.lemax-top-reactions-filters select,
	.lemax-top-reactions-type-wrap {
		min-width: 0;
		flex: 1;
	}
}