/* NGC Floating Dynamic Tutor Matching Widget */

.ngc-match-panel {
  position: fixed;
  right: 88px;
  bottom: 28px;
  z-index: 2002;
  width: min(440px, calc(100vw - 32px));
  max-height: min(86vh, 720px);
  background: #fff;
  border: 2px solid #e2e8f0;
  border-bottom-width: 4px;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.9) translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.28s ease;
  transform-origin: bottom right;
}

.ngc-match-panel.is-open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.ngc-match-panel.ngc-match-panel--reduced-motion,
@media (prefers-reduced-motion: reduce) {
  .ngc-match-panel {
    transition: none;
    transform: none;
  }
  .ngc-match-panel.is-open {
    transform: none;
  }
  .ngc-match-fab.has-pulse .ngc-match-fab__pulse,
  .ngc-match-fab__pulse {
    animation: none !important;
    display: none;
  }
}

.ngc-match-panel__head {
  background: linear-gradient(135deg, #0f2744 0%, #1a5594 100%);
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.ngc-match-panel__title {
  font-weight: 900;
  text-transform: uppercase;
  font-size: 15px;
  letter-spacing: 0.03em;
}

.ngc-match-panel__sub {
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
  margin-top: 3px;
}

.ngc-match-panel__close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}

.ngc-match-panel__close:hover {
  background: rgba(239, 68, 68, 0.45);
  transform: scale(1.06);
}

.ngc-match-panel__close svg {
  width: 16px;
  height: 16px;
}

.ngc-match-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 18px 22px;
  -webkit-overflow-scrolling: touch;
}

.ngc-match-panel .ngc-match-wizard {
  margin: 0;
}

.ngc-match-panel .ngc-match-grid {
  grid-template-columns: 1fr;
}

.ngc-match-panel .ngc-field-row {
  grid-template-columns: 1fr;
}

/* Standalone FAB when dock is absent */
.ngc-match-fab {
  position: fixed;
  right: 24px;
  bottom: 300px;
  z-index: 2000;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #aecf61, #8fb84a);
  color: #0f2744;
  box-shadow: 0 8px 28px rgba(174, 206, 97, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
}

.ngc-match-fab.is-visible {
  display: flex;
}

.ngc-match-fab:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 14px 36px rgba(174, 206, 97, 0.55);
}

.ngc-match-fab svg {
  width: 26px;
  height: 26px;
}

.ngc-match-fab__pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(174, 206, 97, 0.65);
  animation: ngc-match-pulse 2s ease-out infinite;
  pointer-events: none;
}

@keyframes ngc-match-pulse {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1.35); opacity: 0; }
}

/* Dock match button */
.fdock-btn--match {
  background: linear-gradient(135deg, #aecf61, #8fb84a);
  color: #0f2744;
  animation: ngc-match-glow 3s ease-in-out infinite;
}

.fdock-btn--match.has-pulse::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2563eb;
  border: 2px solid #fff;
  animation: livePulse 1.8s infinite;
}

@keyframes ngc-match-glow {
  0%, 100% { box-shadow: 0 6px 22px rgba(174, 206, 97, 0.35); }
  50% { box-shadow: 0 10px 32px rgba(174, 206, 97, 0.65); }
}

@media (max-width: 600px) {
  .ngc-match-panel {
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
  }

  .ngc-match-panel.is-open {
    transform: translateY(0);
  }

  .ngc-match-fab {
    right: 14px;
    bottom: 280px;
    width: 52px;
    height: 52px;
  }
}
