/* Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Quicksand', sans-serif;
  background: #000000;
  color: #ffffff;
  line-height: 1.6;
}

/* Header Styles */
.sports-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border-bottom: 2px solid #333;
  padding: 15px 40px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo-link {
  display: flex;
  align-items: center;
}

.sports-logo {
  height: 50px;
  width: auto;
}

.sports-title-block {
  display: flex;
  flex-direction: column;
}

.sports-title {
  font-size: 2.2rem;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 1.2px;
  line-height: 1;
}

.sports-subtitle {
  font-size: 1rem;
  color: #cccccc;
  font-weight: 500;
  margin-top: 4px;
  letter-spacing: 0.5px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 30px;
}

/* Team Switcher */
.team-switcher {
  display: flex;
  background: #333;
  border-radius: 25px;
  padding: 4px;
  gap: 2px;
}

.team-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 20px;
  background: transparent;
  color: #cccccc;
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.team-btn.active {
  background: linear-gradient(135deg, #666666 0%, #888888 100%);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.team-btn:hover:not(.active) {
  background: #444;
  color: #ffffff;
}

.madehoops-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.madehoops-logo {
  height: 40px;
  width: auto;
}

.madehoops-title {
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.8px;
}

/* Main Dashboard Layout */
.dashboard-main {
  padding: 20px;
  max-width: 1800px;
  margin: 0 auto;
}

.dashboard-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.dashboard-row.full-width {
  grid-template-columns: 1fr;
}

/* Video Container */
.video-container {
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  border: 1px solid #333;
}

.video-container h2 {
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 20px;
  text-align: center;
}

.dashboard-video {
  width: 100%;
  height: 350px;
  border-radius: 10px;
  background: #000;
  outline: none;
}

/* Team Overview */
.team-overview-container {
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  border: 1px solid #333;
}

.team-overview-container h2 {
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 25px;
  text-align: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.stat-card {
  background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  border: 1px solid #444;
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 0.9rem;
  color: #cccccc;
  font-weight: 500;
}

/* Chart Containers */
.chart-container, .table-container {
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  border: 1px solid #333;
}

.chart-container h3, .table-container h3 {
  color: #ffffff;
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 20px;
  text-align: center;
}

canvas {
  max-width: 100%;
  height: auto !important;  
  max-height: 300px;     
}

/* Heat Map Styles */
.heat-map-controls {
  margin-bottom: 15px;
  text-align: center;
}

#player-selector {
  background: #333;
  color: #ffffff;
  border: 1px solid #555;
  border-radius: 8px;
  padding: 8px 15px;
  font-family: 'Quicksand', sans-serif;
  font-weight: 500;
}

#shot-heat-map {
  width: 100%;
  height: 300px;
  background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
  border-radius: 10px;
  border: 1px solid #444;
  position: relative;
  overflow: hidden;
}

.court-bg {
  width: 100%;
  height: 100%;
  background: #2a2a2a;
  position: relative;
}

.hex-zone {
  position: absolute;
  width: 60px;
  height: 52px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid #555;
}

.hex-zone:hover {
  transform: scale(1.1);
  z-index: 10;
}

.hex-excellent { background: rgba(255, 255, 255, 0.9); color: #000; }
.hex-good { background: rgba(200, 200, 200, 0.8); color: #000; }
.hex-average { background: rgba(150, 150, 150, 0.7); color: #fff; }
.hex-poor { background: rgba(100, 100, 100, 0.6); color: #fff; }

/* Table Styles */
.table-wrapper {
  max-height: 350px;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid #444;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  padding: 12px 8px;
  text-align: left;
  border-bottom: 1px solid #333;
}

th {
  background: linear-gradient(135deg, #333 0%, #444 100%);
  color: #ffffff;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 2;
}

tr:nth-child(even) {
  background: rgba(42, 42, 42, 0.5);
}

tr:hover {
  background: rgba(66, 66, 66, 0.7);
}

/* Performance Indicators */
.performance-high { color: #4CAF50; font-weight: 600; }
.performance-med { color: #FF9800; font-weight: 600; }
.performance-low { color: #F44336; font-weight: 600; }

/* Export Section */
.export-section {
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border-radius: 15px;
  padding: 25px;
  margin-top: 30px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  border: 1px solid #333;
  text-align: center;
}

.export-section h3 {
  color: #ffffff;
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.export-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.export-btn {
  background: linear-gradient(135deg, #666666 0%, #888888 100%);
  color: #ffffff;
  border: none;
  border-radius: 25px;
  padding: 12px 24px;
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.export-btn:hover {
  background: linear-gradient(135deg, #777777 0%, #999999 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .dashboard-row {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .sports-header {
    flex-direction: column;
    gap: 15px;
    padding: 15px 20px;
  }
  
  .header-right {
    gap: 15px;
  }
  
  .team-switcher {
    order: -1;
  }
  
  .dashboard-main {
    padding: 15px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .export-buttons {
    flex-direction: column;
    align-items: center;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
  background: #666;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #888;
}

/* Add this CSS to your style.css file to enlarge and center the radar chart */

/* Specific styling for the team performance chart container */
.chart-container:has(#team-radar-chart) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  min-height: 400px; /* Good height for horizontal bars */
  padding: 25px;
}

/* Make the chart canvas fill the container properly */
#team-radar-chart {
  width: 100% !important;
  height: 350px !important;
  max-height: 350px !important;
}

/* Alternative approach using CSS Grid for better control */
@media (min-width: 768px) {
  /* Only apply on larger screens */
  .dashboard-row:has(.chart-container:has(#team-radar-chart)) {
    grid-template-columns: 1.2fr 0.8fr; /* Give more space to radar chart side */
    align-items: start;
  }
  
  /* Ensure the heat map container doesn't get too compressed */
  .chart-container:has(#shot-heat-map) {
    min-width: 400px;
  }
}

/* For screens where both charts need to be visible */
@media (min-width: 1200px) {
  .dashboard-row:has(.chart-container:has(#team-radar-chart)) {
    grid-template-columns: 1.3fr 0.7fr; /* Even more space for radar */
  }
  
  #team-radar-chart {
    max-width: 500px !important;
    max-height: 500px !important;
    width: 500px !important;
    height: 500px !important;
  }
}

/* Ensure the chart title is properly centered */
.chart-container:has(#team-radar-chart) h3 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 1.4rem;
}

/* Additional styling for better label positioning - this will be handled in JavaScript */
/* The actual label spacing improvement needs to be done in the renderTeamRadar function */