/* Performance Analytics Styles */
.performance-analytics-container {
  height: 100%;
  overflow-y: auto;
  background: #f9fafb;
}

.dark .performance-analytics-container {
  background: #111827;
}

.performance-content {
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Key Metrics Grid */
.performance-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.performance-metric-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease-in-out;
}

.performance-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.15);
}

.dark .performance-metric-card {
  background: #1f2937;
  border-color: #374151;
}

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

.metric-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  margin: 0;
}

.dark .metric-title {
  color: #9ca3af;
}

.metric-icon {
  width: 1.5rem;
  height: 1.5rem;
  color: #6366f1;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.25rem;
}

.dark .metric-value {
  color: #f3f4f6;
}

.metric-subtitle {
  font-size: 0.75rem;
  color: #6b7280;
}

.dark .metric-subtitle {
  color: #9ca3af;
}

/* Metric status indicators */
.metric-good {
  border-left: 4px solid #10b981;
}

.metric-warning {
  border-left: 4px solid #f59e0b;
}

.metric-poor {
  border-left: 4px solid #ef4444;
}

/* Performance Charts */
.performance-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 1024px) {
  .performance-charts-grid {
    grid-template-columns: 1fr;
  }
}

.performance-chart-section {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.dark .performance-chart-section {
  background: #1f2937;
  border-color: #374151;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.dark .chart-header {
  border-bottom-color: #374151;
}

.chart-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.dark .chart-title {
  color: #f3f4f6;
}

.chart-subtitle {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

.dark .chart-subtitle {
  color: #9ca3af;
}

.chart-legend {
  display: flex;
  gap: 1rem;
}

.legend-item {
  display: flex;
  align-items: center;
  font-size: 0.75rem;
  color: #6b7280;
}

.legend-item::before {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 0.5rem;
}

.legend-index::before {
  background-color: #10b981;
}

.legend-sequential::before {
  background-color: #f59e0b;
}

.chart-container {
  height: 300px;
  position: relative;
}

/* Performance Sections */
.performance-section {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.dark .performance-section {
  background: #1f2937;
  border-color: #374151;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 1.5rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}

.dark .section-title {
  color: #f3f4f6;
  border-bottom-color: #374151;
}

/* Index Performance */
.index-performance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.index-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
  transition: all 0.2s ease-in-out;
}

.index-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.1);
}

.dark .index-card {
  background: #111827;
  border-color: #374151;
}

.index-card.efficiency-good {
  border-left: 4px solid #10b981;
}

.index-card.efficiency-warning {
  border-left: 4px solid #f59e0b;
}

.index-card.efficiency-poor {
  border-left: 4px solid #ef4444;
}

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

.index-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
  word-break: break-all;
}

.dark .index-name {
  color: #f3f4f6;
}

.index-efficiency {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
}

.index-efficiency.efficiency-good {
  background: #d1fae5;
  color: #065f46;
}

.index-efficiency.efficiency-warning {
  background: #fef3c7;
  color: #92400e;
}

.index-efficiency.efficiency-poor {
  background: #fee2e2;
  color: #991b1b;
}

.dark .index-efficiency.efficiency-good {
  background: #064e3b;
  color: #6ee7b7;
}

.dark .index-efficiency.efficiency-warning {
  background: #78350f;
  color: #fcd34d;
}

.dark .index-efficiency.efficiency-poor {
  background: #7f1d1d;
  color: #fca5a5;
}

.index-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.index-stat {
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.625rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1f2937;
}

.dark .stat-value {
  color: #f3f4f6;
}

.stat-warning {
  color: #f59e0b !important;
}

.index-warning {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: #fef3c7;
  color: #92400e;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  text-align: center;
}

.dark .index-warning {
  background: #78350f;
  color: #fcd34d;
}

/* Maintenance Information */
.maintenance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.maintenance-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
}

.dark .maintenance-card {
  background: #111827;
  border-color: #374151;
}

.maintenance-header {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.maintenance-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 0 0.75rem;
}

.dark .maintenance-title {
  color: #f3f4f6;
}

.maintenance-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: #6366f1;
}

.maintenance-stats {
  space-y: 0.75rem;
}

.maintenance-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

/* Insights */
.insights-grid {
  display: grid;
  gap: 1rem;
}

.insight-card {
  border-radius: 0.5rem;
  padding: 1rem;
  border: 1px solid;
  transition: all 0.2s ease-in-out;
}

.insight-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.15);
}

.insight-card.insight-warning {
  background: #fef3c7;
  border-color: #f59e0b;
}

.insight-card.insight-opportunity {
  background: #dbeafe;
  border-color: #3b82f6;
}

.insight-card.insight-optimization {
  background: #e0e7ff;
  border-color: #6366f1;
}

.insight-card.insight-maintenance {
  background: #fed7d7;
  border-color: #e53e3e;
}

.insight-card.insight-info {
  background: #f0f9ff;
  border-color: #0ea5e9;
}

.dark .insight-card.insight-warning {
  background: #78350f;
  border-color: #d97706;
}

.dark .insight-card.insight-opportunity {
  background: #1e3a8a;
  border-color: #3b82f6;
}

.dark .insight-card.insight-optimization {
  background: #312e81;
  border-color: #6366f1;
}

.dark .insight-card.insight-maintenance {
  background: #7f1d1d;
  border-color: #dc2626;
}

.dark .insight-card.insight-info {
  background: #0c4a6e;
  border-color: #0ea5e9;
}

.insight-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

.insight-icon-wrapper {
  width: 2rem;
  height: 2rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.insight-icon-wrapper svg {
  width: 100%;
  height: 100%;
}

.insight-title-section {
  flex: 1;
}

.insight-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
}

.insight-category {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.insight-priority {
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  letter-spacing: 0.05em;
}

.insight-priority-high {
  background: #fee2e2;
  color: #991b1b;
}

.insight-priority-medium {
  background: #fef3c7;
  color: #92400e;
}

.insight-priority-low {
  background: #f3f4f6;
  color: #374151;
}

.dark .insight-priority-high {
  background: #7f1d1d;
  color: #fca5a5;
}

.dark .insight-priority-medium {
  background: #78350f;
  color: #fcd34d;
}

.dark .insight-priority-low {
  background: #374151;
  color: #d1d5db;
}

.insight-content {
  line-height: 1.5;
}

.insight-message {
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

.insight-recommendation {
  font-size: 0.875rem;
  font-style: italic;
  opacity: 0.8;
}

/* Loading and Error States */
.performance-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
}

.loading-spinner {
  margin-bottom: 1rem;
}

.spinner {
  width: 3rem;
  height: 3rem;
  border: 3px solid #e5e7eb;
  border-top: 3px solid #6366f1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  color: #6b7280;
  font-size: 0.875rem;
}

.performance-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
  text-align: center;
}

.error-icon {
  width: 4rem;
  height: 4rem;
  color: #ef4444;
  margin-bottom: 1rem;
}

.error-icon svg {
  width: 100%;
  height: 100%;
}

.performance-error h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.dark .performance-error h3 {
  color: #f3f4f6;
}

.performance-error p {
  color: #6b7280;
  margin-bottom: 1rem;
}

.retry-button {
  background: #6366f1;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
}

.retry-button:hover {
  background: #4f46e5;
}

/* No Data States */
.no-data-message, .no-insights-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
}

.no-data-icon {
  width: 3rem;
  height: 3rem;
  color: #9ca3af;
  margin-bottom: 1rem;
}

.no-data-message p, .no-insights-message p {
  color: #6b7280;
  font-size: 0.875rem;
}

.dark .no-data-message p, .dark .no-insights-message p {
  color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 768px) {
  .performance-content {
    padding: 1rem;
  }
  
  .performance-metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .index-performance-grid {
    grid-template-columns: 1fr;
  }
  
  .maintenance-grid {
    grid-template-columns: 1fr;
  }
  
  .chart-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .chart-legend {
    flex-wrap: wrap;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.performance-metric-card,
.performance-chart-section,
.performance-section,
.insight-card {
  animation: fadeIn 0.3s ease-out;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}