/* =====================================================
   Dashboard Content Components
   ===================================================== */

/* Dashboard Container */
.dashboard-container {
  width: 100%;
  min-width: 375px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg-darker);
  color: var(--color-text-white);
}

@media (min-width: 640px) {
  .dashboard-container {
    padding: 1rem;
  }
}

@media (min-width: 768px) {
  .dashboard-container {
    padding: 1.5rem;
  }
}

/* Dashboard Header */
.dashboard-header {
  flex-shrink: 0;
  margin-bottom: 0.5rem;
  margin-left: 2.5rem;
}

@media (min-width: 640px) {
  .dashboard-header {
    margin-bottom: 0.75rem;
  }
}

@media (min-width: 768px) {
  .dashboard-header {
    margin-bottom: 1rem;
    margin-left: 0;
  }
}

.dashboard-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.dashboard-description {
  font-size: 16px;
  color: var(--color-text-gray-500);
  margin-top: 0.125rem;
}

/* Stats Grid */
.stats-grid {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

@media (min-width: 640px) {
  .stats-grid {
    gap: 0.75rem;
    margin-bottom: 0.75rem;
  }
}

@media (min-width: 768px) {
  .stats-grid {
    margin-bottom: 1rem;
  }
}

/* Stat Card */
.stat-card {
  background-color: var(--color-bg-card);
  border-radius: var(--radius-xl);
  padding: 0.5rem;
  border: 1px solid var(--color-border-white-5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.125rem;
  box-shadow: var(--shadow-xl);
  transition: transform var(--transition-normal);
}

@media (min-width: 640px) {
  .stat-card {
    padding: 0.75rem;
    border-radius: var(--radius-2xl);
  }
}

@media (min-width: 768px) {
  .stat-card {
    padding: 1rem;
  }
}

.stat-card:hover {
  transform: scale(1.02);
}

.stat-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-gray-400);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-white);
  line-height: 1.25;
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  color: var(--color-mint);
  font-weight: 500;
}

/* Chart Card */
.chart-card {
  flex: 1;
  min-height: 0;
  background-color: var(--color-bg-card);
  border-radius: var(--radius-xl);
  padding: 0.75rem;
  border: 1px solid var(--color-border-white-5);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

@media (min-width: 640px) {
  .chart-card {
    padding: 1rem;
    border-radius: var(--radius-2xl);
  }
}

@media (min-width: 768px) {
  .chart-card {
    padding: 1.5rem;
    border-radius: var(--radius-3xl);
  }
}

.chart-header {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

@media (min-width: 640px) {
  .chart-header {
    margin-bottom: 0.75rem;
  }
}

@media (min-width: 768px) {
  .chart-header {
    margin-bottom: 1rem;
  }
}

.chart-title {
  font-size: 8px;
  font-weight: 700;
  color: var(--color-text-gray-400);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.chart-legend {
  display: flex;
  gap: 0.375rem;
  align-items: center;
}

.chart-legend-dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: var(--radius-full);
  background-color: var(--color-mint);
}

.chart-legend-text {
  font-size: 14px;
  color: var(--color-text-gray-400);
}

.chart-container {
  flex: 1;
  position: relative;
  min-height: 0;
}

.chart-badge {
  position: absolute;
  top: 45%;
  left: 55%;
  transform: translate(-50%, -100%);
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.chart-badge-value {
  background-color: var(--color-mint);
  color: var(--color-bg-dark);
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-md);
  font-size: 9px;
  font-weight: 700;
  box-shadow: 0 20px 25px -5px rgba(166, 255, 234, 0.2);
}

.chart-badge-line {
  width: 2px;
  height: 0.5rem;
  background-color: rgba(166, 255, 234, 0.5);
  margin-top: 0.125rem;
}

@media (min-width: 640px) {
  .chart-badge-line {
    height: 0.75rem;
  }
}

.chart-xaxis {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding: 0 0.5rem;
  font-size: 8px;
  color: var(--color-text-gray-500);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-top: 1px solid var(--color-border-white-5);
  padding-top: 0.5rem;
}

@media (min-width: 640px) {
  .chart-xaxis {
    margin-top: 0.75rem;
    padding: 0 1rem;
    font-size: 9px;
    padding-top: 0.75rem;
  }
}

@media (min-width: 768px) {
  .chart-xaxis {
    margin-top: 1rem;
    padding: 0 1.5rem;
  }
}

/* Dashboard Header Extended */
.dashboard-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
  .dashboard-header-row {
    margin-bottom: 1rem;
    margin-left: 0;
    align-items: center;
  }
}

.dashboard-last-updated {
  font-size: 12px;
  color: var(--color-text-gray-500);
  display: none;
}

@media (min-width: 768px) {
  .dashboard-last-updated {
    display: block;
    font-size: 12px;
  }
}

/* Stats Grid 5 Columns */
.stats-grid-5 {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

@media (min-width: 640px) {
  .stats-grid-5 {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
  }
}

@media (min-width: 768px) {
  .stats-grid-5 {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Stat Trend with Direction */
.stat-trend-wrapper {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.stat-trend-icon {
  width: 10px;
  height: 10px;
}

@media (min-width: 640px) {
  .stat-trend-icon {
    width: 12px;
    height: 12px;
  }
}

.stat-trend.up {
  color: var(--color-mint);
}

.stat-trend.down {
  color: #f87171;
}

.stat-trend.neutral {
  color: var(--color-text-gray-400);
}

/* Dashboard Section */
.dashboard-section {
  margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
  .dashboard-section {
    margin-bottom: 1rem;
  }
}

.dashboard-section-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-text-white);
  margin-bottom: 0.5rem;
}

/* Chart Legend Dual (for YoY comparison) */
.chart-legend-dual {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.chart-legend-line {
  width: 1rem;
  height: 2px;
  border-radius: var(--radius-full);
}

.chart-legend-line.solid {
  background-color: var(--color-mint);
}

.chart-legend-line.dashed {
  background: repeating-linear-gradient(
    90deg,
    var(--color-purple) 0px,
    var(--color-purple) 3px,
    transparent 3px,
    transparent 6px
  );
}

/* Platform Tabs */
.platform-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
  .platform-tabs {
    margin-bottom: 1rem;
  }
}

.platform-tab {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border-gray-700);
  background-color: transparent;
  color: var(--color-text-gray-400);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

@media (min-width: 640px) {
  .platform-tab {
    padding: 0.5rem 1rem;
    /* font-size: var(--text-sm); */
    gap: 0.5rem;
  }
}

.platform-tab:hover {
  border-color: var(--color-border-gray-600);
  color: var(--color-text-gray-300);
}

.platform-tab.active {
  border-color: var(--color-mint);
  background-color: rgba(166, 255, 234, 0.1);
  color: var(--color-mint);
}

.platform-tab-icon {
  width: 0.875rem;
  height: 0.875rem;
}

@media (min-width: 640px) {
  .platform-tab-icon {
    width: 1rem;
    height: 1rem;
  }
}

/* Mode Toggle */
.mode-toggle {
  display: flex;
  flex-shrink: 0;
  border: 1px solid var(--color-border-gray-700);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.mode-btn {
  min-width: 48px;
  padding: 0.375rem 0.875rem;
  background-color: transparent;
  color: var(--color-text-gray-400);
  font-size: 16px;
  white-space: nowrap;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition-normal);
}

.mode-btn:hover {
  color: var(--color-text-gray-300);
  background-color: rgba(255, 255, 255, 0.05);
}

.mode-btn.active {
  background-color: rgba(166, 255, 234, 0.15);
  color: var(--color-mint);
}

/* Platform Metrics Grid */
.platform-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .platform-metrics-grid {
    gap: 0.75rem;
  }
}

@media (min-width: 768px) {
  .platform-metrics-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
}

/* Metric Card */
.metric-card {
  background-color: var(--color-bg-card);
  border-radius: var(--radius-xl);
  padding: 0.75rem;
  border: 1px solid var(--color-border-white-5);
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  box-shadow: var(--shadow-xl);
  transition: transform var(--transition-normal);
}

@media (min-width: 640px) {
  .metric-card {
    padding: 1rem;
    border-radius: var(--radius-2xl);
    gap: 0.5rem;
  }
}

.metric-card:hover {
  transform: scale(1.02);
}

.metric-card-header {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.metric-card-icon {
  width: 1rem;
  height: 1rem;
  color: var(--color-text-gray-400);
}

@media (min-width: 640px) {
  .metric-card-icon {
    width: 1.25rem;
    height: 1.25rem;
  }
}

.metric-card-label {
  font-size: var(--text-xs);
  color: var(--color-text-gray-400);
  font-weight: 500;
}

@media (min-width: 640px) {
  .metric-card-label {
    font-size: var(--text-sm);
  }
}

.metric-card-value {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text-white);
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.metric-card-unit {
  font-size: var(--text-xs);
  color: var(--color-text-gray-500);
  font-weight: 400;
}

.metric-card-trend {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 9px;
  font-weight: 500;
}

.metric-card-trend.up {
  color: var(--color-mint);
}

.metric-card-trend.down {
  color: #f87171;
}

.metric-card-trend-icon {
  width: 10px;
  height: 10px;
}

@media (min-width: 640px) {
  .metric-card-trend-icon {
    width: 12px;
    height: 12px;
  }
}

/* YoY Chart */
.yoy-chart-card {
  min-width: 351px;
  background-color: var(--color-bg-card);
  border-radius: var(--radius-xl);
  padding: 0.5rem;
  border: 1px solid var(--color-border-white-5);
  box-shadow: var(--shadow-xl);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

@media (min-width: 640px) {
  .yoy-chart-card {
    padding: 1rem;
    border-radius: var(--radius-2xl);
  }
}

@media (min-width: 768px) {
  .yoy-chart-card {
    padding: 1.5rem;
    margin-bottom: 1rem;
  }
}

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

@media (min-width: 768px) {
  .yoy-chart-header {
    margin-bottom: 1rem;
  }
}

.yoy-chart-container {
  position: relative;
  width: 100%;
  height: 180px;
}

@media (min-width: 640px) {
  .yoy-chart-container {
    height: 220px;
  }
}

@media (min-width: 768px) {
  .yoy-chart-container {
    height: 280px;
  }
}

.yoy-chart-svg {
  width: 100%;
  height: 100%;
}

.yoy-chart-xaxis {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding: 0;
  font-size: 8px;
  color: var(--color-text-gray-500);
  font-weight: 500;
}

@media (min-width: 640px) {
  .yoy-chart-xaxis {
    font-size: 9px;
    margin-top: 0.75rem;
  }
}

@media (min-width: 768px) {
  .yoy-chart-xaxis {
    font-size: 10px;
  }
}

/* Chart Wrapper for Tooltip */
.yoy-chart-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Chart Tooltip */
.chart-tooltip {
  background-color: rgba(28, 42, 46, 0.95);
  border: 1px solid var(--color-border-white-10);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  min-width: 120px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  z-index: 100;
  animation: tooltipFadeIn 0.2s ease;
}

@keyframes tooltipFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chart-tooltip-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-white);
  margin-bottom: 0.5rem;
  text-align: center;
}

.chart-tooltip-row {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.25rem;
}

.chart-tooltip-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}

.chart-tooltip-dot.mint {
  background-color: var(--color-mint);
}

.chart-tooltip-dot.purple {
  background-color: var(--color-purple);
}

.chart-tooltip-label {
  font-size: var(--text-xs);
  color: var(--color-text-gray-400);
  flex: 1;
}

.chart-tooltip-value {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-white);
}

.chart-tooltip-change {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border-white-5);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-mint);
  text-align: center;
}

.chart-tooltip-change.down {
  color: #ff6b6b;
}

.chart-tooltip-change.neutral {
  color: var(--color-text-gray-400);
}

/* Chart Animations */
.chart-line-animated {
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  transition: stroke-dashoffset 1.5s ease-out;
}

.chart-line-animated.visible {
  stroke-dashoffset: 0;
}

.chart-area-animated {
  opacity: 0;
  transition: opacity 0.8s ease-out 0.5s;
}

.chart-area-animated.visible {
  opacity: 1;
}

.chart-point-animated {
  opacity: 0;
  transform-origin: center;
  transition: opacity 0.3s ease;
}

.chart-point-animated.visible {
  opacity: 1;
}

/* Platform Section Card */
.platform-section-card {
  background-color: var(--color-bg-card);
  border-radius: var(--radius-xl);
  padding: 0.75rem;
  border: 1px solid var(--color-border-white-5);
  box-shadow: var(--shadow-xl);
}

@media (min-width: 640px) {
  .platform-section-card {
    padding: 1rem;
    border-radius: var(--radius-2xl);
  }
}

@media (min-width: 768px) {
  .platform-section-card {
    padding: 1.5rem;
  }
}

.platform-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .platform-section-header {
    margin-bottom: 1rem;
  }
}

/* Stats Grid 8 Columns */
.stats-grid-8 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .stats-grid-8 {
    gap: 0.75rem;
  }
}

/* Platform Metrics Grid 8 Columns */
.platform-metrics-grid-8 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .platform-metrics-grid-8 {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
  }
}

@media (min-width: 1024px) {
  .platform-metrics-grid-8 {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
}

/* Dashboard Two Column Layout */
.dashboard-two-column {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

@media (min-width: 1024px) {
  .dashboard-two-column {
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
  }
}

/* Top Content Card */
.top-content-card {
  background-color: var(--color-bg-card);
  border-radius: var(--radius-xl);
  padding: 0.75rem;
  border: 1px solid var(--color-border-white-5);
  box-shadow: var(--shadow-xl);
}

@media (min-width: 640px) {
  .top-content-card {
    padding: 1rem;
    border-radius: var(--radius-2xl);
  }
}

@media (min-width: 768px) {
  .top-content-card {
    padding: 1rem;
  }
}

.top-content-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.top-content-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: var(--radius-lg);
  background-color: var(--color-bg-card-inner);
  transition: transform var(--transition-normal);
}

.top-content-item:hover {
  transform: scale(1.01);
}

.top-content-thumbnail {
  position: relative;
  width: 80px;
  height: 45px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .top-content-thumbnail {
    width: 100px;
    height: 56px;
  }
}

.top-content-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.top-content-platform-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: var(--radius-sm);
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-content-platform-icon {
  width: 12px;
  height: 12px;
  color: white;
}

.top-content-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
}

.top-content-title {
  max-width: 215px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-content-stats {
  display: flex;
  gap: 0.75rem;
}

.top-content-stat {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 12px;
  color: var(--color-text-gray-400);
}

.top-content-stat svg {
  color: var(--color-text-gray-500);
}

.top-content-date {
  font-size: 12px;
  color: var(--color-text-gray-500);
}

/* Audience Section */
.audience-section {
  margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
  .audience-section {
    margin-bottom: 1rem;
  }
}

.audience-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .audience-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
}

.audience-card {
  background-color: var(--color-bg-card);
  border-radius: var(--radius-xl);
  padding: 1rem;
  border: 1px solid var(--color-border-white-5);
  box-shadow: var(--shadow-xl);
}

@media (min-width: 640px) {
  .audience-card {
    padding: 1.25rem;
    border-radius: var(--radius-2xl);
  }
}

.audience-card-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-gray-300);
  margin-bottom: 1rem;
}

/* Audience Bar Chart */
.audience-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.audience-bar-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.audience-bar-label {
  font-size: 14px;
  color: var(--color-text-gray-400);
  width: 60px;
  flex-shrink: 0;
}

.audience-bar-track {
  flex: 1;
  height: 8px;
  background-color: var(--color-bg-card-inner);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.audience-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-mint), var(--color-purple));
  border-radius: var(--radius-full);
  transition: width 0.5s ease-out;
}

.audience-bar-value {
  font-size: 14px;
  color: var(--color-text-white);
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* Gender Chart */
.gender-chart {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gender-chart-bars {
  display: flex;
  height: 32px;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.gender-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.5s ease-out;
}

.gender-bar span {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-bg-dark);
}

.gender-bar.male {
  background: linear-gradient(90deg, #60a5fa, #3b82f6);
}

.gender-bar.female {
  background: linear-gradient(90deg, #f472b6, #ec4899);
}

.gender-chart-labels {
  display: flex;
  justify-content: space-between;
}

.gender-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 14px;
  color: var(--color-text-gray-400);
}

.gender-label::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}

.gender-label.male::before {
  background-color: #3b82f6;
}

.gender-label.female::before {
  background-color: #ec4899;
}

