/* Polished action buttons */
.moduleInfo button,
.controls button,
.nextButton,
.exportSelect,
.builder button {
  border-radius: 6px !important;
  transition: background-color .22s ease, color .22s ease, border-color .22s ease,
              box-shadow .22s ease, transform .18s ease, opacity .22s ease !important;
}

.moduleInfo button:hover:not(:disabled),
.controls button:hover:not(:disabled),
.nextButton:hover:not(:disabled),
.builder button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(1, 2, 5, .15);
}

.moduleInfo button:active:not(:disabled),
.controls button:active:not(:disabled),
.nextButton:active:not(:disabled),
.builder button:active:not(:disabled) {
  transform: translateY(0) scale(.985);
  box-shadow: 0 3px 9px rgba(1, 2, 5, .13);
}

.buttonLoading {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: progress !important;
  opacity: .78;
}

.buttonLoader {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: portalSpin .72s linear infinite;
}

@keyframes portalSpin { to { transform: rotate(360deg); } }

/* Copy-link confirmation */
.portalToast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
  padding: 14px 18px;
  border-radius: 8px;
  background: #010205;
  color: #fff;
  box-shadow: 0 18px 44px rgba(1,2,5,.28);
  opacity: 0;
  transform: translateY(14px) scale(.98);
  transition: opacity .26s ease, transform .26s ease;
  pointer-events: none;
}
.portalToastVisible { opacity: 1; transform: translateY(0) scale(1); }
.portalToastIcon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #d5001c;
  font-weight: 700;
}

/* Smooth theatre-mode layout changes */
.lesson,
.player,
.lessonSide,
.frame,
.course,
body,
main {
  transition: width .42s cubic-bezier(.22,.61,.36,1),
              max-width .42s cubic-bezier(.22,.61,.36,1),
              grid-template-columns .42s cubic-bezier(.22,.61,.36,1),
              padding .42s cubic-bezier(.22,.61,.36,1),
              margin .42s cubic-bezier(.22,.61,.36,1),
              background-color .32s ease,
              opacity .3s ease,
              transform .42s cubic-bezier(.22,.61,.36,1) !important;
}
.theatreTransitioning .player,
.theatreTransitioning .frame {
  will-change: width, max-width, transform;
}

/* Canonical email presentation */
input[type="email"] { text-transform: lowercase; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
