/* Contest Winners Manager Frontend CSS */

.cwm-wrapper {
	position: relative;
	font-family: inherit;
	color: #333;
}

/* Grids */
.cwm-contests-grid {
	display: grid;
	gap: 20px;
	margin-bottom: 30px;
}

.cwm-columns-1 { grid-template-columns: 1fr; }
.cwm-columns-2 { grid-template-columns: repeat(2, 1fr); }
.cwm-columns-3 { grid-template-columns: repeat(3, 1fr); }
.cwm-columns-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
	.cwm-contests-grid {
		grid-template-columns: repeat(2, 1fr) !important;
	}
}

@media (max-width: 480px) {
	.cwm-contests-grid {
		grid-template-columns: 1fr !important;
	}
}

/* Cards */
.cwm-contest-card {
	display: block;
	text-decoration: none;
	background: #fff;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
	border: 1px solid #eaeaea;
	color: inherit;
}

.cwm-contest-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1);
	border-color: #3b82f6; /* Modern Blue */
}

.cwm-contest-card.active {
	border-color: #3b82f6;
	box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.cwm-contest-image img {
	width: 100%;
	height: 180px;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.cwm-contest-card:hover .cwm-contest-image img {
	transform: scale(1.05);
}

.cwm-contest-content {
	padding: 15px;
	text-align: center;
}

.cwm-contest-content h3 {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 600;
	color: #1f2937;
}

/* Sections */
.cwm-categories-wrapper,
.cwm-winners-wrapper {
	margin-top: 30px;
	padding: 20px;
	background: #f9fafb;
	border-radius: 8px;
	border: 1px solid #f3f4f6;
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.cwm-section-title {
	margin-bottom: 20px;
	border-bottom: 2px solid #e5e7eb;
	padding-bottom: 10px;
}

.cwm-section-title h4 {
	margin: 0;
	font-size: 1.2rem;
	font-weight: 700;
	color: #1f2937;
}

/* Category Buttons */
.cwm-categories-container {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.cwm-category-btn {
	padding: 10px 20px;
	background: #fff;
	border: 1px solid #d1d5db;
	border-radius: 9999px;
	cursor: pointer;
	font-size: 0.9rem;
	font-weight: 500;
	color: #4b5563;
	transition: all 0.2s ease;
}

.cwm-category-btn:hover,
.cwm-category-btn.active {
	background: #3b82f6;
	color: #fff;
	border-color: #3b82f6;
}

/* Winners Table */
.cwm-winners-table-wrapper {
	overflow-x: auto;
}

.cwm-winners-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.cwm-winners-table th,
.cwm-winners-table td {
	padding: 14px 20px;
	text-align: left;
}

.cwm-winners-table th {
	background: #1f2937;
	color: #fff;
	font-weight: 600;
	font-size: 0.9rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.cwm-winners-table td {
	border-bottom: 1px solid #f3f4f6;
	font-size: 0.95rem;
	color: #374151;
}

.cwm-winners-table tbody tr:last-child td {
	border-bottom: none;
}

.cwm-winners-table tbody tr {
	transition: background-color 0.2s ease;
}

.cwm-winners-table tbody tr:nth-child(even) {
	background: #f9fafb;
}

.cwm-winners-table tbody tr:hover {
	background: #f3f4f6;
}

.cwm-winner-rank {
	font-weight: 700;
	color: #ef4444;
}

/* Winners List Layout */
.cwm-winners-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: 12px;
}

.cwm-winner-item {
	display: flex;
	align-items: center;
	padding: 15px 20px;
	background: #fff;
	border-radius: 8px;
	border: 1px solid #e5e7eb;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
	transition: all 0.2s ease;
}

.cwm-winner-item:hover {
	border-color: #3b82f6;
	transform: translateX(4px);
}

.cwm-winner-item .cwm-winner-rank {
	display: inline-flex;
	justify-content: center;
	align-items: center;
	min-width: 32px;
	height: 32px;
	background: #ef4444;
	color: #fff;
	border-radius: 50%;
	font-size: 0.85rem;
	font-weight: 700;
	margin-right: 15px;
}

.cwm-winner-item .cwm-winner-name {
	font-weight: 600;
	color: #1f2937;
	margin-right: 15px;
	flex-grow: 1;
}

.cwm-winner-item .cwm-winner-church {
	color: #6b7280;
	font-size: 0.9rem;
}

/* Loader CSS */
.cwm-loader {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(255, 255, 255, 0.7);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 10;
	border-radius: 8px;
}

.cwm-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid #e5e7eb;
	border-top-color: #3b82f6;
	border-radius: 50%;
	animation: cwm_spin 0.8s infinite linear;
}

@keyframes cwm_spin {
	to { transform: rotate(360deg); }
}

.cwm-hidden {
	display: none !important;
}

.cwm-no-categories,
.cwm-no-winners {
	color: #6b7280;
	font-style: italic;
	margin: 0;
}

/* Premium Filter Bar & Badges Styling */
.cwm-filter-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 20px;
	margin-bottom: 30px;
	padding: 15px 25px;
	background: #ffffff;
	border-radius: 12px;
	border: 1px solid #eaeaea;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.cwm-filter-group {
	display: flex;
	align-items: center;
	gap: 10px;
}

.cwm-filter-label {
	font-weight: 600;
	color: #374151;
	font-size: 0.95rem;
}

.cwm-year-tabs {
	display: flex;
	gap: 8px;
}

.cwm-year-tab-btn {
	padding: 8px 18px;
	background: #f3f4f6;
	border: 1px solid transparent;
	border-radius: 8px;
	font-size: 0.9rem;
	font-weight: 500;
	color: #4b5563;
	cursor: pointer;
	transition: all 0.25s ease;
}

.cwm-year-tab-btn:hover {
	background: #e5e7eb;
	color: #1f2937;
}

.cwm-year-tab-btn.active {
	background: #3b82f6;
	color: #ffffff;
	border-color: #3b82f6;
	box-shadow: 0 4px 10px rgba(59, 130, 246, 0.25);
}

.cwm-category-select {
	padding: 8px 16px;
	background: #f3f4f6;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	font-size: 0.9rem;
	color: #4b5563;
	cursor: pointer;
	outline: none;
	transition: all 0.25s ease;
}

.cwm-category-select:focus {
	border-color: #3b82f6;
	background: #ffffff;
	box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.cwm-reset-filters-btn {
	margin-left: auto;
	padding: 8px 16px;
	background: #ffffff;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 0.9rem;
	font-weight: 500;
	color: #4b5563;
	cursor: pointer;
	transition: all 0.25s ease;
}

.cwm-reset-filters-btn:hover {
	background: #f9fafb;
	color: #1f2937;
	border-color: #9ca3af;
}

.cwm-contest-card.active {
	border-color: #3b82f6;
	background: #eff6ff;
	box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.1), 0 4px 6px -2px rgba(59, 130, 246, 0.05);
}

/* Rank Badges */
.cwm-winner-rank {
	vertical-align: middle;
}

.cwm-winner-rank span {
	display: inline-flex;
	justify-content: center;
	align-items: center;
	min-width: 32px;
	height: 32px;
	padding: 0 8px;
	border-radius: 9999px;
	font-size: 0.85rem;
	font-weight: 700;
	color: #ffffff;
	background: #6b7280;
}

.cwm-winner-rank.rank-1 span {
	background: linear-gradient(135deg, #f59e0b, #d97706); /* Gold */
	box-shadow: 0 2px 6px rgba(217, 119, 6, 0.35);
}

.cwm-winner-rank.rank-2 span {
	background: linear-gradient(135deg, #9ca3af, #4b5563); /* Silver */
	box-shadow: 0 2px 6px rgba(75, 85, 99, 0.35);
}

.cwm-winner-rank.rank-3 span {
	background: linear-gradient(135deg, #b45309, #78350f); /* Bronze */
	box-shadow: 0 2px 6px rgba(120, 53, 15, 0.35);
}

/* Responsive Table Adaptations */
@media (max-width: 768px) {
	.cwm-filter-bar {
		flex-direction: column;
		align-items: stretch;
	}
	.cwm-reset-filters-btn {
		margin-left: 0;
		text-align: center;
	}
	.cwm-winners-table th:nth-child(4),
	.cwm-winners-table td:nth-child(4),
	.cwm-winners-table th:nth-child(5),
	.cwm-winners-table td:nth-child(5) {
		display: none; /* Hide Contest & Category on mobile tables to fit screens */
	}
}

/* Category Grouping in Winners list */
.cwm-category-group {
	margin-bottom: 40px;
}

.cwm-category-group:last-child {
	margin-bottom: 10px;
}

.cwm-category-group-title {
	font-size: 1.2rem;
	font-weight: 700;
	color: #1f2937;
	background: #f3f4f6;
	border-left: 4px solid #3b82f6;
	padding: 10px 16px;
	border-radius: 0 6px 6px 0;
	margin: 25px 0 15px 0;
	letter-spacing: 0.03em;
	display: inline-block;
}

