/**
 * Match Prediction Widget Styles
 */

.pl-match-widget {
	/* Default background fallback */
	background: var(--theme-palette-color-5);
	/* Dynamic gradient based on team logos */
	/* background: 
		radial-gradient(250px at 0% 0%, var(--pl-home-color, rgba(199, 1, 1, 0.2)) 0%, rgba(47, 47, 47, 0) 70%),
		radial-gradient(250px at 100% 0%, var(--pl-away-color, rgba(20, 20, 19, 0.2)) 0%, rgba(47, 47, 47, 0) 70%),
		rgb(47, 47, 47); */
	border: none;
	border-radius: 12px;
	padding: 20px;

	box-shadow: 0 4px 12px rgba(0,0,0,0.3);
	color: var(--theme-palette-color-3);
	position: relative;
	overflow: hidden;
}

.pl-widget-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 20px;
	font-size: 0.9em;
	color: #999;
	position: relative;
}

.pl-widget-header-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.pl-widget-header-left {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1;
}

.pl-widget-competition-info {
	display: flex;
	align-items: center;
	gap: 6px;
}

.pl-widget-competition-logo {
	width: 20px;
	height: 20px;
	object-fit: contain;
	flex-shrink: 0;
	border-radius: 4px;
}

.pl-widget-competition-name {
	font-weight: 600;
	color: var(--theme-palette-color-3);
	font-size: 0.9em;
}

.pl-widget-separator-dot {
	color: #666;
}

.pl-widget-date {
	color: #999;
}

.pl-prediction-status {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 12px;
	font-size: 0.85em;
}

.pl-prediction-saved {
	color: #28a745;
	background: #d4edda;
	border: 1px solid #c3e6cb;
}

.pl-match-widget.pl-has-prediction {
	/* border-color: #28a745;
	box-shadow: 0 2px 8px rgba(40, 167, 69, 0.15); */
}

.pl-match-widget.pl-saved {
	/* border-color: #28a745;
	box-shadow: 0 4px 12px rgba(40, 167, 69, 0.25); */
	animation: pl-save-pulse 0.5s ease-out;
}

@keyframes pl-save-pulse {
	0% {
		box-shadow: 0 2px 8px rgba(40, 167, 69, 0.15);
	}
	50% {
		box-shadow: 0 4px 16px rgba(40, 167, 69, 0.4);
	}
	100% {
		box-shadow: 0 2px 8px rgba(40, 167, 69, 0.15);
	}
}

.pl-widget-success-message {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
	border-radius: 6px;
	padding: 8px 12px;
	margin-top: 10px;
	font-weight: 600;
	font-size: 0.85em;
	text-align: center;
	animation: pl-fade-in 0.3s ease-in;
}

@keyframes pl-fade-in {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.pl-saved-btn {
	background: #28a745 !important;
	color: #fff !important;
	border-color: #28a745 !important;
	animation: pl-button-success 0.3s ease-out;
}

@keyframes pl-button-success {
	0% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.05);
	}
	100% {
		transform: scale(1);
	}
}

.pl-widget-match-info {
	margin-bottom: 12px;
}

.pl-widget-teams {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 20px;
}

.pl-widget-team {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 1;
	gap: 8px;
}

.pl-widget-team-home {
	align-items: flex-start;
}

.pl-widget-team-away {
	align-items: flex-end;
}

.pl-widget-logo {
	width: 48px;
	height: 48px;
	object-fit: contain;
	flex-shrink: 0;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.1);
	padding: 4px;
}

.pl-team-logo-placeholder {
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.1);
	font-size: 1.5em;
	font-weight: 700;
	color: #fff;
}

.pl-widget-team-info {
	display: flex;
	flex-direction: column;
	align-items: inherit;
	gap: 4px;
}

.pl-widget-team-name {
	font-weight: 600;
	font-size: 1em;
	color: var(--theme-palette-color-3);
	text-align: center;
}

.pl-widget-win-probability {
	font-size: 0.85em;
	color: #999;
	font-weight: 500;
}

.pl-widget-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.75em;
	color: #888;
	margin-top: 4px;
}

.pl-widget-competition {
	color: #0073aa;
	text-decoration: none;
	transition: color 0.2s;
}

.pl-widget-competition:hover {
	color: #005a87;
	text-decoration: underline;
}

.pl-widget-markets-row {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
	margin-bottom: 10px;
}

.pl-widget-market {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.pl-widget-market-label {
	display: flex;
	flex-direction: column;
	gap: 1px;
	margin-bottom: 5px;
}

.pl-widget-market-title {
	font-size: 0.75em;
	font-weight: 600;
	color: var(--theme-palette-color-3);
	line-height: 1.2;
}

.pl-widget-market-subtitle {
	font-size: 0.65em;
	font-weight: 500;
	color: #888;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.pl-widget-market-buttons {
	display: flex;
	gap: 4px;
}

.pl-widget-market-btn {
    flex: 1;
    padding: 6px 4px;
    border: 1.5px solid var(--theme-palette-color-8);
    background: var(--theme-palette-color-6);
    color: var(--theme-palette-color-3);
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: .8em;
    transition: all .2s;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 48px;
}

.pl-widget-market-btn:hover {
	border-color: #0073aa;
	background: var(--theme-palette-color-7);
	transform: translateY(-1px);
}

.pl-widget-market-btn.active {
	background: #0073aa;
	color: #fff;
	border-color: #0073aa;
	box-shadow: 0 2px 4px rgba(0,115,170,0.3);
}

.pl-widget-market-btn .pl-btn-label {
	font-size: 0.7em;
	font-weight: 500;
	line-height: 1.2;
	display: block;
}

.pl-widget-market-btn .pl-btn-value {
	font-size: 1em;
	font-weight: 700;
	line-height: 1;
	display: block;
}

.pl-widget-market-btn.active .pl-btn-label,
.pl-widget-market-btn.active .pl-btn-value {
	color: #fff;
}

.pl-widget-score-section {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	position: relative;
}

.pl-widget-score-control {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
}

.pl-widget-score-btn {
	width: 32px;
	height: 32px;
	border: 1px solid var(--theme-palette-color-8);
	background: var(--theme-palette-color-6);
	color: var(--theme-palette-color-3);
	border-radius: 6px;
	cursor: pointer;
	font-size: 1.2em;
	font-weight: 600;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s;
	user-select: none;
}

.pl-widget-score-btn:hover {
	background: var(--theme-palette-color-7);
	border-color: var(--theme-palette-color-8);
}

.pl-widget-score-btn:active {
	transform: scale(0.95);
}

input.pl-widget-score {
	width: 50px;
	padding: 8px 4px;
	text-align: center;
	border: 1px solid var(--theme-palette-color-8);
	border-radius: 8px;
	font-size: 1.2em;
	font-weight: 700;
	background: var(--theme-palette-color-6);
	/* color: #fff; */
	transition: all 0.2s;
	-moz-appearance: textfield;
}

.pl-widget-score::-webkit-outer-spin-button,
.pl-widget-score::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.pl-widget-score:focus {
	outline: none;
	border-color: #4CAF50;
	background: rgba(76, 175, 80, 0.1);
	box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.pl-widget-separator {
	font-weight: 700;
	color: var(--theme-palette-color-3);
	font-size: 1.5em;
	margin: 0 4px;
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	height: 24px;
}

.pl-widget-separator-text {
	display: inline-block;
}

.pl-widget-separator-success {
	display: none;
	width: 24px;
	height: 24px;
	background: #4CAF50;
	border-radius: 50%;
	color: #fff;
	font-size: 0.7em;
	font-weight: 700;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
	animation: pl-success-pop 0.3s ease-out;
}

.pl-widget-separator-success[style*="display: block"],
.pl-widget-separator-success[style*="display:flex"] {
	display: flex !important;
}

@keyframes pl-success-pop {
	0% {
		transform: scale(0);
		opacity: 0;
	}
	50% {
		transform: scale(1.2);
	}
	100% {
		transform: scale(1);
		opacity: 1;
	}
}

.pl-success-blink {
	animation: pl-success-blink 0.4s ease-in-out;
}

@keyframes pl-success-blink {
	0%, 100% {
		opacity: 1;
		transform: scale(1);
	}
	50% {
		opacity: 0.5;
		transform: scale(1.15);
	}
}

.pl-widget-checkmark {
	position: absolute;
	right: -30px;
	top: 50%;
	transform: translateY(-50%);
	width: 24px;
	height: 24px;
	background: #4CAF50;
	border-radius: 50%;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.9em;
	font-weight: 700;
	box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}


.pl-widget-submit-btn {
	width: 100%;
	padding: 12px;
	background: #4CAF50;
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: 1em;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
	margin-top: 20px;
}

.pl-widget-submit-btn:hover {
	background: #45a049;
	box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
	transform: translateY(-1px);
}

.pl-widget-submit-btn:active {
	transform: translateY(0);
}

/* Community Wisdom Widget (in match widget) */
.pl-community-wisdom-widget {
	margin-top: 12px;
	padding: 10px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border-radius: 8px;
	color: #fff;
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.pl-community-wisdom-widget .pl-community-header {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 10px;
	font-weight: 600;
	font-size: 0.95em;
}

.pl-community-wisdom-widget .pl-community-icon {
	font-size: 1.1em;
}

.pl-community-wisdom-widget .pl-community-title {
	flex: 1;
}

.pl-community-wisdom-widget .pl-community-total {
	font-size: 0.8em;
	opacity: 0.9;
}

.pl-community-wisdom-widget .pl-community-market {
	margin-bottom: 10px;
}

.pl-community-wisdom-widget .pl-community-label {
	font-size: 0.8em;
	opacity: 0.9;
	margin-bottom: 6px;
	display: block;
}

.pl-community-wisdom-widget .pl-community-bars {
	display: flex;
	gap: 6px;
	margin-bottom: 6px;
}

.pl-community-wisdom-widget .pl-community-bar-item {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.pl-community-wisdom-widget .pl-community-bar {
	width: 100%;
	height: 18px;
	background: rgba(255, 255, 255, 0.2);
	border-radius: 9px;
	overflow: hidden;
	position: relative;
}

.pl-community-wisdom-widget .pl-community-bar-fill {
	height: 100%;
	border-radius: 12px;
	transition: width 0.5s ease;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pl-community-wisdom-widget .pl-community-bar-item:first-child .pl-community-bar-fill {
	background: #28a745;
}

.pl-community-wisdom-widget .pl-community-bar-item:nth-child(2) .pl-community-bar-fill {
	background: #ffc107;
}

.pl-community-wisdom-widget .pl-community-bar-item:nth-child(3) .pl-community-bar-fill {
	background: #dc3545;
}

.pl-community-wisdom-widget .pl-community-label-small {
	font-size: 0.75em;
	opacity: 0.9;
	text-align: center;
	font-weight: 600;
}

.pl-community-wisdom-widget .pl-community-percent {
	font-size: 0.8em;
	font-weight: 600;
	text-align: center;
}

.pl-community-wisdom-widget .pl-community-highlight {
	margin: 6px 0 0;
	padding: 6px 10px;
	background: rgba(255, 255, 255, 0.15);
	border-radius: 5px;
	font-size: 0.8em;
	text-align: center;
}

.pl-community-wisdom-widget .pl-community-fun-facts {
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.pl-community-wisdom-widget .pl-community-fact {
	margin: 4px 0;
	font-size: 0.75em;
	opacity: 0.9;
}

.pl-community-wisdom-widget .pl-community-fact strong {
	opacity: 1;
}

.pl-widget-submit-btn:disabled {
	background: #ccc;
	cursor: not-allowed;
}

.pl-widget-finished,
.pl-widget-started,
.pl-widget-deadline-passed {
	padding: 15px;
	background: rgba(255, 255, 255, 0.05);
	border-radius: 8px;
	text-align: center;
	color: #999;
	font-size: 0.9em;
}

.pl-widget-result {
	margin-top: 15px;
	padding: 15px;
	background: rgba(255, 255, 255, 0.05);
	border-radius: 8px;
	font-size: 0.9em;
}

.pl-widget-score-display {
	font-size: 1.5em;
	font-weight: 700;
	color: #fff;
	margin: 10px 0;
}

.pl-widget-points {
	font-weight: 700;
	color: #4CAF50;
	font-size: 1.2em;
	margin-top: 10px;
}

.pl-login-required {
	text-align: center;
	padding: 20px;
}

.pl-login-required p {
	margin-bottom: 15px;
}

/* Match Link */
.pl-widget-match-link {
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	color: var(--theme-palette-color-3);
	cursor: pointer;
	padding: 0;
	flex-shrink: 0;
	transition: color 0.2s;
	text-decoration: none;
	opacity: 0.7;
}

.pl-widget-match-link:hover {
	color: var(--theme-palette-color-3);
	opacity: 1;
}

.pl-widget-match-link svg {
	width: 100%;
	height: 100%;
}

/* Info Button */
.pl-widget-info-btn {
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	color: var(--theme-palette-color-3);
	cursor: pointer;
	padding: 0;
	flex-shrink: 0;
	transition: color 0.2s;
	opacity: 0.7;
}

.pl-widget-info-btn:hover {
	color: var(--theme-palette-color-3);
	opacity: 1;
}

.pl-widget-info-btn svg {
	width: 100%;
	height: 100%;
}

/* Scoring Rules Popup */
.pl-widget-rules-popup {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 10000;
}

.pl-widget-rules-popup.active {
	display: flex;
	align-items: center;
	justify-content: center;
}

.pl-widget-rules-popup-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(4px);
}

.pl-widget-rules-popup-content {
	position: relative;
	background: var(--theme-palette-color-5);
	border-radius: 12px;
	padding: 24px;
	max-width: 600px;
	width: 90%;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
	animation: pl-popup-fade-in 0.3s ease-out;
}

@keyframes pl-popup-fade-in {
	from {
		opacity: 0;
		transform: scale(0.95) translateY(-20px);
	}
	to {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

.pl-widget-rules-popup-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	color: var(--theme-palette-color-3);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	border-radius: 6px;
	transition: all 0.2s;
}

.pl-widget-rules-popup-close:hover {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
}

.pl-widget-rules-popup-title {
	margin: 0 0 16px 0;
	font-size: 1.5em;
	font-weight: 700;
	color: var(--theme-palette-color-3);
}

.pl-widget-rules-popup-body {
	color: var(--theme-palette-color-3);
	font-size: 0.9em;
	line-height: 1.6;
}

.pl-widget-rules-intro {
	margin-bottom: 16px;
	color: var(--theme-palette-color-3);
	font-weight: 500;
}

.pl-widget-rules-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 20px;
}

.pl-widget-rules-table thead {
	background: rgba(255, 255, 255, 0.05);
}

.pl-widget-rules-table th {
	padding: 12px;
	text-align: left;
	font-weight: 600;
	color: var(--theme-palette-color-3);
	border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.pl-widget-rules-table td {
	padding: 10px 12px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pl-widget-rules-table tbody tr:hover {
	background: rgba(255, 255, 255, 0.03);
}

.pl-widget-rules-table td:first-child {
	font-weight: 600;
	color: var(--theme-palette-color-3);
}

.pl-widget-rules-table td:nth-child(2) {
	text-align: center;
	font-weight: 700;
	color: #4CAF50;
}

.pl-widget-rules-examples {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pl-widget-rules-examples h4 {
	margin: 0 0 12px 0;
	font-size: 1.1em;
	font-weight: 600;
	color: var(--theme-palette-color-3);
}

.pl-widget-rules-examples ul {
	margin: 0;
	padding-left: 20px;
}

.pl-widget-rules-examples li {
	margin-bottom: 12px;
}

.pl-widget-rules-examples li strong {
	color: var(--theme-palette-color-3);
	font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
	.pl-match-widget {
		padding: 15px;
	}
	
	.pl-widget-teams {
		flex-direction: column;
		gap: 15px;
	}
	
	.pl-widget-team-home,
	.pl-widget-team-away {
		align-items: center;
		width: 100%;
	}
	
	.pl-widget-score-section {
		width: 100%;
		justify-content: center;
	}
	
	.pl-widget-checkmark {
		position: static;
		transform: none;
		margin-left: 10px;
	}
}

