/* buddies: the Buddies tab, classes, members, notices and tasks (see styles.css for the shared tokens and components). */

/* Micro text that isn't a heading ("Due in 3 days", "Host"): the apps keep its case and set it tight. */
.buddies-plain { letter-spacing: 0; text-transform: none; }

.buddies-link { cursor: pointer; }
.notice-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* The Buddies tab (the rest of it is in buddies-tab.css) */
.buddies-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.buddies-grid { display: flex; flex-direction: column; gap: 12px; }
.buddies-bell-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: 10px;
  border: 2px solid #fff;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

/* Forms: the fields fill the window down to the pinned button, which sits on its bottom edge. */
.buddies-form-screen { padding-top: calc(var(--safe-top) + 8px); }
.buddies-form-screen > .page-form { display: flex; flex-direction: column; min-height: 100%; }
.buddies-form-body { flex: 1 0 auto; }
.buddies-bottom {
  position: sticky;
  bottom: 0;
  z-index: 5;
  gap: 8px;
  padding: 6px 20px calc(var(--safe-bottom) + 12px);
  background: var(--bg);
}
/* The list fades out just above it, so nothing shows through behind its text. */
.buddies-bottom::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -18px;
  height: 18px;
  background: linear-gradient(to bottom, rgba(245, 243, 255, 0), var(--bg));
  pointer-events: none;
}

/* A dropping menu (a member's "more", the language field). */
.buddies-menu-catcher { position: fixed; inset: 0; z-index: 50; cursor: default; }
.buddies-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 51;
  min-width: 200px;
  max-height: 340px;
  overflow-y: auto;
  padding: 6px 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(30, 27, 75, 0.2);
  outline: none;
}
.buddies-menu.end { left: auto; right: 0; }
.buddies-menu.wide { right: 0; }
.buddies-menu-item { padding: 12px 16px; cursor: pointer; }
.buddies-menu-item.selected { background: var(--primary-tint); }

/* The class screen */
.class-share { animation: classShareIn 0.28s cubic-bezier(.2, .9, .3, 1.1) both; transform-origin: top; }
@keyframes classShareIn { from { opacity: 0; transform: translateY(-8px) scaleY(0.92); } to { opacity: 1; transform: none; } }
.class-member-grid, .class-pack-grid { display: flex; flex-direction: column; gap: 10px; }
.class-pack-grid { gap: 12px; }
.class-more { width: 36px; height: 36px; border-radius: 50%; color: var(--ink-soft); flex-shrink: 0; }

/* Tasks */
.task-activities { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.task-word-grid { display: flex; flex-direction: column; gap: 10px; }
.task-level { cursor: pointer; transition: background 0.2s; }
.task-level-divider { margin: 0 14px 0 54px; }
/* Pinned to the sheet's very bottom, over its padding, so no word shows under the button. */
.task-sheet-action {
  position: sticky;
  bottom: calc(-16px - var(--safe-bottom));
  margin: 8px 0 calc(-16px - var(--safe-bottom));
  padding: 12px 0 calc(16px + var(--safe-bottom));
  background: var(--bg);
}
.task-edit-layer { z-index: 10; }
.task-medal-pop { animation: popIn 0.55s cubic-bezier(.3, 1.8, .5, 1) both; }

/* The deadline popup: tabs, the calendar and the clock dial. */
.task-deadline { max-height: calc(100vh - 110px); overflow-y: auto; }
.task-text-btn { padding: 10px 14px; border-radius: 999px; font-size: 17px; }
.task-text-btn:disabled { cursor: default; }
.task-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; }
.task-cal-weekday { padding: 6px 0; text-align: center; font-size: 13px; font-weight: 800; color: var(--ink-soft); }
.task-cal-day {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  transition: background 0.15s, color 0.15s;
}
.task-cal-day.today { border-color: var(--primary); color: var(--primary); }
.task-cal-day.picked { background: var(--primary); border-color: var(--primary); color: #fff; }
.task-cal-day:disabled { color: rgba(30, 27, 75, 0.3); cursor: default; }
.task-cal-arrow { width: 40px; height: 40px; border-radius: 50%; color: var(--ink-soft); }
.task-cal-arrow:disabled { opacity: 0.3; cursor: default; }
.task-time-box {
  width: 96px;
  height: 72px;
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font-size: 44px;
  transition: background 0.2s, color 0.2s;
}
.task-time-box.selected { background: var(--primary-tint); color: var(--primary); }
.task-period { width: 52px; height: 35px; font-size: 14px; color: var(--ink-soft); cursor: pointer; }
.task-period.selected { background: var(--primary-tint); color: var(--primary); }
.task-dial {
  width: 256px;
  height: 256px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(239, 235, 255, 0.7);
  touch-action: none;
  user-select: none;
  cursor: pointer;
}
.task-dial > * { pointer-events: none; }
.task-dial-hand { position: absolute; left: 50%; bottom: 50%; width: 2px; background: var(--primary); transform-origin: bottom center; }
.task-dial-centre { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px; border-radius: 50%; background: var(--primary); }
.task-dial-selector {
  position: absolute;
  width: 48px;
  height: 48px;
  margin: -24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary);
}
.task-dial-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.task-dial-number { position: absolute; z-index: 1; width: 40px; height: 40px; margin: -20px; font-size: 16px; font-weight: 700; color: var(--ink); }
.task-dial-number.small { font-size: 13px; color: var(--ink-soft); }
.task-dial-number.chosen { color: #fff; }

/* Small phones: the time boxes and the dial shrink to fit the popup. */
@media (max-width: 370px) {
  .task-time-box { width: 78px; height: 62px; font-size: 36px; }
  .task-dial { transform: scale(0.84); margin: -20px 0; }
}

@media (hover: hover) {
  /* Cards that open something get a soft violet ring under the mouse. */
  .buddies-card:hover, .task-row:hover, .notice-row:hover, .class-members:hover { outline: 2px solid rgba(109, 74, 255, 0.25); }
  .buddies-link:hover { text-decoration: underline; }
  .buddies-menu-item:hover { background: var(--bg); }
  .buddies-menu-item.selected:hover { background: var(--primary-tint); }
  .class-more:hover { background: var(--primary-tint); color: var(--primary); }
  .task-level:hover { filter: brightness(0.985); }
  .task-text-btn:hover:not(:disabled) { background: var(--primary-tint); }
  .task-cal-day:hover:not(:disabled):not(.picked) { background: var(--primary-tint); }
  .task-cal-arrow:hover:not(:disabled) { background: var(--primary-tint); color: var(--primary); }
}

@media (min-width: 900px) {
  .buddies-form-screen { padding-top: 16px; }
  .buddies-bottom { padding-left: 0; padding-right: 0; }
  .task-sheet-action { bottom: -22px; margin-bottom: -22px; padding-bottom: 22px; }
  .buddies-guest { max-width: 560px; }
  .buddies-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
  /* The class on the left, its tasks on the right. */
  .class-layout { display: grid; grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); gap: 28px; align-items: start; }
  .class-member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
  .class-pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .task-page .task-activities { grid-template-columns: repeat(3, 1fr); }
  .task-word-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}

/* QR codes of invite links (QrSheet.kt): a violet card holding the code on a white tile, Stella in the middle. */
.qr-card {
  width: 100%;
  max-width: 320px;
  box-sizing: border-box;
  padding: 16px 16px 12px;
  border-radius: 30px;
  background: linear-gradient(135deg, #7C5CFF, #5B3FE0);
  box-shadow: 0 14px 30px rgba(109, 74, 255, 0.35);
}
.qr-tile { width: 100%; border-radius: 22px; overflow: hidden; background: #fff; }
.qr-code-box { position: relative; width: 100%; aspect-ratio: 1; }
.qr-code { display: block; width: 100%; height: 100%; }
.qr-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 30%;
  border: 2px solid #EFEBFF;
  background: #fff;
}
.qr-badge canvas { width: 90% !important; height: 90% !important; }
.qr-card-code { margin-top: 10px; font-size: 30px; font-weight: 900; letter-spacing: 6px; }
