/* Today's classes: a small bubble in the bottom-right corner of every page, and the
   short list it opens (time, student, Join). Above the page, below dialogs and the
   portal guide; a class shown full screen covers it. */
.today-classes {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.today-classes[hidden] { display: none; }

.today-classes-bubble {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--brand-navy);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 10px 24px rgba(38, 16, 122, 0.28);
  cursor: pointer;
  opacity: 0.92;
  transition: opacity 150ms ease, transform 150ms ease;
}

.today-classes-bubble:hover,
.today-classes-bubble:focus-visible,
.today-classes-bubble[aria-expanded="true"] { opacity: 1; transform: translateY(-1px); }
.today-classes-bubble:focus-visible { outline: 3px solid var(--brand-yellow); outline-offset: 2px; }
.today-classes-bubble .ui-icon { width: 18px; height: 18px; }

/* A class is on (or about to start): green, with a soft pulse. */
.today-classes-bubble.is-now { background: #0e8a5f; opacity: 1; }
.today-classes-bubble.is-done { background: var(--surface); color: var(--muted); border: 1px solid var(--line); opacity: 0.85; }

.today-classes-pulse {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-green);
}

.today-classes-pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--accent-green);
  animation: today-classes-pulse 1.8s ease-out infinite;
}

@keyframes today-classes-pulse {
  from { opacity: 0.9; transform: scale(0.6); }
  to { opacity: 0; transform: scale(1.5); }
}

.today-classes-panel {
  order: -1;
  width: min(380px, calc(100vw - 32px));
  max-height: min(60vh, 460px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px 14px 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(22, 12, 53, 0.25);
}

.today-classes-panel[hidden] { display: none; }

.today-classes-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.today-classes-head h2 { margin: 0; color: var(--brand-navy); font-size: 1rem; }
.today-classes-head small { color: var(--muted); font-size: 0.78rem; font-weight: 700; }

.today-classes-close {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.today-classes-close:hover, .today-classes-close:focus-visible { background: var(--brand-cyan-soft); color: var(--brand-navy); }

.today-classes-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }

.today-classes-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  padding: 8px 8px 8px 10px;
}

.today-classes-item.is-now { background: var(--accent-green-soft); box-shadow: inset 3px 0 0 #0e8a5f; }
.today-classes-item.is-done { opacity: 0.55; }

.today-classes-when { display: grid; min-width: 46px; }
.today-classes-when strong { font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.today-classes-when small { display: none; }
.today-classes-name { display: grid; min-width: 0; gap: 1px; }
.today-classes-name > span { overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.today-classes-name small { color: var(--muted); font-size: 0.75rem; font-weight: 700; }

/* Under the name: "Next: Class 5 · Combinaciones de comidas", the class to open. */
/* Up to two lines: the class title is the part that matters. */
.today-classes-next,
.today-classes-name .today-classes-last {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.3;
}

.today-classes-next { color: var(--brand-cyan-strong); text-decoration: none; }
.today-classes-next b { font-weight: 900; }
.today-classes-next:hover { text-decoration: underline; }
.today-classes-next:focus-visible { outline: 3px solid var(--brand-yellow); outline-offset: 1px; border-radius: 4px; }
.today-classes-item.is-now .today-classes-next { color: #0b6e4c; }

.today-classes-join {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--brand-navy);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
}

.today-classes-join .ui-icon { width: 15px; height: 15px; }
.today-classes-item.is-now .today-classes-join { background: #0e8a5f; }
.today-classes-item.is-done .today-classes-join { background: var(--surface); color: var(--brand-navy); border: 1px solid var(--line); }
.today-classes-join:hover, .today-classes-join:focus-visible { outline: 3px solid var(--brand-yellow); outline-offset: 1px; }
.today-classes-nolink { color: var(--muted); font-size: 0.78rem; font-weight: 700; }

.today-classes-schedule {
  display: block;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--brand-cyan-strong);
  font-size: 0.85rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.today-classes-schedule:hover { text-decoration: underline; }

/* Phones: above the bottom navigation bar. */
@media (max-width: 780px) {
  .today-classes { right: 14px; bottom: 92px; }
}

@media (prefers-reduced-motion: reduce) {
  .today-classes-pulse::after { animation: none; }
  .today-classes-bubble { transition: none; }
}

@media print {
  .today-classes { display: none; }
}
