/* ==================== CREATOR ANALYTICS DASHBOARD ==================== */

.ca-dashboard {
  padding: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.ca-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.ca-title {
  font-family: 'Space Mono', monospace;
  font-size: 20px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
}

.ca-time-selector {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 3px;
}

.ca-time-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.ca-time-btn:hover {
  color: rgba(255, 255, 255, 0.6);
}

.ca-time-btn.is-active {
  background: rgba(0, 212, 255, 0.15);
  color: rgba(0, 212, 255, 0.9);
}

/* ==================== KPI CARDS ==================== */

.ca-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.ca-kpi {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  transition: border-color 0.15s;
}

.ca-kpi:hover {
  border-color: rgba(0, 212, 255, 0.2);
}

.ca-kpi-icon {
  font-size: 20px;
  margin-bottom: 6px;
}

.ca-kpi-value {
  font-family: 'Space Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2px;
}

.ca-kpi-label {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.ca-kpi-change {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
}

.ca-kpi-change.is-up { color: #34d399; }
.ca-kpi-change.is-down { color: #f87171; }

/* ==================== SECTIONS ==================== */

.ca-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.ca-section-title {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 14px;
}

/* ==================== CHART ==================== */

.ca-chart {
  min-height: 160px;
}

.ca-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 140px;
  padding-bottom: 20px;
  position: relative;
}

.ca-chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  position: relative;
}

.ca-chart-bar-group {
  display: flex;
  gap: 1px;
  align-items: flex-end;
  flex: 1;
  width: 100%;
}

.ca-chart-bar {
  flex: 1;
  min-height: 1px;
  border-radius: 2px 2px 0 0;
  transition: height 0.3s ease;
}

.ca-bar-views {
  background: rgba(0, 212, 255, 0.4);
}

.ca-bar-plays {
  background: rgba(167, 139, 250, 0.5);
}

.ca-chart-col:hover .ca-bar-views { background: rgba(0, 212, 255, 0.7); }
.ca-chart-col:hover .ca-bar-plays { background: rgba(167, 139, 250, 0.8); }

.ca-chart-label {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.2);
  position: absolute;
  bottom: 0;
  white-space: nowrap;
}

.ca-chart-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 8px;
}

.ca-legend-views, .ca-legend-plays {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
}

.ca-legend-views { color: rgba(0, 212, 255, 0.6); }
.ca-legend-plays { color: rgba(167, 139, 250, 0.6); }

.ca-chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 140px;
  color: rgba(255, 255, 255, 0.15);
  font-size: 12px;
}

/* ==================== TWO COLUMN ==================== */

.ca-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* ==================== PACK LIST ==================== */

.ca-pack-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ca-pack-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  transition: background 0.1s;
}

.ca-pack-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.ca-pack-rank {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.15);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.ca-pack-info {
  flex: 1;
  min-width: 0;
}

.ca-pack-name {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ca-pack-stats {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.25);
  margin-top: 2px;
}

.ca-trend {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.ca-trend.is-up { color: #34d399; }
.ca-trend.is-down { color: #f87171; }

/* ==================== TRAFFIC SOURCES ==================== */

.ca-source-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ca-source-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ca-source-info {
  display: flex;
  justify-content: space-between;
}

.ca-source-name {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.ca-source-visits {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
}

.ca-source-bar-bg {
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
}

.ca-source-bar {
  height: 100%;
  background: linear-gradient(90deg, rgba(0, 212, 255, 0.5), rgba(0, 212, 255, 0.3));
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ==================== GENRE BREAKDOWN ==================== */

.ca-genre-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ca-genre-row {
  display: grid;
  grid-template-columns: 10px 1fr 32px 80px;
  align-items: center;
  gap: 8px;
}

.ca-genre-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.ca-genre-name {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.ca-genre-pct {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  text-align: right;
}

.ca-genre-bar-bg {
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
}

.ca-genre-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ==================== SAMPLE HEATMAP ==================== */

.ca-sample-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ca-sample-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}

.ca-sample-heat {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 0.02));
  pointer-events: none;
  transition: width 0.4s ease;
}

.ca-sample-rank {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.15);
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.ca-sample-info {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.ca-sample-name {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ca-sample-pack {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.2);
}

.ca-sample-plays {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
  .ca-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .ca-two-col {
    grid-template-columns: 1fr;
  }

  .ca-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .ca-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ca-dashboard {
    padding: 16px;
  }
}
