/* --- Dashboard Layout --- */
.dashboard-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem;
  color: white;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* --- Redesigned Cards (Global Align) --- */
.dashboard-card {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 2.25rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.12);
  height: 100%;
}

.card-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 2rem;
  opacity: 0.6;
  font-weight: 700;
}

/* --- Stats Row --- */
.stats-row {
  display: flex;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.big-stat {
  display: flex;
  flex-direction: column;
}

.big-stat .stat-value {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  line-height: 1;
}
.big-stat .stat-value small { font-size: 1rem; opacity: 0.5; margin-left: 2px; }
.big-stat .stat-label { font-size: 0.85rem; opacity: 0.6; margin-top: 0.5rem; font-weight: 500; }

/* --- Volume Chart --- */
.distribution-chart { margin-top: 0.5rem; }
.chart-label { display: block; margin-bottom: 1rem; font-size: 0.85rem; opacity: 0.6; font-weight: 500; }
.bar-container {
  height: 10px;
  background: rgba(255,255,255,0.08);
  border-radius: 5px;
  display: flex;
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.bar-segment { height: 100%; transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.bar-segment.run { background: #ff4d4d; }
.bar-segment.ride { background: #4dabff; }
.bar-segment.swim { background: #4dff88; }
.bar-segment.weighttraining { background: #ff9f43; } /* Bold Orange for Lifting */
.bar-segment.other { background: #ffcc4d; }

.bar-legend { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; opacity: 0.7; }
.legend-item .dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-item .dot.run { background: #ff4d4d; }
.legend-item .dot.ride { background: #4dabff; }
.legend-item .dot.swim { background: #4dff88; }
.legend-item .dot.weighttraining { background: #ff9f43; }

/* --- Weekly Insights --- */
.insights-list { display: flex; flex-direction: column; gap: 1.5rem; }
.insight-row { display: flex; align-items: center; gap: 1.25rem; }
.insight-icon { font-size: 1.4rem; background: rgba(255,255,255,0.08); width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 14px; flex-shrink: 0; }
.insight-content { display: flex; flex-direction: column; }
.insight-label { font-size: 0.7rem; opacity: 0.5; text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px; }
.insight-value { font-size: 1.15rem; font-weight: 700; }

/* --- Stats Comparison Grid --- */
.stats-comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

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

.mini-stat {
  display: flex;
  flex-direction: column;
}

.mini-stat .m-val {
  font-size: clamp(1.15rem, 3vw, 1.4rem);
  font-weight: 700;
  line-height: 1.2;
}

.mini-stat .m-val small {
  font-size: 0.75rem;
  opacity: 0.5;
  font-weight: 500;
}

.mini-stat .m-lab {
  font-size: 0.65rem;
  opacity: 0.5;
  text-transform: uppercase;
  margin-top: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* --- Heatmap --- */
.heatmap-card {
  margin-bottom: 2rem;
}

.heatmap-wrapper {
  overflow-x: auto;
  padding: 0.5rem 0 1.5rem;
  scrollbar-width: none; /* Hide scrollbar for Chrome/Safari */
}
.heatmap-wrapper::-webkit-scrollbar { display: none; }

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(53, 1fr);
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  gap: 4px;
  width: max-content;
}

.heatmap-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  transition: transform 0.1s ease;
}
.heatmap-cell:hover { transform: scale(1.2); z-index: 10; cursor: default; }

.intensity-1 { background: #0e4429; }
.intensity-2 { background: #006d32; }
.intensity-3 { background: #26a641; }
.intensity-4 { background: #39d353; }

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 1rem;
  font-size: 0.75rem;
  opacity: 0.5;
  font-weight: 500;
}

/* --- Activity Feed --- */
.activity-section { margin-top: 2.5rem; }
.section-title { font-size: 1.6rem; margin-bottom: 1.75rem; font-weight: 800; border-left: 5px solid white; padding-left: 1.25rem; line-height: 1; }
.activity-list { display: flex; flex-direction: column; gap: 0.75rem; }
.activity-strip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.activity-strip:hover { background: rgba(255, 255, 255, 0.09); transform: translateX(8px); border-color: rgba(255,255,255,0.15); }

.activity-type-badge { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; background: rgba(255,255,255,0.1); flex-shrink: 0; }
.activity-type-badge.run { color: #ff6e6e; }
.activity-type-badge.ride { color: #6bb9ff; }

.activity-info { flex: 1; display: flex; justify-content: space-between; align-items: center; }
.activity-main-info h3 { margin: 0 0 0.25rem; font-size: 1.25rem; font-weight: 700; color: #fff; }
.activity-main-info .date { font-size: 0.85rem; opacity: 0.5; font-weight: 500; }

.activity-metrics { display: flex; gap: 2.5rem; }
.metric { display: flex; flex-direction: column; align-items: flex-end; }
.m-val { font-size: 1.15rem; font-weight: 700; color: #fff; }
.m-val small { font-size: 0.75rem; opacity: 0.5; font-weight: 500; margin-left: 1px; }
.m-lab { font-size: 0.65rem; opacity: 0.45; text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; margin-top: 0.2rem; }

/* --- Mobile Responsiveness (Crit-fix) --- */
@media (max-width: 850px) {
  .dashboard-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .stats-comparison-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .activity-info { flex-direction: column; align-items: flex-start; gap: 1.25rem; }
  .activity-metrics { width: 100%; justify-content: space-between; gap: 0; }
  .stats-row { gap: 2rem; justify-content: space-between; }
}

@media (max-width: 480px) {
  .dashboard-container { padding: 0 1rem; }
  .dashboard-card { padding: 1.75rem; }
  .stats-mini-grid { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
  .mini-stat:last-child { grid-column: span 2; padding-top: 0.75rem; border-top: 1px solid rgba(255,255,255,0.05); }
}

/* --- Final Polish --- */
.sync-footer { text-align: center; margin-top: 5rem; font-size: 0.8rem; opacity: 0.35; padding-bottom: 2rem; }

.heatmap-info {
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  font-size: 0.9rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
}

.heatmap-cell.is-selected {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
