/*
 * The Campus bar (CampusBar.tsx). Every class starts `cbar`, so it cannot collide with an
 * app's own styles, and every value is set here rather than taken from the app, so it
 * looks the same on every Campus site. System fonts: no app's CSP has to allow a font host.
 *
 * Gold means one thing in Campus: a school with every paid tool (Lucas, Oct 28). Green
 * means "working" on the Down Dashboard, so a tool the school has is shown with a check
 * and the word "Open", not with green.
 */

.cbar {
  --cbar-ink: #143d33;
  --cbar-text: #22302c;
  --cbar-muted: #4a5a55;
  --cbar-line: #e2ebe7;
  --cbar-mint: #eef5f1;
  --cbar-sign: #0f6b4f;
  --cbar-gold: #c9a227;
  --cbar-gold-ink: #6b4e00;
  --cbar-gold-soft: #fdf8e7;
  position: relative;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--cbar-line);
  color: var(--cbar-text);
  font:
    400 15px/1.4 system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
}

.cbar *,
.cbar *::before,
.cbar *::after {
  box-sizing: border-box;
}

.cbar--gold {
  border-bottom: 2px solid var(--cbar-gold);
}

.cbar__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 6px 16px;
}

.cbar a {
  color: inherit;
  text-decoration: none;
}

.cbar a:focus-visible,
.cbar summary:focus-visible {
  outline: 3px solid var(--cbar-sign);
  outline-offset: 2px;
  border-radius: 8px;
}

.cbar__brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 17px;
  color: var(--cbar-ink) !important;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.cbar__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #2563eb;
}

.cbar__sep {
  color: #9db3ab;
}

.cbar__current {
  font-weight: 600;
  white-space: nowrap;
}

.cbar__spacer {
  flex: 1;
}

.cbar__school {
  color: var(--cbar-muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.cbar__menu {
  position: relative;
}

.cbar__menu > summary {
  list-style: none;
  cursor: pointer;
}

.cbar__menu > summary::-webkit-details-marker {
  display: none;
}

.cbar__button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: var(--cbar-ink);
}

.cbar__button:hover,
.cbar__menu[open] > .cbar__button {
  background: #e3eee9;
}

.cbar--gold .cbar__button {
  color: var(--cbar-gold-ink);
  background: var(--cbar-gold-soft);
  box-shadow: inset 0 0 0 1.5px var(--cbar-gold);
}

.cbar__avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--cbar-ink);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.cbar--gold .cbar__avatar {
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 4px var(--cbar-gold);
}

.cbar__seal {
  position: absolute;
  right: -7px;
  bottom: -6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cbar-gold);
  border: 2px solid #fff;
  color: #fff;
}

.cbar__auth {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cbar__signup {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--cbar-sign) !important;
  font-weight: 700;
  font-size: 14px;
}

.cbar__signup:hover {
  background: var(--cbar-mint);
}

.cbar__signin {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--cbar-sign);
  color: #fff !important;
  font-weight: 700;
  font-size: 14px;
}

.cbar__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  padding: 16px;
  background: #fff;
  border: 1px solid #dbe5e0;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(20, 61, 51, 0.14);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cbar__panel--account {
  width: min(300px, calc(100vw - 24px));
  gap: 4px;
}

.cbar__panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
}

.cbar__title {
  font-weight: 800;
  font-size: 17px;
  color: var(--cbar-ink);
}

.cbar__rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cbar__row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 7px 8px;
  border-radius: 10px;
}

a.cbar__row:hover {
  background: #f4f7f6;
}

.cbar__row--here {
  background: var(--cbar-mint);
}

.cbar__icon {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: #fff;
  background: #3d4c47;
}

.cbar__icon--downdash {
  background: #1d4ed8;
}
.cbar__icon--games {
  background: #c2410c;
}
.cbar__icon--sites {
  background: #0f766e;
}
.cbar__icon--binder {
  background: #6d28d9;
}
.cbar__icon--tsnc {
  background: #1a2744;
}

.cbar__icon--muted {
  background: #f4f7f6;
  color: #6b7b76;
  box-shadow: inset 0 0 0 1.5px #b9c6c1;
}

.cbar__check {
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--cbar-ink);
  border: 2px solid #fff;
}

.cbar__name {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.cbar__tool-name {
  font-weight: 700;
}

.cbar__tagline {
  color: var(--cbar-muted);
  font-size: 13px;
}

.cbar__tag {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.cbar__tag--open {
  background: var(--cbar-mint);
  color: var(--cbar-ink);
}

.cbar__tag--free {
  background: #e3f3ea;
  color: #115c38;
  box-shadow: inset 0 0 0 1px #b5dcc5;
}

.cbar__tag--add {
  color: var(--cbar-sign);
  box-shadow: inset 0 0 0 1.5px var(--cbar-sign);
}

.cbar__tag--add::before {
  content: '+ ';
}

.cbar__tag--quiet {
  color: var(--cbar-muted);
  font-weight: 600;
}

.cbar__gold-box {
  position: relative;
  margin-top: 8px;
  padding: 22px 12px 12px;
  border: 2px solid var(--cbar-gold);
  border-radius: 14px;
  background: var(--cbar-gold-soft);
}

.cbar__gold-label {
  position: absolute;
  top: -11px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  background: #fff;
  color: var(--cbar-gold-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cbar__gold-label svg {
  color: var(--cbar-gold);
}

.cbar__tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.cbar__tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 6px;
  background: #fff;
  border: 1px solid #efe4bd;
  border-radius: 12px;
  text-align: center;
}

a.cbar__tile:hover {
  border-color: var(--cbar-gold);
}

.cbar__tile-name {
  font-size: 13px;
  font-weight: 700;
}

.cbar__free {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--cbar-line);
}

.cbar__eyebrow {
  padding: 0 4px;
  color: var(--cbar-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cbar__free-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.cbar__free-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--cbar-line);
  border-radius: 10px;
  background: #fbfcfc;
}

.cbar__free-card:hover {
  border-color: #9db3ab;
}

.cbar__free-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--cbar-ink);
}

.cbar__more {
  padding: 4px;
  color: var(--cbar-sign) !important;
  font-size: 14px;
  font-weight: 600;
}

.cbar__email {
  padding: 4px 8px 8px;
  color: var(--cbar-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.cbar__gold-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  padding: 10px 12px;
  border: 1.5px solid var(--cbar-gold);
  border-radius: 12px;
  background: var(--cbar-gold-soft);
  color: var(--cbar-gold-ink);
  font-size: 14px;
  font-weight: 700;
}

.cbar__gold-note svg {
  color: var(--cbar-gold);
}

.cbar__account-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
}

.cbar__account-link:hover {
  background: #f4f7f6;
}

/* An app's sign-out form, styled as one more line of the menu. */
.cbar__panel--account form {
  margin: 0;
}

.cbar__panel--account button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}

.cbar__panel--account button:hover {
  background: #f4f7f6;
}

@media (max-width: 640px) {
  .cbar__school,
  .cbar__sep,
  .cbar__current {
    display: none;
  }

  .cbar__tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cbar__panel {
    position: fixed;
    top: 60px;
    left: 12px;
    right: 12px;
    width: auto;
  }
}

/* The shared footer (CampusFooter.tsx). */
.cfoot {
  margin-top: 48px;
  padding: 24px 16px 32px;
  border-top: 1px solid #e2ebe7;
  color: #4a5a55;
  font:
    400 14px/1.6 system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
  text-align: center;
}

.cfoot p {
  margin: 4px 0;
}

.cfoot a {
  color: #143d33;
  font-weight: 600;
}

.cfoot__maker {
  font-size: 13px;
}
