/* ═══════════════════════════════════════════════════
   CET-4/6 Learning App — Stats Styles
   ═══════════════════════════════════════════════════ */

/* ─── Overview Cards ─── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: box-shadow var(--ease);
}
.stat-card:hover { box-shadow: var(--shadow); }
.stat-card .stat-icon { font-size: 2rem; margin-bottom: 8px; }
.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}
.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── Calendar ─── */
.study-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar-header {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px;
}
.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: default;
  transition: all var(--ease);
  background: var(--bg-card-hover);
}
.calendar-day.empty { background: transparent; }
.calendar-day.today {
  border: 2px solid var(--accent);
  font-weight: 700;
}
.calendar-day.studied {
  background: var(--success);
  color: white;
}
.calendar-day.studied-light {
  background: rgba(22, 163, 74, 0.3);
  color: var(--text-primary);
}
.calendar-day.studied-medium {
  background: rgba(22, 163, 74, 0.6);
  color: white;
}

/* ─── Charts (CSS-only) ─── */
.chart-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.chart-bar .bar-label {
  width: 80px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: right;
  flex-shrink: 0;
}
.chart-bar .bar-track {
  flex: 1;
  height: 24px;
  background: var(--bg-card-hover);
  border-radius: 12px;
  overflow: hidden;
}
.chart-bar .bar-fill {
  height: 100%;
  border-radius: 12px;
  background: var(--accent);
  transition: width 1s ease;
  min-width: 4px;
}
.chart-bar .bar-value {
  width: 40px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
}

/* ─── Trend line (CSS-only approximation) ─── */
.trend-chart {
  position: relative;
  height: 200px;
  border-bottom: 2px solid var(--border);
  border-left: 2px solid var(--border);
  margin: 10px 0 30px 30px;
}
.trend-point {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  transform: translate(-50%, 50%);
  cursor: pointer;
  border: 2px solid var(--bg-card);
  box-shadow: var(--shadow-sm);
}
.trend-point::after {
  content: attr(data-label);
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.trend-line-segment {
  position: absolute;
  height: 2px;
  background: var(--accent);
  transform-origin: left center;
}

/* ─── Weakness Analysis ─── */
.weakness-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.weakness-item:last-child { border-bottom: none; }
.weakness-item .weakness-name {
  width: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}
.weakness-item .weakness-bar {
  flex: 1;
  height: 10px;
  background: var(--bg-card-hover);
  border-radius: 5px;
  overflow: hidden;
}
.weakness-item .weakness-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 1s ease;
}
.weakness-item .weakness-pct {
  width: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: right;
  flex-shrink: 0;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .study-calendar { gap: 2px; }
  .calendar-day { font-size: 0.7rem; }
  .stat-card .stat-value { font-size: 1.5rem; }
  .chart-bar .bar-label { width: 60px; font-size: 0.7rem; }
  .weakness-item .weakness-name { width: 70px; font-size: 0.75rem; }
}
