/* ==========================================================================
   JupyterHub custom branding
   Loaded after JupyterHub's own style.min.css (see templates/page.html).
   Works with both the light and the dark theme (Bootstrap data-bs-theme).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Brand colours — CHANGE THESE to your official corporate-design values
   -------------------------------------------------------------------------- */
:root {
  /* Taken from the EOlab / HSRW logos. #2980b9 is the exact EOlab blue;
     the button uses a slightly darker shade so white text meets WCAG AA contrast. */
  --brand-primary: #2471a3;        /* main brand colour (buttons, highlights) */
  --brand-primary-hover: #1b5a83;  /* a little darker, used on hover/active  */
  --brand-primary-rgb: 36, 113, 163; /* same colour as r,g,b (for transparency) */
  --brand-on-primary: #ffffff;     /* text colour on top of the brand colour  */
  --brand-accent: #2980b9;         /* EOlab blue (check marks, focus ring)    */
  --brand-text: var(--brand-primary); /* brand-coloured text and links      */
  --brand-radius: 14px;
}

/* In dark mode a dark brand blue is unreadable as text, so lighten it there */
[data-bs-theme="dark"] {
  --brand-text: #7fb3e6;
}

/* --------------------------------------------------------------------------
   2. Page frame: footer always at the bottom
   -------------------------------------------------------------------------- */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hub-footer {
  margin-top: auto;
  padding: 14px 0;
  border-top: 1px solid var(--bs-border-color);
  font-size: 0.85rem;
  color: var(--bs-secondary-color);
}

.hub-footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  align-items: center;
}

.hub-footer-left {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
}

.hub-footer-links {
  display: flex;
  gap: 18px;
}

/* Research-group logo in the bottom-right corner */
.footer-group-logo {
  margin-left: auto;
}

.footer-group-logo img {
  height: 44px;
  width: auto;
  display: block;
}

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

.hub-footer a:hover {
  color: var(--brand-text);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   3. Navbar brand (logos + hub name)
   -------------------------------------------------------------------------- */
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
}

.brand-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 3px 6px;
}

.brand-logo {
  height: 38px;
  width: auto;
  display: block;
}

/* Most university logos are made for white backgrounds:
   in dark mode, put them on a small white "chip" so they stay readable. */
[data-bs-theme="dark"] .brand-chip {
  background: #ffffff;
}

.brand-plain {
  display: inline-flex;
  align-items: center;
}

.brand-logo-uni {
  height: 48px;          /* HSRW logo: a bit larger than the rest */
}

.brand-logo-jupyter {
  height: 30px;
}

.hub-footer-text {
  font-weight: 600;
}

.brand-divider {
  width: 1px;
  height: 32px;
  background: var(--bs-border-color);
}

.brand-hubname {
  font-weight: 600;
  font-size: 1.05rem;
  margin-left: 6px;
  padding-left: 14px;
  border-left: 1px solid var(--bs-border-color);
  color: var(--bs-body-color);
}

/* --------------------------------------------------------------------------
   4. Buttons: replace Jupyter orange with the brand colour everywhere
      (.btn-jupyter = login + Start button, .btn-primary = Home page)
   -------------------------------------------------------------------------- */
.btn-jupyter,
.btn-brand,
.btn-primary {
  --bs-btn-color: var(--brand-on-primary);
  --bs-btn-bg: var(--brand-primary);
  --bs-btn-border-color: var(--brand-primary);
  --bs-btn-hover-color: var(--brand-on-primary);
  --bs-btn-hover-bg: var(--brand-primary-hover);
  --bs-btn-hover-border-color: var(--brand-primary-hover);
  --bs-btn-active-color: var(--brand-on-primary);
  --bs-btn-active-bg: var(--brand-primary-hover);
  --bs-btn-active-border-color: var(--brand-primary-hover);
  --bs-btn-focus-shadow-rgb: var(--brand-primary-rgb);
  --bs-btn-disabled-bg: var(--brand-primary);
  --bs-btn-disabled-border-color: var(--brand-primary);
  font-weight: 600;
}

.btn-brand {
  border-radius: 10px;
  padding: 0.8rem 1.25rem;
  box-shadow: 0 6px 18px rgba(var(--brand-primary-rgb), 0.25);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.btn-brand:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(var(--brand-primary-rgb), 0.32);
}

/* Visible keyboard focus (accessibility) */
.btn-brand:focus-visible,
.btn-jupyter:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   5. Login page
   -------------------------------------------------------------------------- */
/* Neutralise the default "#login-main { display: table; height: 80vh }" */
#login-main.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 420px);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
  width: 100%;
  max-width: 1120px;
  height: auto;
  margin: auto;                 /* vertical centring inside the flex body */
  padding: 40px 24px 56px;
}

.login-hero-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.brand-chip-lg {
  background: #ffffff;
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 14px rgba(0, 0, 0, 0.06);
}

.brand-chip-lg img {
  height: 76px;
  width: auto;
  display: block;
}

.login-hero h1 {
  font-size: clamp(2rem, 3.4vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.login-tagline {
  font-size: 1.15rem;
  color: var(--bs-secondary-color);
  max-width: 34rem;
  margin-bottom: 24px;
}

.login-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.login-features li {
  position: relative;
  padding-left: 30px;
}

.login-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand-accent);
}

/* white check mark drawn inside the circle */

.login-features li::after {
  content: "";
  position: absolute;
  left: 6px;
  top: calc(0.2em + 4px);
  width: 6px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.login-card {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-top: 4px solid var(--brand-primary);
  border-radius: var(--brand-radius);
  padding: 32px 28px 26px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] .login-card {
  background: var(--bs-tertiary-bg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.login-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.login-card-text {
  color: var(--bs-secondary-color);
  margin-bottom: 22px;
}

.login-footnote,
.login-help {
  font-size: 0.875rem;
  color: var(--bs-secondary-color);
  margin: 16px 0 0;
}

.login-help a,
.login-card a:not(.btn) {
  color: var(--brand-text);
}

#insecure-login-warning {
  padding: 10px;
  font-size: 0.9rem;
}

/* Centered layout: branding.login_layout = "centered" */
#login-main.login-shell.layout-centered {
  grid-template-columns: minmax(0, 440px);
  justify-content: center;
  text-align: center;
  gap: 24px;
}

.layout-centered .login-hero-logos {
  justify-content: center;
  margin-bottom: 16px;
}

.layout-centered .login-tagline {
  margin-left: auto;
  margin-right: auto;
}

.layout-centered .login-features {
  display: none;
}

/* Mirrored layout: branding.login_layout = "split-reverse" (card on the left) */
#login-main.login-shell.layout-split-reverse {
  grid-template-columns: minmax(320px, 420px) minmax(0, 1.15fr);
}

.layout-split-reverse .login-card {
  order: -1;
}

/* Mobile: stack hero above the card */
@media (max-width: 860px) {
  #login-main.login-shell,
  #login-main.login-shell.layout-split-reverse {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding-top: 24px;
  }

  /* the navbar already shows the logos on small screens */
  .login-features,
  .login-hero-logos {
    display: none;
  }

  .layout-split-reverse .login-card {
    order: 0;
  }
}

/* --------------------------------------------------------------------------
   6. Server options (spawn) page — environments as selectable cards
   -------------------------------------------------------------------------- */
.spawn-heading h1 {
  font-weight: 700;
  margin-bottom: 4px;
}

.spawn-subtitle {
  color: var(--bs-secondary-color);
  margin-bottom: 24px;
}

#kubespawner-profiles-list .profile {
  border: 1px solid var(--bs-border-color);
  border-radius: var(--brand-radius);
  padding: 14px 16px;
  margin-bottom: 14px;
  cursor: pointer;
  align-items: flex-start;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

#kubespawner-profiles-list .profile:hover {
  border-color: rgba(var(--brand-primary-rgb), 0.6);
}

#kubespawner-profiles-list .profile:has(input:checked) {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.18);
  background: rgba(var(--brand-primary-rgb), 0.05);
}

[data-bs-theme="dark"] #kubespawner-profiles-list .profile:has(input:checked) {
  border-color: var(--brand-text);
  background: rgba(var(--brand-primary-rgb), 0.18);
}

#kubespawner-profiles-list .profile .radio {
  padding: 6px 14px 0 4px;
}

#kubespawner-profiles-list input[type="radio"] {
  accent-color: var(--brand-primary);
  width: 18px;
  height: 18px;
}

#kubespawner-profiles-list .profile h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2px 0 4px;
}

#kubespawner-profiles-list .profile p {
  margin: 0;
  color: var(--bs-secondary-color);
}

/* Start button on the spawn page */
#spawn_form .btn-jupyter {
  padding: 0.75rem 1rem;
  font-size: 1.05rem;
  border-radius: 10px;
}
