/* MMM Study — Performance Analytics Stylesheet */

.analytics-empty {
  text-align: center;
  padding: 40px 24px;
}

.empty-icon-circle {
  font-size: 40px;
  width: 72px;
  height: 72px;
  line-height: 72px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
  margin: 0 auto 16px;
  text-align: center;
}

.analytics-empty h3 {
  color: var(--blue-900);
  font-size: 20px;
  margin-bottom: 8px;
}

.analytics-empty p,
.muted {
  color: var(--ink-soft);
  font-size: 14px;
}

/* Recommended Next Action Hero Card */
.recommend-hero {
  background: linear-gradient(135deg, #0F2744 0%, #1B365D 55%, #1E3A8A 100%);
  border: 1px solid rgba(197, 155, 39, 0.45);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 10px 25px -5px rgba(15, 39, 68, 0.2);
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.recommend-hero::after {
  content: "";
  position: absolute;
  top: -30px;
  right: -30px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(197, 155, 39, 0.15) 0%, rgba(197, 155, 39, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

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

.recommend-tag {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #F7D070;
}

.recommend-badge {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}

.recommend-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

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

.recommend-title {
  color: #ffffff;
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 6px 0;
  line-height: 1.3;
}

.recommend-desc {
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.recommend-cta {
  flex-shrink: 0;
}

.recommend-btn {
  background: linear-gradient(135deg, #C59B27 0%, #D4AF37 100%);
  color: #0F2744;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  padding: 14px 24px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  box-shadow: 0 4px 14px rgba(197, 155, 39, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.recommend-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(197, 155, 39, 0.45);
}

.recommend-btn:active {
  transform: translateY(0);
}

/* Overall Performance Snapshot Card */
.overall-snapshot-card {
  margin-bottom: 24px;
}

.snapshot-header {
  margin-bottom: 18px;
}

.snapshot-header .eyebrow {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue-700);
  margin-bottom: 4px;
}

.snapshot-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--blue-900);
  margin: 0 0 4px 0;
}

.snapshot-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.snapshot-metric {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 14px;
  text-align: center;
}

.metric-num {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--blue-900);
  line-height: 1.2;
}

.metric-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-top: 6px;
}

/* Proportional Correct vs Missed Breakdown Bar */
.breakdown-wrapper {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
}

.breakdown-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}

.breakdown-title {
  color: var(--blue-900);
}

.breakdown-pct {
  color: var(--blue-700);
}

.breakdown-bar {
  height: 16px;
  border-radius: 8px;
  overflow: hidden;
  background: #E2E8F0;
  display: flex;
  width: 100%;
}

.bar-correct {
  background: #10B981;
  transition: width 0.5s ease;
}

.bar-missed {
  background: #EF4444;
  transition: width 0.5s ease;
}

.breakdown-legend {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 13px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-weight: 500;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.correct-dot {
  background: #10B981;
}

.missed-dot {
  background: #EF4444;
}

/* 6-Subject Comparative Performance */
.subject-bars-container {
  display: grid;
  gap: 12px;
}

.subject-item-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 10px;
  transition: border-color 0.15s ease;
}

.subject-item-card:hover {
  border-color: #CBD5E1;
}

.sub-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.sub-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sub-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--blue-900);
}

.sub-status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.pill-strong {
  background: #D1FAE5;
  color: #065F46;
}

.pill-moderate {
  background: #FEF3C7;
  color: #92400E;
}

.pill-weak {
  background: #FEE2E2;
  color: #991B1B;
}

.pill-unpracticed {
  background: #F1F5F9;
  color: #64748B;
}

.sub-track {
  height: 10px;
  border-radius: 5px;
  background: #E2E8F0;
  overflow: hidden;
  width: 100%;
}

.sub-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.4s ease;
}

.sub-fill.strong {
  background: #10B981;
}

.sub-fill.moderate {
  background: #F59E0B;
}

.sub-fill.weak {
  background: #EF4444;
}

.sub-fill.unpracticed {
  background: transparent;
  width: 0% !important;
}

.sub-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--ink-soft);
  flex-wrap: wrap;
  gap: 8px;
}

.sub-action-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-700);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  min-height: 36px;
  transition: all 0.15s ease;
}

.sub-action-link:hover {
  background: var(--blue-900);
  color: #ffffff;
  border-color: var(--blue-900);
}

/* Chapter Cards (Needing Attention & Strongest) */
.chapter-card-list {
  display: grid;
  gap: 10px;
}

.chapter-action-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  transition: border-color 0.15s ease;
}

.chapter-action-card:hover {
  border-color: #CBD5E1;
}

.chapter-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.chapter-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.subject-mini-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--blue-700);
  background: rgba(37, 99, 235, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
}

.missed-tag {
  font-size: 11px;
  font-weight: 700;
  color: #991B1B;
  background: #FEE2E2;
  padding: 2px 8px;
  border-radius: 6px;
}

.strong-tag {
  font-size: 11px;
  font-weight: 700;
  color: #065F46;
  background: #D1FAE5;
  padding: 2px 8px;
  border-radius: 6px;
}

.chapter-name-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--blue-900);
  line-height: 1.35;
  margin: 2px 0 0;
  font-family: 'Noto Sans Myanmar', 'Inter', sans-serif;
  word-break: break-word;
}

.chapter-stats-text {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 2px 0 0;
}

.chapter-action-cta {
  flex-shrink: 0;
}

.chapter-btn {
  background: var(--blue-900);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.chapter-btn:hover {
  background: var(--blue-700);
  transform: translateY(-1px);
}

/* Grids and Layout */
.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.leaderboard-card + .leaderboard-card,
.split-grid + .leaderboard-card {
  margin-top: 0;
}

#insights-card,
#analytics-content > .leaderboard-card {
  margin-bottom: 20px;
}

.insight-list {
  list-style: none;
  display: grid;
  gap: 10px;
}

.insight-list li {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 8px;
}

.metric-row strong {
  color: var(--blue-900);
}

.metric-row small {
  display: block;
  color: var(--ink-soft);
  margin-top: 4px;
}

.accuracy-pill {
  font-weight: 800;
  color: var(--blue-700);
  white-space: nowrap;
}

.chart-svg {
  width: 100%;
  height: 220px;
  display: block;
  overflow: visible;
}

.chart-empty,
.empty-note {
  color: var(--ink-soft);
  font-size: 14px;
  padding: 8px 0;
}

.analytics-recent-row {
  grid-template-columns: 1.1fr 1fr 1.4fr 0.7fr 0.6fr;
}

.analytics-recent-row .recent-acc {
  font-weight: 700;
  color: var(--blue-700);
}

/* Responsive Media Queries */
@media (max-width: 900px) {
  .split-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .recommend-body {
    flex-direction: column;
    align-items: stretch;
  }

  .recommend-cta {
    width: 100%;
  }

  .recommend-btn {
    width: 100%;
    min-height: 48px;
  }

  .snapshot-metrics-grid {
    grid-template-columns: 1fr;
  }

  .chapter-action-card {
    flex-direction: column;
    align-items: stretch;
  }

  .chapter-action-cta {
    width: 100%;
  }

  .chapter-btn {
    width: 100%;
    min-height: 48px;
  }

  .table-row.table-header.analytics-recent-row {
    display: none !important;
  }

  .analytics-recent-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 14px;
    margin-bottom: 10px;
  }

  .analytics-recent-row .recent-date {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-soft);
  }

  .analytics-recent-row .recent-subject {
    font-size: 15px;
    font-weight: 700;
    color: var(--blue-900);
  }

  .analytics-recent-row .recent-chapter {
    font-size: 14px;
    color: var(--ink);
  }

  .analytics-recent-row .recent-score::before {
    content: "Score: ";
    font-weight: normal;
    color: var(--ink-soft);
  }

  .analytics-recent-row .recent-score {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
  }

  .analytics-recent-row .recent-acc::before {
    content: "Accuracy: ";
    font-weight: normal;
    color: var(--ink-soft);
  }

  .analytics-recent-row .recent-acc {
    font-size: 14px;
    font-weight: 800;
    color: var(--blue-700);
  }
}

@media (max-width: 430px) {
  .study-hub-grid {
    grid-template-columns: 1fr;
  }

  .study-hub-card {
    min-height: 48px;
  }

  .sub-card-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .sub-action-link {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  .recommend-title {
    font-size: 19px;
  }
}
