/* matchstats-styles.css */
:root {
    --primary-color: #1a1a2e; --secondary-color: #16213e; --accent-color: #0f3460;
    --highlight-color: #e94560; --text-color: #f1f1f1; --border-color: #2d4059;
    --is-color: #4a9fe3; --clan-color: #e94560;
}
body { 
	background-color: var(--primary-color); 
	color: var(--text-color); 
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
}
.container { 
	max-width: 100%; 
	padding: 0 15px; 
}
.header { 
	background: linear-gradient(135deg, var(--secondary-color), var(--accent-color)); 
	padding: 1.5rem 0; 
	border-bottom: 3px solid var(--highlight-color); 
	margin-bottom: 2rem; 
}
.header h1 { 
	text-align: center; 
	font-weight: 500; 
	text-shadow: 2px 2px 4px rgba(0,0,0,0.5); 
	font-size: 2rem;
}
.header h2 { 
	text-align: center; 
	font-weight: 200; 
	opacity: 0.9; 
}
.header h3 { 
	text-align: center; 
	font-weight: 100; 
	opacity: 0.9; 
	font-size: 1.2rem; 
}
.nav-links { 
	margin-top: 1rem; 
	text-align: center;
}
.nav-links a { 
	color: var(--text-color); 
	text-decoration: none; 
	margin: 0 1rem; 
	padding: 0.5rem 1rem; 
	border-radius: 4px; 
	transition: all 0.3s ease; 
	border: 1px solid transparent; 
}
.nav-links a:hover { 
	background-color: rgba(255,255,255,0.1); 
	border-color: var(--highlight-color); 
}
.card { 
	background-color: var(--secondary-color); 
	border: 1px solid var(--border-color); 
	border-radius: 8px; 
	box-shadow: 0 4px 6px rgba(0,0,0,0.1); 
	margin-bottom: 1.5rem; 
}
.card-header { 
	background-color: var(--accent-color); 
	border-bottom: 1px solid var(--border-color); 
	padding: 1rem 1.5rem; 
	font-weight: 600; 
}
.table-container { 
	overflow-x: auto; 
}
table { 
	width: 100%; 
	border-collapse: collapse; 
	font-size: 0.85rem; 
}
th { 
	background-color: var(--accent-color); 
	color: var(--text-color); 
	padding: 0.5rem 0.3rem; 
	text-align: left; 
	cursor: pointer; 
	user-select: none; 
	position: relative; 
}
th:hover { 
	background-color: #1a2c4e; 
}
th i { 
	margin-left: 0.5rem; 
	opacity: 0.7; 
}
td { 
	padding: 0.5rem 0.3rem; 
	border-bottom: 1px solid var(--border-color); 
}
tr:hover { 
	background-color: rgba(255,255,255,0.05); 
}
.team-is { 
	color: var(--is-color); 
} 
.team-clan { 
	color: var(--clan-color); 
}
.pagination-container { 
	display: flex; 
	justify-content: center; 
	margin: 1.5rem 0; 
}
.filter-container { 
	display: grid; 
	grid-template-columns: 160px 120px 120px 140px 160px 100px 120px 120px 100px 120px 80px 100px; 
	gap: 0.3rem; 
	margin-bottom: 0.5rem; 
	overflow-x: auto; 
}
.filter-container input { 
	padding: 0.3rem; 
	font-size: 0.8rem; 
	min-width: 0; 
	width: 100%; 
	box-sizing: border-box; 
}
.filter-container input::placeholder { 
	font-size: 0.7rem; 
	opacity: 0.7; 
}
.filter-container input:focus::placeholder { 
	opacity: 0.4; 
}
.filter-table {
	 width: 100%;
	 border-collapse: collapse;
	 margin-bottom: 0.5rem;
}
.filter-table th {
	 padding: 0.3rem;
	 background-color: transparent;
	 border: none;
	 width: auto;
}
.filter-table input {
	 width: 100%;
	 padding: 0.3rem;
	 font-size: 0.8rem;
	 box-sizing: border-box;
}
/* Ensure filter table columns have appropriate widths */
#filterTable th:nth-child(1) { width: 10%; }
#filterTable th:nth-child(2) { width: 11%; }
#filterTable th:nth-child(3) { width: 9%; }
#filterTable th:nth-child(4) { width: 11%; }
#filterTable th:nth-child(5) { width: 10%; }		  
.stats-container { 
	display: flex; 
	flex-direction: column; 
	gap: 1.5rem; 
	margin-top: 2rem; 
}
.team-stats { 
	display: grid; 
	grid-template-columns: 1fr 1fr; 
	gap: 1rem; 
	margin-bottom: 1rem; 
}
.team-stat { 
	padding: 1rem; 
	border-radius: 6px; 
}
.team-is-stat { 
	background-color: rgba(74,159,227,0.2); 
	border: 1px solid var(--is-color); 
}
.team-clan-stat { 
	background-color: rgba(233,69,96,0.2); 
	border: 1px solid var(--clan-color); 
}
.team-stat h4 { 
	margin: 0 0 0.5rem 0; 
}
.chart-container { 
	display: grid; 
	grid-template-columns: repeat(2, 1fr); 
	gap: 1rem; 
	margin-bottom: 1rem; 
}
.chart-card { 
	background-color: var(--secondary-color); 
	border-radius: 8px; 
	padding: 1rem; 
	box-shadow: 0 4px 6px rgba(0,0,0,0.1); 
	height: 850px; 
}
.chart-card h4 { 
	margin: 0 0 1rem 0; 
	text-align: center; 
	color: var(--highlight-color); 
}
.chart-card canvas { 
	height: 800px !important; 
	width: 100% !important; 
}
.navigation { 
	display: flex; 
	justify-content: center; 
	align-items: center; 
	margin-bottom: 1rem; 
	gap: 1rem; 
	flex-wrap: nowrap; 
}
.navigation button { 
	background-color: var(--accent-color); 
	border: 1px solid var(--border-color); 
	color: var(--text-color); 
	padding: 0.5rem 1rem; 
	cursor: pointer; 
	border-radius: 4px; 
	transition: all 0.3s ease; 
	white-space: nowrap; 
	flex-shrink: 0; 
}
.navigation button:hover { 
	background-color: var(--highlight-color); 
}
.navigation button:disabled { 
	opacity: 0.5; 
	cursor: not-allowed; 
}		
.navigation-info {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-wrap: nowrap;
	white-space: nowrap;
	min-width: 560px;
    width: 560px; 
	justify-content: space-between;
}

.navigation-info.centered {
    justify-content: center;
}

.navigation-info button {
	flex-shrink: 0;
	width: 180px;
}
.navigation-info button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}
.table-footer { 
	background-color: var(--accent-color); 
	font-weight: bold; 
}
.loading { 
	text-align: center; 
	padding: 2rem; 
}
.no-price { 
	color: #aaa; 
	font-style: italic; 
}
.asset-link, .player-link { 
	color: var(--highlight-color); 
	text-decoration: none; 
}
.asset-link:hover, .player-link:hover { 
	text-decoration: underline; 
}
#daySelector, #dayPaginationBottom select { 
	background-color: var(--secondary-color); 
	border: 1px solid var(--border-color); 
	color: var(--text-color); 
	padding: 0.5rem; 
	border-radius: 4px; 
	min-width: 250px; 
	max-width: 360px; 
}
#daySelector option, #dayPaginationBottom select option { 
	background-color: var(--secondary-color); 
	color: var(--text-color); 
	padding: 0.3rem; 
}
#daySelector optgroup, #dayPaginationBottom select optgroup { 
	background-color: var(--accent-color); 
	color: var(--highlight-color); 
	font-weight: bold; 
	padding: 0.2rem; 
}
#daySelector optgroup option, #dayPaginationBottom select optgroup option { 
	background-color: var(--secondary-color); 
	color: var(--text-color); 
	padding-left: 1rem; 
	font-weight: normal; 
}
#dataInfo { 
	color: var(--highlight-color) !important; 
	font-weight: bold !important; 
	font-size: 1rem !important; 
}
.weight-class-section { 
	margin-bottom: 1rem; 
	padding: 0.5rem; 
	border-radius: 4px; 
}
.weight-class-section.is { 
	border: 1px solid var(--is-color); 
	background: rgba(74,159,227,0.05); 
}
.weight-class-section.clan { 
	border: 1px solid var(--clan-color); 
	background: rgba(233,69,96,0.05); 
}
.weight-class-section h5 { 
	margin: 0 0 0.5rem 0; 
	font-size: 0.9rem; 
	font-weight: bold; 
}
.weight-class-section.is h5 { 
	color: var(--is-color); 
}
.weight-class-section.clan h5 { 
	color: var(--clan-color); 
}
.asset-row { 
	display: flex; 
	justify-content: space-between; 
	padding: 0.2rem 0; 
	border-bottom: 1px solid rgba(255,255,255,0.1); 
	align-items: center; 
}
.player-stat { 
	margin-bottom: 1rem; 
}
@media (max-width: 1200px) {
    .chart-container { grid-template-columns: 1fr; }
    .chart-card { height: 700px; }
    .chart-card canvas { height: 650px !important; }
}
@media (max-width: 768px) {
    .header h1 { font-size: 1.5rem; } .header h2 { font-size: 1rem; }
    .nav-links { display: flex; flex-direction: column; gap: 0.5rem; }
    .nav-links a { margin: 0; text-align: center; }
    .filter-container, .team-stats { grid-template-columns: 1fr; }
    .navigation { flex-wrap: wrap; justify-content: center; }
    .navigation-info { order: -1; width: 100%; margin-bottom: 0.5rem; }
    .navigation button { padding: 0.4rem 0.8rem; font-size: 0.9rem; }
    .chart-card { height: 500px; }
    .chart-card canvas { height: 450px !important; }
}

/* Refresh button styling */
.refresh-btn {
	background-color: var(--accent-color);
	border: 1px solid var(--border-color);
	color: var(--text-color);
	padding: 0.5rem 1rem;
	cursor: pointer;
	border-radius: 4px;
	transition: all 0.3s ease;
	margin-left: 1rem;
}
.refresh-btn:hover {
	background-color: var(--highlight-color);
}

/* Loading overlay styles */
.loading-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,0.7);
	display: flex;
	justify-content: center;
	align-items: center;
	flex-direction: column;
	z-index: 9999;
	color: white;
	font-size: 1.2rem;
}

.loading-spinner {
	width: 50px;
	height: 50px;
	border: 5px solid #f3f3f3;
	border-top: 5px solid #3498db;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin-bottom: 20px;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* Chart tooltip styles */
.chart-tooltip-point {
	background-color: rgba(0,0,0,0.8);
	padding: 8px;
	border-radius: 4px;
}

/* Player stat links */
.player-stat-link {
	text-decoration: none;
	color: var(--is-color);
}

.player-stat-link.clan {
	color: var(--clan-color);
}

.player-stat-link:hover {
	text-decoration: underline;
}

/* Asset links */
.asset-stat-link {
	color: #fffad4;
	text-decoration: none;
}

.asset-stat-link:hover {
	text-decoration: underline;
}

/* Legend colors */
.legend-color-is {
	background-color: rgba(74,159,227,0.7);
	width: 12px;
	height: 12px;
	border-radius: 2px;
}

.legend-color-clan {
	background-color: rgba(233,69,96,0.7);
	width: 12px;
	height: 12px;
	border-radius: 2px;
}

.legend-color-is-light {
	background-color: rgba(74,159,227,0.3);
	width: 12px;
	height: 12px;
	border-radius: 2px;
}

.legend-color-clan-light {
	background-color: rgba(233,69,96,0.3);
	width: 12px;
	height: 12px;
	border-radius: 2px;
}

/* Modal styles */
.top-players-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,0.7);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 10000;
}

.top-players-modal-content {
	background: white;
	padding: 25px;
	border-radius: 8px;
	max-width: 95%;
	width: 1200px;
	max-height: 80vh;
	overflow-y: auto;
	box-shadow: 0 4px 8px rgba(0,0,0,0.3);
	color: #333;
}

.top-players-table-container {
	max-height: 60vh;
	overflow-y: auto;
}

.top-players-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.8rem;
}

.top-players-table th {
	background-color: var(--primary-color);
	color: white;
	padding: 10px;
	text-align: left;
	cursor: pointer;
}

.top-players-table td {
	padding: 8px;
	border-bottom: 1px solid #eee;
}

.top-players-table td:nth-child(3),
.top-players-table td:nth-child(4),
.top-players-table td:nth-child(5),
.top-players-table td:nth-child(6),
.top-players-table td:nth-child(7),
.top-players-table td:nth-child(8),
.top-players-table td:nth-child(9) {
	text-align: right;
}

.top-players-table th:nth-child(3),
.top-players-table th:nth-child(4),
.top-players-table th:nth-child(5),
.top-players-table th:nth-child(6),
.top-players-table th:nth-child(7),
.top-players-table th:nth-child(8),
.top-players-table th:nth-child(9) {
	text-align: right;
}

.player-link {
	color: var(--info);
	text-decoration: none;
}

.player-link:hover {
	text-decoration: underline;
}

.badge-legend {
	margin-top: 15px;
	font-size: 0.8rem;
	color: #666;
}

.modal-actions {
	text-align: center;
	margin-top: 20px;
}

.modal-close-btn {
	padding: 10px 20px;
	background: var(--info);
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 1rem;
}

.modal-close-btn:hover {
	background: #2980b9;
}

.modal-title {
	margin-bottom: 15px;
	color: var(--primary-color);
	font-size: 1.2rem;
	font-weight: bold;
}