/**
 * Dutch for Kids Academy - Profile switcher
 *
 * Account item in the theme menu, floating fallback trigger and the
 * "Wie gaat er leren?" overlay.
 */

/* Avatar (shared) */
.dfk-profile-avatar::before {
  content: attr(data-initial);
}

.dfk-profile-avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  background-color: var(--dfk-avatar, #f86909);
  background-image: linear-gradient(150deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0) 55%, rgba(0, 0, 0, 0.14) 100%);
  color: #fff;
  font-family: var(--global-heading-font-family, inherit);
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  user-select: none;
}

.dfk-profile-avatar--xs {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  font-size: 15px;
}

.dfk-profile-avatar--lg {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  font-size: clamp(2.75rem, 8vw, 4.5rem);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dfk-profile-lock {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
}

/* Account item in the theme menu */
.dfk-profile-trigger {
  cursor: pointer;
}

.dfk-account-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  vertical-align: middle;
}

.dfk-account-menu-item > a .dfk-account-name {
  max-width: 12em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dfk-account-icon {
  width: 1.2em;
  height: 1.2em;
}

.dfk-menu-lock {
  flex: none;
  opacity: 0.6;
}

/* Switching straight from a menu link */
html.dfk-switching,
html.dfk-switching * {
  cursor: progress !important;
}

.is-switching {
  opacity: 0.7;
}

/* Desktop: icon only (like the Kadence account icon); the drawer shows the label */
.header-navigation .dfk-account-login-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Desktop: open the dropdown to the left, like the Kadence account menu did */
.header-navigation .dfk-account-menu-item > ul.sub-menu {
  left: auto;
  right: 0;
}

.dfk-profile-caret {
  flex: none;
  opacity: 0.7;
}

/* Floating trigger (pages without a menu item) */
.dfk-profile-fab {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 99999;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: #1d1714;
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  font: 600 0.9375rem/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  text-decoration: none;
}

.dfk-profile-fab:hover,
.dfk-profile-fab:focus {
  background: #33291f;
  color: #fff;
}

/* Overlay */
html.dfk-profiles-lock {
  overflow: hidden;
}

.dfk-profiles {
  --dfk-ps-accent: var(--global-palette1, #f86909);

  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 72px 16px 48px;
  border: 0;
  background: radial-gradient(120% 80% at 50% 0%, #4a250c 0%, #1f1612 55%, #110d0b 100%);
  color: #fff;
  font-family: var(--global-heading-font-family, inherit);
  overflow-y: auto;
  box-sizing: border-box;
}

.dfk-profiles[open] {
  display: flex;
}

.dfk-profiles::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

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

.dfk-profiles-step {
  width: 100%;
  max-width: 960px;
  margin: auto;
  text-align: center;
}

.dfk-profiles-step[hidden] {
  display: none;
}

.dfk-profiles .dfk-profiles-title {
  margin: 0 0 clamp(24px, 4vw, 40px);
  color: #fff;
  font-family: inherit;
  font-size: clamp(1.75rem, 4.5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: normal;
  text-transform: none;
}

.dfk-profiles-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(20px, 3vw, 36px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.dfk-profiles-grid > li {
  margin: 0;
  padding: 0;
}

.dfk-profiles-grid > li::before {
  content: none;
}

.dfk-profile-form {
  margin: 0;
}

/* Tile: reset theme button styles */
.dfk-profiles .dfk-profile-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: clamp(104px, 17vw, 168px);
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: #b3b3b3;
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
}

.dfk-profiles .dfk-profile-tile:hover,
.dfk-profiles .dfk-profile-tile:focus {
  background: none;
  box-shadow: none;
  color: #b3b3b3;
}

.dfk-profiles .dfk-profile-tile:hover,
.dfk-profiles .dfk-profile-tile:focus-visible {
  color: #fff;
}

.dfk-profiles .dfk-profile-tile:focus-visible {
  outline: none;
}

.dfk-profile-tile:hover .dfk-profile-avatar--lg,
.dfk-profile-tile:focus-visible .dfk-profile-avatar--lg {
  box-shadow: 0 0 0 3px #fff;
}

.dfk-profile-tile:focus-visible .dfk-profile-avatar--lg {
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--dfk-ps-accent);
}

.dfk-profile-tile.is-current .dfk-profile-avatar--lg {
  box-shadow: 0 0 0 3px var(--dfk-ps-accent);
}

.dfk-profile-name {
  max-width: 100%;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.dfk-profile-meta {
  margin-top: -6px;
  color: var(--dfk-ps-accent);
  font-size: 0.8125rem;
  font-weight: 700;
}

.dfk-profiles.is-busy .dfk-profile-tile {
  pointer-events: none;
}

.dfk-profiles.is-busy .dfk-profile-tile:not(.is-loading) {
  opacity: 0.4;
}

.dfk-profiles .dfk-profiles-manage {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: clamp(32px, 6vw, 56px);
  padding: 10px 22px;
  border: 1px solid #8a8a8a;
  border-radius: 999px;
  color: #b3b3b3;
  font-size: 1rem;
  text-decoration: none;
}

.dfk-profiles .dfk-profiles-manage:hover,
.dfk-profiles .dfk-profiles-manage:focus {
  border-color: #fff;
  color: #fff;
}

.dfk-profiles .dfk-profiles-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
  color: #fff;
  cursor: pointer;
}

.dfk-profiles .dfk-profiles-close:hover,
.dfk-profiles .dfk-profiles-close:focus {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Password step */
.dfk-profiles-step--password .dfk-profile-avatar--lg {
  width: 120px;
  margin-bottom: 24px;
}

.dfk-profiles-step--password .dfk-profiles-title {
  margin-bottom: 8px;
}

.dfk-profiles-hint {
  margin: 0;
  color: #b3b3b3;
  font-size: 1rem;
}

.dfk-profiles-error {
  display: inline-block;
  margin: 16px 0 0;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(220, 38, 38, 0.18);
  color: #ffb4a8;
  font-size: 0.9375rem;
}

.dfk-profiles-password {
  max-width: 340px;
  margin: 24px auto 0;
}

.dfk-profiles .dfk-profiles-password input[type="password"] {
  display: block;
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  color: #fff;
  font-size: 1.125rem;
}

.dfk-profiles .dfk-profiles-password input[type="password"]:focus {
  border-color: var(--dfk-ps-accent);
  outline: 2px solid var(--dfk-ps-accent);
  outline-offset: 0;
}

.dfk-profiles-actions {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

.dfk-profiles .dfk-profiles-button {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 12px 18px;
  border: 1px solid var(--dfk-ps-accent);
  border-radius: 999px;
  background: var(--dfk-ps-accent);
  box-shadow: none;
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
}

.dfk-profiles .dfk-profiles-button:hover,
.dfk-profiles .dfk-profiles-button:focus {
  background: var(--dfk-ps-accent);
  color: #fff;
  filter: brightness(1.08);
}

.dfk-profiles .dfk-profiles-button.is-secondary {
  border-color: rgba(255, 255, 255, 0.35);
  background: transparent;
}

.dfk-profiles .dfk-profiles-button.is-secondary:hover,
.dfk-profiles .dfk-profiles-button.is-secondary:focus {
  border-color: #fff;
  background: transparent;
  filter: none;
}

.dfk-profiles .dfk-profiles-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.dfk-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .dfk-profiles[open] {
    animation: dfk-profiles-fade 0.2s ease-out;
  }

  .dfk-profiles[open] .dfk-profiles-step {
    animation: dfk-profiles-rise 0.25s ease-out;
  }

  .dfk-profile-tile:hover .dfk-profile-avatar--lg {
    transform: scale(1.04);
  }

  .dfk-profile-tile.is-loading .dfk-profile-avatar--lg,
  .is-switching .dfk-profile-avatar {
    animation: dfk-profiles-pulse 0.9s ease-in-out infinite alternate;
  }
}

@keyframes dfk-profiles-fade {
  from {
    opacity: 0;
  }
}

@keyframes dfk-profiles-rise {
  from {
    opacity: 0;
    transform: scale(1.04);
  }
}

@keyframes dfk-profiles-pulse {
  to {
    opacity: 0.55;
  }
}
