/* Advanced Analytics Module Styles */

.analytics-wrapper {
  padding: 20px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 12px;
  margin: 20px 0;
}

.analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 20px;
}

.analytics-header h2 {
  font-size: 28px;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}

.analytics-controls {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.period-selector,
.compare-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

.period-selector label,
.compare-selector label {
  font-weight: 600;
  color: #374151;
  font-size: 14px;
}

.period-selector select,
.compare-selector select {
  padding: 8px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  background: white;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.period-selector select:hover,
.compare-selector select:hover {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.kpi-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  display: flex;
  gap: 15px;
  align-items: flex-start;
  transition: all 0.3s ease;
  border-left: 4px solid #3b82f6;
}

.kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.kpi-card:nth-child(2) {
  border-left-color: #10b981;
}
.kpi-card:nth-child(3) {
  border-left-color: #f59e0b;
}
.kpi-card:nth-child(4) {
  border-left-color: #8b5cf6;
}
.kpi-card:nth-child(5) {
  border-left-color: #ec4899;
}
.kpi-card:nth-child(6) {
  border-left-color: #ef4444;
}

.kpi-icon {
  font-size: 32px;
  min-width: 40px;
}

.kpi-content {
  flex: 1;
}

.kpi-label {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
  margin: 8px 0;
}

.kpi-compare {
  font-size: 12px;
  color: #6b7280;
}

.kpi-change {
  font-weight: 600;
  margin-top: 4px;
}

/* Charts Container */
.charts-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.chart-section {
  background: white;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.chart-section h3 {
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
  margin-top: 0;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e5e7eb;
}

.chart-section canvas {
  max-height: 300px;
}

/* Error Box */
.error-box {
  background: #fee2e2;
  color: #991b1b;
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid #dc2626;
  font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
  .analytics-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .analytics-controls {
    width: 100%;
    flex-direction: column;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .charts-container {
    grid-template-columns: 1fr;
  }
}
