/* ============================================================================
 * Tekla Toppings - Centralized Action Button Engine (Single Source of Truth)
 * Served live from https://app.teklatoppings.com/tekla-action-btn.css
 *
 * Canonical handle for every primary student "Action / Power Button":
 *   class="tekla-action-btn" (or attribute data-tekla-action-btn)
 * Also governs legacy app handles: .btn-primary, .btn-shimmer,
 *   .role-quiz-btn--primary, and .start-cover button.
 *
 * HOW TO SWAP ALL TEKLA ACTION BUTTONS GLOBALLY IN ONE PLACE:
 *   Swap the active values in :root below (using one of the 3 official presets
 *   saved underneath) and deploy `toppings-app`. Every connected Tekla app
 *   (Launchpad, Calendar, Interview, Resume, Course) updates automatically.
 * ========================================================================== */

@property --tekla-btn-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

:root {
  /* ACTIVE GLOBAL DEFAULT: 1. Cotton Candy Crystal (Girly Bubblegum Pink + Sky Sparkle) */
  --tekla-btn-bg: linear-gradient(105deg, #e862cf 0%, #f58ee4 24%, #ec67c9 46%, #38bdf8 72%, #f48ae0 88%, #e862cf 100%);
  --tekla-btn-rim-stops:
    #ffffff 0deg, #ffe6fb 28deg, #f59ae8 75deg, #e86fd4 135deg,
    #ffffff 180deg, #b8eeff 210deg, #38bdf8 255deg, #f7a8ec 315deg, #ffffff 360deg;
  --tekla-btn-halo-stops:
    rgba(245, 132, 224, 0.9) 0deg, rgba(232, 111, 212, 0.8) 140deg,
    rgba(56, 189, 248, 0.68) 245deg, rgba(245, 132, 224, 0.9) 360deg;
  --tekla-btn-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.56),
    inset 0 -2px 4px rgba(154, 42, 128, 0.24),
    0 10px 28px rgba(232, 111, 212, 0.42),
    0 4px 16px rgba(56, 189, 248, 0.22);
  --tekla-btn-text-shadow: 0 1px 3px rgba(96, 18, 78, 0.3);
  --tekla-btn-flow-dur: 4s;
  --tekla-btn-spin-dur: 2.8s;
}

/* SAVED ALTERNATE 2: Rose Sky Dream (Warm Peachy-Rose -> Cotton Candy -> Baby Sky) */
.tekla-action-btn--rose-sky,
[data-tekla-action-btn="rose-sky"] {
  --tekla-btn-bg: linear-gradient(105deg, #ec67d4 0%, #fb7185 30%, #f59ae8 54%, #38bdf8 78%, #ec67d4 100%);
  --tekla-btn-rim-stops:
    #ffffff 0deg, #ffe2f8 25deg, #fb7185 75deg, #f472b6 130deg,
    #ffffff 180deg, #bae6fd 210deg, #38bdf8 260deg, #f59ae8 315deg, #ffffff 360deg;
  --tekla-btn-halo-stops:
    rgba(236, 103, 212, 0.88) 0deg, rgba(251, 113, 133, 0.78) 120deg,
    rgba(56, 189, 248, 0.72) 240deg, rgba(236, 103, 212, 0.88) 360deg;
  --tekla-btn-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.56),
    inset 0 -2px 4px rgba(154, 42, 108, 0.22),
    0 10px 28px rgba(244, 114, 182, 0.4),
    0 4px 16px rgba(56, 189, 248, 0.22);
  --tekla-btn-text-shadow: 0 1px 3px rgba(102, 22, 68, 0.28);
}

/* SAVED ALTERNATE 3: Pure Bubblegum Gem (100% Vanilla Girly Bubblegum Pink + Pearl Rim) */
.tekla-action-btn--pure-bubblegum,
[data-tekla-action-btn="pure-bubblegum"] {
  --tekla-btn-bg: linear-gradient(105deg, #e052c4 0%, #f89ee9 28%, #f472b6 56%, #e86fd4 80%, #e052c4 100%);
  --tekla-btn-rim-stops:
    #ffffff 0deg, #ffe4fa 30deg, #f9a8d4 85deg, #e86fd4 140deg,
    #ffffff 180deg, #fde2f8 215deg, #f472b6 275deg, #f59ae8 325deg, #ffffff 360deg;
  --tekla-btn-halo-stops:
    rgba(244, 114, 182, 0.88) 0deg, rgba(253, 200, 245, 0.85) 120deg,
    rgba(232, 111, 212, 0.88) 240deg, rgba(244, 114, 182, 0.88) 360deg;
  --tekla-btn-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.58),
    inset 0 -2px 4px rgba(162, 34, 126, 0.24),
    0 10px 30px rgba(236, 102, 206, 0.46),
    0 4px 16px rgba(244, 114, 182, 0.3);
  --tekla-btn-text-shadow: 0 1px 3px rgba(108, 18, 82, 0.3);
  --tekla-btn-flow-dur: 3.8s;
}

/* Canonical handle styling for any newly tagged .tekla-action-btn / [data-tekla-action-btn] */
.tekla-action-btn,
[data-tekla-action-btn] {
  position: relative;
  isolation: isolate;
  overflow: visible;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: none;
  border-radius: 999px;
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  text-shadow: var(--tekla-btn-text-shadow);
  background-image:
    linear-gradient(108deg, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0.52) 50%, rgba(255, 255, 255, 0) 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 48%),
    var(--tekla-btn-bg);
  background-size: 280% 100%, 100% 100%, 260% 100%;
  background-position: -140% 0%, 0% 0%, 0% 50%;
  animation: tekla-action-flow var(--tekla-btn-flow-dur) ease-in-out infinite;
  box-shadow: var(--tekla-btn-shadow);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease, filter 0.18s ease;
}

.tekla-action-btn::before,
[data-tekla-action-btn]::before {
  content: "";
  position: absolute;
  inset: -2.2px;
  border-radius: 999px;
  padding: 2.2px;
  background: conic-gradient(from var(--tekla-btn-angle), var(--tekla-btn-rim-stops));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  animation: tekla-action-spin var(--tekla-btn-spin-dur) linear infinite;
}

.tekla-action-btn::after,
[data-tekla-action-btn]::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  z-index: -1;
  background: conic-gradient(from var(--tekla-btn-angle), var(--tekla-btn-halo-stops));
  filter: blur(13px);
  opacity: 0.52;
  pointer-events: none;
  animation: tekla-action-spin var(--tekla-btn-spin-dur) linear infinite;
  transition: opacity 180ms ease;
}

.tekla-action-btn:hover:not(:disabled):not([aria-disabled="true"]),
[data-tekla-action-btn]:hover:not(:disabled):not([aria-disabled="true"]) {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.tekla-action-btn:hover:not(:disabled):not([aria-disabled="true"])::after,
[data-tekla-action-btn]:hover:not(:disabled):not([aria-disabled="true"])::after {
  opacity: 0.84;
}

.tekla-action-btn:active:not(:disabled):not([aria-disabled="true"]),
[data-tekla-action-btn]:active:not(:disabled):not([aria-disabled="true"]) {
  transform: scale(0.985) translateY(0);
}

.tekla-action-btn:disabled,
.tekla-action-btn[aria-disabled="true"],
[data-tekla-action-btn]:disabled,
[data-tekla-action-btn][aria-disabled="true"] {
  opacity: 1;
  cursor: not-allowed;
  transform: none;
  filter: none;
  animation: none;
  box-shadow: none;
  background: var(--bg-elevated, #ffffff);
  border: 1.5px solid var(--border-strong, rgba(20, 20, 30, 0.14));
  color: var(--text-muted, #5a6470);
  -webkit-text-fill-color: var(--text-muted, #5a6470);
  text-shadow: none;
}

.tekla-action-btn:disabled::before,
.tekla-action-btn:disabled::after,
.tekla-action-btn[aria-disabled="true"]::before,
.tekla-action-btn[aria-disabled="true"]::after,
[data-tekla-action-btn]:disabled::before,
[data-tekla-action-btn]:disabled::after,
[data-tekla-action-btn][aria-disabled="true"]::before,
[data-tekla-action-btn][aria-disabled="true"]::after {
  display: none;
}

@keyframes tekla-action-spin {
  to { --tekla-btn-angle: 360deg; }
}

@keyframes tekla-action-flow {
  0% { background-position: -140% 0%, 0% 0%, 0% 50%; }
  45% { background-position: -140% 0%, 0% 0%, 88% 50%; }
  72% { background-position: 165% 0%, 0% 0%, 100% 50%; }
  100% { background-position: 165% 0%, 0% 0%, 0% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .tekla-action-btn,
  .tekla-action-btn::before,
  .tekla-action-btn::after,
  [data-tekla-action-btn],
  [data-tekla-action-btn]::before,
  [data-tekla-action-btn]::after {
    animation: none !important;
  }
}
