/* playerstats-styles.css */
:root{
	--primary:#2c3e50;
	--secondary:#7f8c8d;
	--accent:#e74c3c;
	--light:#ecf0f1;
	--dark:#34495e;
	--success:#27ae60;
	--warning:#f39c12;
	--danger:#c0392b;
	--info:#3498db;
	--clan:#e74c3c;
	--inner-sphere:#3498db
}
*{
	box-sizing:border-box;
	margin:0;
	padding:0
}
body{
	font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;
	line-height:1.6;
	color:#333;
	background-color:#f5f5f5;
	padding:10px;
	font-size:14px
}
header{
	text-align:center;
	margin-bottom:20px;
	padding:15px;
	background-color:var(--primary);
	color:white;
	border-radius:6px;
	box-shadow:0 2px 4px rgba(0,0,0,0.1)
}
h1{
	margin-bottom:8px;
	font-size:1.5rem
}
.player-summary{
	display:grid;
	grid-template-columns:repeat(auto-fit,minmax(200px,1fr));
	gap:15px;
	margin-bottom:20px
}
.summary-card{
	background-color:white;
	border-radius:6px;
	padding:15px;
	box-shadow:0 2px 4px rgba(0,0,0,0.1);
	text-align:center
}
.summary-value{
	font-size:1.8rem;
	font-weight:bold;
	color:var(--primary)
}
.summary-label{
	font-size:.9rem;
	color:var(--secondary);
	margin-top:5px
}
.summary-subtext{
	font-size:.8rem;
	color:var(--secondary);
	margin-top:5px
}
.tech-breakdown{
	display:grid;
	grid-template-columns:1fr 1fr;
	gap:10px;
	margin-top:10px;
	font-size:.8rem
}
.tech-item{
	display:flex;
	justify-content:space-between;
	padding:3px 0;
	border-bottom:1px dotted #eee
}
.clan-tech{
	color:var(--clan)
}
.inner-sphere-tech{
	color:var(--inner-sphere)
}
.charts-container{
	display:grid;
	grid-template-columns:repeat(auto-fit,minmax(500px,1fr));
	gap:10px;
	margin-bottom:20px
}
.chart-card{
	background-color:white;
	border-radius:6px;
	padding:10px;
	box-shadow:0 2px 4px rgba(0,0,0,0.1);
	height:750px;
	display:flex;
	flex-direction:column;
	overflow:hidden
}
.chart-controls{
	display:flex;
	justify-content:space-between;
	margin-bottom:10px;
	align-items:center;
	flex-shrink:0
}
.chart-title{
	font-size:1.1rem;
	font-weight:bold;
	color:var(--primary);
	margin:0
}
.chart-options{
	display:flex;
	gap:10px
}
.chart-option-btn{
	background:#f0f0f0;
	border:1px solid #ddd;
	border-radius:4px;
	padding:4px 8px;
	font-size:.8rem;
	cursor:pointer
}
.chart-option-btn.active{
	background:var(--info);
	color:white;
	border-color:var(--info)
}
.chart-wrapper{
	flex:1;
	position:relative;
	min-height:0;
	overflow:hidden
}
.chart-wrapper canvas{
	max-width:100%!important;
	max-height:100%!important;
	width:auto!important;
	height:auto!important
}
.variant-list{
	background-color:white;
	border-radius:6px;
	padding:15px;
	box-shadow:0 2px 4px rgba(0,0,0,0.1);
	margin-bottom:30px;
	overflow-x:auto;
	font-size:.8rem
}
.variant-list h2{
	margin-bottom:15px;
	color:var(--primary)
}
.table-container{
	max-height:420px;
	overflow-y:auto;
	border:1px solid #eee;
	border-radius:4px;
	font-size:.6rem
}
table{
	width:100%;
	border-collapse:collapse;
	font-size:.8rem;
	padding:0;
	max-height:420px
}
th,td{
	padding:8px 5px;
	text-align:left;
	border-bottom:1px solid #eee
}
th{
	background-color:#f8f9fa;
	font-weight:bold;
	color:var(--primary);
	position:sticky;
	top:0;
	z-index:10
}
tr:hover{
	background-color:#f5f5f5
}
.variant-link{
	color:var(--info);
	text-decoration:none
}
.variant-link:hover{
	text-decoration:underline
}
.assets-table{
	background-color:white;
	border-radius:6px;
	padding:15px;
	box-shadow:0 2px 4px rgba(0,0,0,0.1);
	margin-bottom:30px;
	overflow-x:auto
}
.assets-table h2{
	margin-bottom:15px;
	color:var(--primary)
}
.back-link{
	display:inline-block;
	margin-top:8px;
	padding:5px 16px;
	background-color:var(--info);
	color:white;
	text-decoration:none;
	border-radius:4px;
	transition:background-color .2s;
	font-size:1rem;
	font-weight:bold
}
.back-link:hover{
	background-color:#2980b9
}
.no-data{
	text-align:center;
	padding:30px;
	color:var(--secondary)
}
.tech-base-section{
	margin-bottom:30px
}
.tech-base-header{
	background-color:var(--primary);
	color:white;
	padding:10px 15px;
	border-radius:6px 6px 0 0;
	margin-bottom:0
}
.compact-table th,.compact-table td{
	padding:8px 3px;
	font-size:.8rem;
	max-height:400px;
	overflow-y:auto
}
.expandable-section{
	margin:20px 0
}
.expandable-header{
	background-color:var(--primary);
	color:white;
	padding:10px 15px;
	border-radius:6px;
	cursor:pointer;
	display:flex;
	justify-content:space-between;
	align-items:center
}
.expandable-content{
	padding:15px;
	background-color:white;
	border-radius:0 0 6px 6px;
	box-shadow:0 2px 4px rgba(0,0,0,0.1);
	display:none
}
.expandable-content.active{
	display:block
}
.preference-summary{
	background-color:#f8f9fa;
	padding:10px;
	border-radius:4px;
	margin-bottom:15px;
	border-left:4px solid #3498db
}
.preference-summary h4{
	margin:0 0 5px;
	color:#2c3e50
}
.preference-summary p{
	margin:0;
	font-size:.9rem;
	color:#5a6465
}
.legend-minimal{
	display:flex;
	justify-content:center;
	gap:15px;
	margin-top:10px;
	font-size:.8rem;
	flex-shrink:0
}
.legend-item{
	display:flex;
	align-items:center;
	gap:5px
}
.legend-color-blue{
	width:12px;
	height:12px;
	border-radius:2px;
	background-color:rgba(52,152,219,0.7)
}
.legend-color-red{
	width:12px;
	height:12px;
	border-radius:2px;
	background-color:rgba(231,76,60,0.7)
}
.legend-color-blue-outer{
	width:12px;
	height:12px;
	border-radius:2px;
	background-color:rgba(52,152,219,0.7)
}
.legend-color-blue-middle{
	width:12px;
	height:12px;
	border-radius:2px;
	background-color:rgba(52,152,219,0.5)
}
.legend-color-blue-inner{
	width:12px;
	height:12px;
	border-radius:2px;
	background-color:rgba(52,152,219,0.3)
}
.counting-system-toggle{
	display:flex;
	justify-content:center;
	margin:10px 0
}
.counting-system-btn{
	background:#f0f0f0;
	border:1px solid #ddd;
	border-radius:4px;
	padding:8px 15px;
	font-size:.9rem;
	cursor:pointer;
	margin:0 5px
}
.counting-system-btn.active{
	background:var(--info);
	color:white;
	border-color:var(--info)
}
th.asc::after{
	content:" ▲";
	font-size:.8em
}
th.desc::after{
	content:" ▼";
	font-size:.8em
}
.player-suggestions{
	position:absolute;
	background:white;
	border:1px solid #ddd;
	border-radius:4px;
	max-height:600px;
	overflow-y:auto;
	z-index:1000;
	width:100%;
	box-shadow:0 2px 4px rgba(0,0,0,0.1);
	display:none;
	top:100%;
	left:0
}
.player-suggestion{
	padding:8px 12px;
	cursor:pointer;
	border-bottom:1px solid #eee;
	font-size:.85rem;
	color:#333
}
.player-suggestion:hover{
	background-color:#f5f5f5
}
.player-suggestion:last-child{
	border-bottom:none
}
.player-suggestion.active{
	background-color:#3498db;
	color:white
}
.player-filter-container{
	position:relative
}
.date-filter-container{
	position:relative;
	display:flex;
	gap:10px;
	align-items:center;
	margin-left:15px
}
.date-filter-btn{
	background:#f0f0f0;
	border:1px solid #ddd;
	border-radius:4px;
	padding:8px 12px;
	font-size:.9rem;
	cursor:pointer;
	color:#333
}
.date-filter-btn:hover{
	background:#e0e0e0
}
.date-filter-modal{
	position:absolute;
	top:100%;
	right:0;
	background:white;
	border:1px solid #ddd;
	border-radius:4px;
	padding:15px;
	box-shadow:0 2px 10px rgba(0,0,0,0.1);
	z-index:1001;
	display:none;
	min-width:300px
}
.date-filter-modal.active{
	display:block
}
.date-range-inputs{
	display:flex;
	flex-direction:column;
	gap:10px;
	margin-bottom:15px
}
.date-input-group{
	display:flex;
	flex-direction:column;
	gap:5px
}
.date-input-group label{
	font-size:.8rem;
	font-weight:bold;
	color:#333
}
.date-time-inputs{
	display:flex;
	gap:5px
}
.date-time-inputs input{
	flex:1;
	padding:5px;
	border:1px solid #ddd;
	border-radius:3px;
	font-size:.8rem
}
.date-filter-actions{
	display:flex;
	justify-content:space-between;
	gap:10px
}
.date-filter-action-btn{
	flex:1;
	padding:8px;
	border:none;
	border-radius:3px;
	cursor:pointer;
	font-size:.8rem
}
.date-filter-apply{
	background:#3498db;
	color:white
}
.date-filter-clear{
	background:#95a5a6;
	color:white
}
.date-filter-apply:hover{
	background:#2980b9
}
.date-filter-clear:hover{
	background:#7f8c8d
}
.date-filter-active{
	background:#3498db!important;
	color:white!important;
	border-color:#3498db!important
}
.date-filter-current-btn{
	width:100%;
	background:#27ae60;
	color:white;
	border:none;
	border-radius:4px;
	padding:10px;
	margin:10px 0;
	cursor:pointer;
	font-size:.9rem;
	transition:background-color .2s
}
.date-filter-current-btn:hover{
	background:#219653
}
.quick-set-buttons{
	margin:15px 0;
	padding:10px;
	background:#f8f9fa;
	border-radius:4px;
	border:1px solid #e9ecef
}
.quick-set-label{
	margin:10px 0;
	font-size:.8rem;
	color:#666
}
.quick-set-btn-container{
	display:flex;
	gap:5px;
	flex-wrap:wrap
}
.quick-set-btn{
	background:#6c757d;
	color:white;
	border:none;
	border-radius:3px;
	padding:5px 10px;
	font-size:.75rem;
	cursor:pointer;
	transition:background-color .2s
}
.quick-set-btn:hover{
	background:#5a6268
}
.completion-rank-btn {
	background: var(--info);
	color: white;
	border: none;
	border-radius: 4px;
	padding: 6px 12px;
	font-size: 0.8rem;
	cursor: pointer;
	margin-top: 8px;
	transition: background-color 0.2s;
}
.completion-rank-btn:hover {
	background: #2980b9;
}
.completion-badge {
	display: inline-block;
	margin-left: 5px;
	padding: 2px 6px;
	border-radius: 3px;
	font-size: 0.7rem;
	font-weight: bold;
	color: white;
}
.badge-mech { background-color: #e74c3c; }
.badge-aerospace { background-color: #3498db; }
.badge-hovercraft { background-color: #2ecc71; }
.badge-tracked { background-color: #f39c12; }
.badge-vtol { background-color: #9b59b6; }
.badge-wheeled { background-color: #1abc9c; }

/* Header controls layout */


.header-controls {
    display: flex;
    justify-content: center;
    margin: 10px 0 20px 0;
    align-items: center;
    gap: 15px;
    padding: 15px 10px;           /* Increased padding */
    background-color: rgba(0,0,0,0.2); /* Subtle dark background */
    border-radius: 8px;            /* Rounded corners */
}

.player-search-input {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 0.9rem;
}

.player-name-header {
	font-size: 1.5rem;
	font-weight: bold;
	margin: 15px 0;
	color: #ecf0f1;
	text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.player-activity {
	margin-top: 5px;
	font-size: 1rem;
	color: #ecf0f1;
}

.player-activity-message {
	font-size: 1rem;
	color: #ecf0f1;
}

.player-activity-item {
	font-size: 1rem;
	color: #ecf0f1;
	margin: 5px 0;
}


/* Header links styling with visual separation */
.header-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 15px 0 15px 0;  /* Increased bottom margin for separation */
    flex-wrap: wrap;
    padding-bottom: 15px;     /* Add padding for visual space */
    border-bottom: 2px solid rgba(255,255,255,0.2); /* Subtle separator line */
}



.reload-btn {
	background-color: var(--success);
}
.reload-btn:hover {
	background-color: #219a52;
}

/* 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); }
}

/* Top players 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);
}

.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: 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);
	font-size: 1.2rem;
	font-weight: bold;
}

/* Scrollable table */
.scrollable-table {
	max-height: 420px;
	overflow-y: auto;
}

/* Info box styles */
.info-box {
	background-color: #e8f4fd;
	border-left: 4px solid #3498db;
	padding: 15px;
	margin: 15px 0;
	border-radius: 6px;
}

.interpretation-box {
	margin: 15px 0;
	padding: 15px;
	background: white;
	border-radius: 6px;
	border: 1px solid #ddd;
}

.interpretation-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
}

.interpretation-table td {
	padding: 8px;
	border: 1px solid #ddd;
}

.strong-preference {
	background-color: #27ae60;
	color: white;
}

.strong-preference td {
	color: white;
}

.moderate-preference {
	background-color: #2ecc71;
}

.neutral {
	background-color: #f8f9fa;
}

.moderate-avoidance {
	background-color: #f39c12;
}

.strong-avoidance {
	background-color: #e74c3c;
	color: white;
}

.strong-avoidance td {
	color: white;
}

.examples-box {
	margin: 15px 0;
	padding: 15px;
	background: #fff3cd;
	border-radius: 6px;
	border: 1px solid #ffeaa7;
}

.examples-box ul {
	margin-bottom: 0;
	padding-left: 20px;
}

/* Tech distribution */
.tech-distribution {
	border-top: 1px solid #eee;
	margin-top: 5px;
	padding-top: 5px;
	grid-column: 1 / -1;
}

.tech-distribution .tech-item {
	display: flex;
	justify-content: space-between;
	font-size: 0.75rem;
}

@media (max-width:768px){
	.charts-container{
		grid-template-columns:1fr
	}
	.player-summary{
		grid-template-columns:1fr
	}
	th,td{
		padding:6px 3px;
		font-size:.8rem
	}
	.chart-card{
		height:400px
	}
	.chart-controls{
		flex-direction:column;
		gap:10px;
		align-items:flex-start
	}
	.chart-options{
		align-self:flex-end
	}
}