/*
 * Toggle in the top navigation bar that switches between the classic (Tapestry)
 * and the modern (Angular) frontend. Visual mirrors the Angular design: a pill
 * switch with a label to its left. Shown only when the ModernToggleShow flag is on.
 *
 * The anchor inherits "line-height: 75px" from the navbar rule, so the label and
 * the pill are vertically centered against the rest of the top-settings items via
 * vertical-align: middle (the same way the material-icons items are centered).
 */

.modern-toggle {
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.modern-toggle:hover,
.modern-toggle:focus {
  text-decoration: none;
}

.modern-toggle__label {
  font-size: 12px;
  font-weight: 300;
  color: #000;
  vertical-align: middle;
}

.modern-toggle__switch {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  margin-left: 12px;
  width: 40px;
  height: 20px;
  border-radius: 20px;
  background-color: #ced4da;
  transition: background-color 0.15s ease-in-out;
}

.modern-toggle__knob {
  position: absolute;
  top: 20%;
  left: 10%;
  width: 30%;
  height: 60%;
  border-radius: 50%;
  background-color: #fff;
  transition: left 0.15s ease-in-out;
}

/* On state: classic-app toggle is "off" by default; .is-on lights it up like the modern app. */
.modern-toggle.is-on .modern-toggle__switch {
  background-color: #204b78;
}

.modern-toggle.is-on .modern-toggle__knob {
  left: 60%;
}

/*
 * Branded splash shown while navigating from the classic to the modern frontend.
 * The overlay covers the page (navy, like the modern app), the logo scales in with
 * an overshoot and a soft red glow, and the wordmark slides in beside it. It is
 * injected by frontend/modernToggle.js on toggle click and stays up until the
 * browser navigates away.
 */
.modern-transition {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: radial-gradient(circle at 50% 45%, #213a63 0%, #16243f 70%);
  opacity: 0;
  animation: modern-transition-fade 0.3s ease forwards;
}

.modern-transition__brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.modern-transition__logo {
  width: 88px;
  height: 88px;
  background: url("/assets/meta/6468976c/css/images/amc-logo.png") center / contain no-repeat;
  opacity: 0;
  transform: scale(0.4);
  animation:
    modern-transition-logo 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
    modern-transition-glow 1.6s ease-in-out 0.55s infinite;
}

.modern-transition__wordmark {
  color: #fff;
  font-size: 40px;
  font-weight: 500;
  letter-spacing: 0.5px;
  opacity: 0;
  transform: translateX(-12px);
  animation:
    modern-transition-word 0.45s ease 0.25s forwards,
    modern-transition-word-glow 1.6s ease-in-out 0.55s infinite;
}

@keyframes modern-transition-fade {
  to {
    opacity: 1;
  }
}

@keyframes modern-transition-logo {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes modern-transition-word {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes modern-transition-glow {
  0%,
  100% {
    filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.45));
  }
  50% {
    filter: drop-shadow(0 0 22px rgba(239, 68, 68, 0.85))
      drop-shadow(0 0 44px rgba(239, 68, 68, 0.5));
  }
}

/* Wordmark glow mirrors the sidebar title's hover text-shadow, pulsing with the logo. */
@keyframes modern-transition-word-glow {
  0%,
  100% {
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.4);
  }
  50% {
    text-shadow:
      0 0 10px rgba(255, 255, 255, 0.85),
      0 0 24px rgba(255, 255, 255, 0.5);
  }
}

/* Respect users who prefer less motion: keep the brand splash, drop the movement. */
@media (prefers-reduced-motion: reduce) {
  .modern-transition__logo,
  .modern-transition__wordmark {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
