/* Shared layout lives in style.css for consistency. */

/* ── Badge popular (jumlah akses) ────────────────────────────── */
.badge-popular {
  background: #fff4e5;
  color: #a05c00;
  border: 1px solid #f5c97a;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}

html.dark .badge-popular {
  background: rgba(245, 180, 50, 0.12);
  color: #f5c97a;
  border-color: rgba(245, 180, 50, 0.25);
}

/* ── Legend bar ──────────────────────────────────────────────── */
.legend-bar {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--color-bg-soft, #f5f9f7);
  border: 1px solid var(--color-border, #d4e4dc);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 13px;
}

.legend-label {
  font-weight: 600;
  color: var(--color-text-muted, #5a7a6a);
  white-space: nowrap;
  padding-top: 2px;
  margin-right: 4px;
}

.legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  cursor: default;
}

/* Tooltip saat hover badge */
.legend-item .legend-text {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--color-bg, #ffffff);
  border: 1px solid var(--color-border, #d4e4dc);
  border-radius: 8px;
  padding: 8px 12px;
  min-width: 180px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  z-index: 20;
  pointer-events: none;
  white-space: nowrap;
}

.legend-item:hover .legend-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.legend-text strong {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-text, #1a3a2a);
  display: block;
}

.legend-text em {
  font-size: 11.5px;
  font-style: normal;
  color: var(--color-text-muted, #5a7a6a);
  display: block;
}

/* Badge kecil khusus legend */
.icon.icon-sm {
  width: 36px;
  height: 36px;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Dark mode */
html.dark .legend-bar {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
}

html.dark .legend-text {
  background: #1a2e24;
  border-color: rgba(255,255,255,0.12);
}

html.dark .legend-text strong { color: #e0f0e8; }
html.dark .legend-text em    { color: #8ab8a0; }
html.dark .legend-label      { color: #8ab8a0; }

.student-dashboard-head { padding-bottom: 36px; }

.student-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.student-dashboard-profile,
.student-dashboard-card {
  background: var(--card, #fff);
  border: 1px solid var(--line, #d8e5de);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 18px 50px rgba(15, 77, 58, .08);
}

.student-dashboard-profile {
  position: sticky;
  top: 96px;
}

.student-profile-avatar {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--primary, #0f4d3a);
  color: #fff;
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 16px;
}

.student-profile-actions,
.student-dashboard-main,
.student-bookmark-list,
.student-activity-list {
  display: grid;
  gap: 12px;
}

.student-profile-actions { margin-top: 18px; }
.student-dashboard-main { gap: 18px; }

.student-dashboard-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.student-dashboard-summary article {
  background: var(--soft, #eef6f2);
  border: 1px solid var(--line, #d8e5de);
  border-radius: 10px;
  padding: 16px;
}

.student-dashboard-summary span,
.student-bookmark-item small,
.student-activity-item small,
.student-activity-item span {
  color: var(--muted, #62736d);
}

.student-dashboard-summary strong {
  display: block;
  margin-top: 6px;
  color: var(--primary, #0f4d3a);
  font-size: 28px;
}

.compact-title { margin-bottom: 16px; }

.student-bookmark-item,
.student-activity-item {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line, #d8e5de);
  border-radius: 10px;
  background: rgba(255,255,255,.68);
}

.student-bookmark-item {
  text-decoration: none;
  color: inherit;
}

.student-bookmark-item:hover {
  border-color: var(--primary, #0f4d3a);
  transform: translateY(-1px);
}

.student-bookmark-type {
  width: max-content;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef6f2;
  color: var(--primary, #0f4d3a);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 820px) {
  .student-dashboard-grid,
  .student-dashboard-summary {
    grid-template-columns: 1fr;
  }

  .student-dashboard-profile { position: static; }
}
