/* ============================================================
   Shared Components
   ============================================================ */

/* --- Avatar --- */
.avatar {
  border-radius: var(--radius-circle);
  object-fit: cover;
  object-position: top center;
  flex-shrink: 0;
}

.avatar-sm  { width: 40px;  height: 40px; }
.avatar-md  { width: 56px;  height: 56px; }
.avatar-lg  { width: 80px;  height: 80px; }
.avatar-xl  { width: 96px;  height: 96px; }
.avatar-2xl { width: 120px; height: 120px; }

/* --- Role Badge --- */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.role-badge[data-role="lecturer"] {
  background: var(--color-lecturer-light);
  color: var(--color-lecturer);
}

.role-badge[data-role="assistant_lead"] {
  background: var(--color-assistant-lead-light);
  color: var(--color-assistant-lead);
}

.role-badge[data-role="coach"] {
  background: var(--color-coach-light);
  color: var(--color-coach);
}

/* --- Tag --- */
.tag {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-tag-text);
  background: var(--color-tag-bg);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* --- Card --- */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: var(--space-6);
  transition: var(--transition-default);
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

/* --- Stat Callout --- */
.stat-callout {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.stat-callout__number {
  font-size: var(--text-4xl);
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

.stat-callout__label {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

/* --- Tooltip --- */
.tooltip {
  position: absolute;
  z-index: 100;
  background: var(--color-text-primary);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow-tooltip);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Section Nav (dot navigation) --- */
#section-nav {
  position: fixed;
  right: var(--space-6);
  top: 50%;
  transform: translateY(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 6px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  transition: background 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, padding 0.25s ease, gap 0.25s ease;
}

#section-nav:hover {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: var(--shadow-card);
  padding: var(--space-3) var(--space-4);
  gap: 2px;
}

.nav-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.15s ease, width 0.2s ease, height 0.2s ease, border-radius 0.2s ease, padding 0.2s ease;
}

.nav-dot:hover,
.nav-dot.is-active {
  background: var(--color-accent);
  transform: scale(1.4);
}

/* 展開後的圓點指示器 */
.nav-dot::before {
  content: '';
  width: 8px;
  min-width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border);
  display: none;
}

.nav-dot.is-active::before {
  background: var(--color-accent);
}

.nav-dot::after {
  content: attr(data-label);
  display: none;
}

/* 展開狀態 */
#section-nav:hover .nav-dot {
  width: 134px;
  height: 30px;
  background: transparent;
  border-radius: var(--radius-sm);
  transform: none;
  padding: 0 var(--space-2);
}

#section-nav:hover .nav-dot:hover {
  background: var(--color-surface-hover);
}

#section-nav:hover .nav-dot.is-active {
  background: transparent;
}

#section-nav:hover .nav-dot::before {
  display: block;
}

/* 展開後：label 變成 inline flex item */
#section-nav:hover .nav-dot::after {
  display: block;
  position: static;
  opacity: 1;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  padding: 0;
  border-radius: 0;
  transform: none;
  font-family: var(--font-sans);
}

#section-nav:hover .nav-dot.is-active::after {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-semibold);
}

@media (max-width: 768px) {
  #section-nav {
    display: none;
  }
}
