/* Analytics Dashboard Widget CSS */

.analytics-widget {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.analytics-widget:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.widget-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.widget-header h3 i {
  color: #5d5fef;
}

.widget-link {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: #5d5fef;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.widget-link:hover {
  gap: 0.5rem;
  color: #4f46e5;
}

.widget-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.widget-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.widget-stat-card {
  text-align: center;
  padding: 1rem 0.5rem;
  background: #f9fafb;
  border-radius: 12px;
  position: relative;
  transition: all 0.2s ease;
}

.widget-stat-card:hover {
  background: #f3f4f6;
  transform: translateY(-2px);
}

.widget-stat-card .stat-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.widget-stat-card .stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.widget-stat-card .stat-label {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 500;
}

.widget-stat-card .stat-trend {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.75rem;
}

.stat-trend.positive {
  color: #10b981;
}

.stat-trend.negative {
  color: #ef4444;
}

.widget-chart-container {
  height: 120px;
  padding: 0.5rem;
  background: #f9fafb;
  border-radius: 12px;
}

.widget-error {
  text-align: center;
  padding: 2rem;
  color: #6b7280;
  font-size: 0.875rem;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
  .widget-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .analytics-widget {
    padding: 1rem;
  }
  
  .widget-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .widget-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .widget-stat-card {
    padding: 0.75rem 0.5rem;
  }
  
  .widget-stat-card .stat-icon {
    font-size: 1.25rem;
  }
  
  .widget-stat-card .stat-value {
    font-size: 1rem;
  }
  
  .widget-chart-container {
    height: 100px;
  }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  .analytics-widget {
    background: #1f2937;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  }
  
  .widget-header h3 {
    color: #f9fafb;
  }
  
  .widget-stat-card {
    background: #111827;
  }
  
  .widget-stat-card:hover {
    background: #1f2937;
  }
  
  .widget-stat-card .stat-value {
    color: #f9fafb;
  }
  
  .widget-stat-card .stat-label {
    color: #9ca3af;
  }
  
  .widget-chart-container {
    background: #111827;
  }
}

/* Light Mode Text Visibility Fixes for Analytics Widget */
body:not([data-theme="dark"]) .analytics-widget {
  background: white !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
}

body:not([data-theme="dark"]) .widget-header h3 {
  color: #1f2937 !important;
}

body:not([data-theme="dark"]) .widget-link {
  color: #5d5fef !important;
}

body:not([data-theme="dark"]) .widget-link:hover {
  color: #4f46e5 !important;
}

body:not([data-theme="dark"]) .widget-stat-card {
  background: #f9fafb !important;
}

body:not([data-theme="dark"]) .widget-stat-card:hover {
  background: #f3f4f6 !important;
}

body:not([data-theme="dark"]) .widget-stat-card .stat-value {
  color: #1f2937 !important;
}

body:not([data-theme="dark"]) .widget-stat-card .stat-label {
  color: #6b7280 !important;
}

body:not([data-theme="dark"]) .widget-chart-container {
  background: #f9fafb !important;
}

body:not([data-theme="dark"]) .widget-error {
  color: #6b7280 !important;
}

/* Fix any activity or distribution text in widgets */
body:not([data-theme="dark"]) .activity-label,
body:not([data-theme="dark"]) .distribution-label {
  color: #4b5563 !important;
}

body:not([data-theme="dark"]) .muscle-group-label {
  color: #4b5563 !important;
}