/* Workout Heat Map CSS - GitHub-style contribution calendar */

.workout-heatmap-container {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}

.workout-heatmap-container:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

/* Year selector */
.heatmap-year-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.year-nav-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  color: #6b7280;
  transition: all 0.2s ease;
}

.year-nav-btn:hover {
  border-color: #5d5fef;
  color: #5d5fef;
  background: #f5f3ff;
}

.year-nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.year-label {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1f2937;
  min-width: 60px;
  text-align: center;
}

/* SVG styling */
.workout-heatmap-svg {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

.heatmap-cell {
  stroke: #ffffff;
  stroke-width: 2;
  transition: all 0.2s ease;
}

.heatmap-cell:hover {
  stroke: #5d5fef;
  stroke-width: 2;
  filter: brightness(0.95);
}

.month-label,
.day-label {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  user-select: none;
}

/* Tooltip */
.heatmap-tooltip {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  white-space: pre-line;
  line-height: 1.4;
}

/* Statistics panel */
.heatmap-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.heatmap-stats-item {
  text-align: center;
  padding: 0.75rem;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.heatmap-stats-item:hover {
  background-color: #f9fafb;
}

.stats-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.25rem;
}

.stats-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Legend */
.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: #6b7280;
}

.heatmap-legend-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.heatmap-legend-square {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* Mobile responsive */
@media (max-width: 767px) {
  .workout-heatmap-container {
    padding: 1rem;
    overflow-x: auto;
  }
  
  .workout-heatmap-svg {
    min-width: 600px;
  }
  
  .heatmap-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
  }
  
  .heatmap-stats-item {
    padding: 0.5rem;
  }
  
  .stats-value {
    font-size: 1.25rem;
  }
  
  .stats-label {
    font-size: 0.625rem;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .workout-heatmap-container {
    background: #1f2937;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  }
  
  .workout-heatmap-container:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  }
  
  .year-nav-btn {
    background: #374151;
    border-color: #4b5563;
    color: #d1d5db;
  }
  
  .year-nav-btn:hover {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #ffffff;
  }
  
  .year-label {
    color: #f9fafb;
  }
  
  .heatmap-stats {
    border-top-color: #374151;
  }
  
  .heatmap-stats-item:hover {
    background-color: #111827;
  }
  
  .stats-value {
    color: #f9fafb;
  }
  
  .stats-label {
    color: #9ca3af;
  }
  
  .month-label,
  .day-label {
    fill: #9ca3af !important;
  }
}

/* Export button */
.heatmap-export-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.5rem 1rem;
  background: #5d5fef;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.heatmap-export-btn:hover {
  background: #4f46e5;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Integration with dashboard */
.dashboard-heatmap {
  grid-column: span 2;
}

@media (min-width: 1024px) {
  .dashboard-heatmap {
    grid-column: span 3;
  }
}