/*
 * courseTicker.css
 * Styles for #course-ticker — the lesson countdown widget in the course sidebar.
 * Scoped entirely to .course-ticker / #course-ticker.
 * Uses portal CSS custom properties where available, with sensible fallbacks.
 */

.course-ticker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0 12px 0;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  line-height: 1.3;
  background: var(--surface-2, rgba(0, 0, 0, 0.04));
  border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  color: var(--text-muted, #666);
  transition: background 0.2s, border-color 0.2s;
  min-height: 28px;
  box-sizing: border-box;
}

/* Hidden state — renders but takes no space */
.course-ticker--hidden {
  display: none;
}

/* ── Live (lesson in progress) ─────────────────────────────────────────────── */
.course-ticker--live {
  background: var(--color-success-bg, rgba(34, 197, 94, 0.10));
  border-color: var(--color-success, #22c55e);
  color: var(--color-success-text, #166534);
}

/* Pulse dot */
.course-ticker__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success, #22c55e);
  flex-shrink: 0;
  animation: ct-pulse 1.6s ease-in-out infinite;
}

@keyframes ct-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.75); }
}

/* ── Upcoming ───────────────────────────────────────────────────────────────── */
.course-ticker--upcoming {
  background: var(--surface-2, rgba(0, 0, 0, 0.04));
  border-color: var(--border, rgba(0, 0, 0, 0.10));
  color: var(--text-muted, #555);
}

.course-ticker__icon {
  font-size: 0.85rem;
  flex-shrink: 0;
  line-height: 1;
}

/* ── Done ───────────────────────────────────────────────────────────────────── */
.course-ticker--done {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted, #aaa);
  font-style: italic;
}

/* ── Labels ─────────────────────────────────────────────────────────────────── */
.course-ticker__label {
  font-weight: 600;
  white-space: nowrap;
}

.course-ticker__next {
  color: var(--text-muted, #888);
  font-size: 0.74rem;
  white-space: nowrap;
  opacity: 0.85;
}

/* Separator dot between label and next */
.course-ticker__label + .course-ticker__next::before {
  content: '·';
  margin-right: 5px;
  opacity: 0.5;
}

/* ── Dark mode support ──────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  .course-ticker {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.60);
  }

  .course-ticker--live {
    background: rgba(34, 197, 94, 0.12);
    border-color: #22c55e;
    color: #86efac;
  }

  .course-ticker--done {
    background: transparent;
    border-color: transparent;
    color: rgba(255, 255, 255, 0.30);
  }

  .course-ticker__next {
    color: rgba(255, 255, 255, 0.45);
  }
}
