/* Analytics Dashboard Styles */

.analytics-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem 2rem 1rem;
}

/* Header styles are now in shared/page_headers.css */

/* User Filter Section */
.user-filter-section {
  margin-bottom: 2rem;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.user-filter-controls {
  display: flex;
  gap: 2rem;
  align-items: center;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #2c3e50;
  margin-right: 1rem;
  display: inline-block;
}

/* Dropdown styles now inherited from shared/components.css via .pure-form */

/* Summary Cards Grid */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.summary-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.summary-card[title] {
  cursor: help;
}

.summary-card.credit {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.summary-card.esim {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.summary-card.total {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.summary-card.profit {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.card-label {
  font-size: 0.875rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.card-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.card-subtext {
  font-size: 0.875rem;
  opacity: 0.85;
}

/* Charts Container */
.charts-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.chart-wrapper {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  padding-top: 2rem;
  padding-bottom: 3rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: visible;
}

.chart-wrapper-full {
  grid-column: 1 / -1;
}

.chart-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #ecf0f1;
}

/* SVG Charts */
svg.chart {
  width: 100%;
  height: auto;
  display: block;
}

/* Pie Chart */
.pie-chart-container {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
}

.pie-chart-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.pie-segment {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.pie-segment:hover {
  opacity: 0.8;
}

/* Chart Container */
.chart-container {
  width: 100%;
  min-height: 550px;
  margin-bottom: 2rem;
  overflow: visible;
  position: relative;
}

/* Line Chart */
.line-chart-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.chart-grid-line {
  stroke: #ecf0f1;
  stroke-width: 1;
  stroke-dasharray: 2, 4;
}

.chart-axis-line {
  stroke: #bdc3c7;
  stroke-width: 2;
}

.chart-line {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line.credit {
  stroke: #f5576c;
}

.chart-line.esim {
  stroke: #00f2fe;
}

.chart-point {
  fill: white;
  stroke-width: 2;
  cursor: pointer;
}

.chart-point.credit {
  stroke: #f5576c;
}

.chart-point.esim {
  stroke: #00f2fe;
}

.chart-point:hover {
  r: 6;
}

.chart-text {
  font-size: 12px;
  fill: #7f8c8d;
}

.chart-label {
  font-size: 13px;
  fill: #34495e;
  font-weight: 500;
}

/* Legend */
.chart-legend {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #2c3e50;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}

.legend-color.credit {
  background-color: #f5576c;
}

.legend-color.esim {
  background-color: #00f2fe;
}

.legend-color.profit {
  background-color: #43e97b;
}

/* Bar Chart */
.bar-chart-svg {
  width: 100%;
  min-height: 300px;
}

.bar-rect {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.bar-rect:hover {
  opacity: 1 !important;
}

/* Breakdown Display */
.breakdown-display {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 2rem;
}

.breakdown-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.breakdown-item {
  padding: 1rem;
  border-radius: 6px;
  background: #f8f9fa;
  border-left: 4px solid #667eea;
}

.breakdown-item.credit {
  border-left-color: #f5576c;
}

.breakdown-item.esim {
  border-left-color: #00f2fe;
}

.breakdown-item[title] {
  cursor: help;
}

.breakdown-item.total {
  border-left-color: #43e97b;
}

/* Partners Table */
.partners-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.partners-table thead {
  background: #f8f9fa;
}

.partners-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
  color: #2c3e50;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #ecf0f1;
}

.partners-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #ecf0f1;
  color: #34495e;
}

.partners-table tbody tr:hover {
  background: #f8f9fa;
}

.partners-table tbody tr:last-child td {
  border-bottom: none;
}

.breakdown-item-label {
  font-size: 0.875rem;
  color: #7f8c8d;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.breakdown-item-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2c3e50;
}

.breakdown-item-percentage {
  font-size: 0.875rem;
  color: #95a5a6;
  margin-top: 0.25rem;
}

/* Admin Analytics */
.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.admin-metric {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.admin-metric-label {
  font-size: 0.875rem;
  color: #7f8c8d;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: #2c3e50;
}

/* Responsive Design */
@media (max-width: 768px) {
  .charts-container {
    grid-template-columns: 1fr;
  }

  .summary-cards {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .chart-wrapper {
    padding: 1rem;
  }

  .card-value {
    font-size: 1.5rem;
  }

  .analytics-title,
  .analytics-subtitle {
    font-size: 1.5rem;
    text-align: left !important;
  }

  .analytics-subtitle {
    font-size: inherit;
  }

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

@media (max-width: 480px) {
  .analytics-container {
    padding: 0 0.5rem;
  }

  .summary-cards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .summary-card {
    padding: 1rem;
  }

  .card-value {
    font-size: 1.25rem;
  }

  .breakdown-items {
    grid-template-columns: 1fr;
  }

  .chart-legend {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Empty State */
.analytics-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #7f8c8d;
}

.analytics-empty svg {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.analytics-empty h3 {
  color: #2c3e50;
  margin-bottom: 0.5rem;
}
