/* Shared profession-page interaction visuals: aligned message hint and automatic conflict story. */

/* Point the callout at the first session's actual message control. */
#run-today-preview .tap-hint {
  top: 54%;
  right: auto;
  left: 34%;
  max-width: calc(100% - 16px);
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(33, 138, 88, .9);
  opacity: .9;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

#run-today-preview .tap-hint::before {
  position: absolute;
  top: 50%;
  left: 100%;
  width: var(--message-pointer-length, 18px);
  height: 2px;
  background: var(--profession-success);
  content: "";
  transform: translateY(-50%);
}

#run-today-preview .tap-hint::after {
  position: absolute;
  top: 50%;
  left: calc(100% + var(--message-pointer-length, 18px) - 7px);
  width: 7px;
  height: 7px;
  border-top: 2px solid var(--profession-success);
  border-right: 2px solid var(--profession-success);
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

#run-today-preview .tap-hint>span {
  font-size: 18px;
  line-height: 1;
}

@keyframes pulseHint {
  0%, 100% { opacity: .86; }
  50% { opacity: .98; }
}

#run-today-preview .native-session-list .native-session:first-child .native-message-button {
  box-shadow: 0 0 0 5px rgba(33, 138, 88, .15), 0 0 0 9px rgba(33, 138, 88, .07);
  animation: messageTarget 2.4s ease-in-out infinite;
}

@keyframes messageTarget {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Tell the conflict story automatically: overlap, drag, clear slot, success. */
.conflict-demo--automatic {
  --conflict-loop: 5s;
  overflow: hidden;
}

.conflict-demo--automatic .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.conflict-demo--automatic .timeline-track {
  height: 218px;
}

.conflict-demo--automatic .timeline-track > div {
  height: 76px;
}

.conflict-demo--automatic .existing-session {
  z-index: 1;
}

.conflict-demo--automatic .session-kicker {
  display: block;
  margin-bottom: 5px;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .12em;
  opacity: .72;
}

.conflict-demo--automatic .moving-session {
  position: absolute;
  z-index: 3;
  top: 118px;
  left: 25%;
  width: 25%;
  padding: 13px;
  border: 2px solid #d67b27;
  border-radius: 13px;
  background: #fff1df;
  box-shadow: 0 10px 24px rgba(123, 66, 13, .16);
  color: #743d0c;
  will-change: left, background-color, border-color, box-shadow, opacity;
}

.conflict-demo--automatic .moving-session b,
.conflict-demo--automatic .moving-session small {
  display: block;
}

.conflict-demo--automatic .moving-session b {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conflict-demo--automatic .moving-session small {
  margin-top: 5px;
  font-size: 8px;
}

.conflict-demo--automatic .moving-time--after {
  position: absolute;
  left: 13px;
  bottom: 12px;
  opacity: 0;
}

.conflict-demo--automatic .moving-state {
  position: absolute;
  top: -10px;
  right: -9px;
  padding: 5px 7px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  font-size: 7px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.conflict-demo--automatic .moving-state--conflict {
  background: #c34d33;
}

.conflict-demo--automatic .moving-state--clear {
  background: var(--profession-success);
  opacity: 0;
  transform: scale(.7);
}

.conflict-demo--automatic .drag-finger {
  position: absolute;
  z-index: 5;
  top: 182px;
  left: 37.5%;
  color: #171218;
  filter: drop-shadow(0 6px 7px rgba(23, 18, 24, .18));
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 34px;
  line-height: 1;
  transform: translate(-50%, 12px) rotate(-8deg);
  transform-origin: 50% 0;
  will-change: left, opacity, transform;
}

.conflict-auto-status {
  width: min(390px, calc(100% - 40px));
  min-height: 64px;
  margin: 9px auto 0;
  padding: 11px 14px;
  display: flex;
  gap: 11px;
  align-items: center;
  border: 1px solid #a8ddc0;
  border-radius: 14px;
  background: #effaf4;
  box-shadow: 0 12px 28px rgba(33, 138, 88, .1);
  color: #175d3a;
  opacity: 0;
  transform: translateY(10px);
  will-change: opacity, transform;
}

.conflict-auto-status > span {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--profession-success);
  color: #fff;
  font-weight: 900;
}

.conflict-auto-status b,
.conflict-auto-status small {
  display: block;
}

.conflict-auto-status b {
  font-size: 11px;
}

.conflict-auto-status small {
  margin-top: 3px;
  color: #4c7460;
  font-size: 9px;
}

.conflict-demo--automatic.is-playing .moving-session {
  animation: moveConflictSession var(--conflict-loop) cubic-bezier(.62, .02, .25, 1) infinite;
}

.conflict-demo--automatic.is-playing .moving-time--before,
.conflict-demo--automatic.is-playing .moving-state--conflict {
  animation: hideConflictState var(--conflict-loop) ease infinite;
}

.conflict-demo--automatic.is-playing .moving-time--after {
  animation: showClearTime var(--conflict-loop) ease infinite;
}

.conflict-demo--automatic.is-playing .moving-state--clear {
  animation: showClearState var(--conflict-loop) ease infinite;
}

.conflict-demo--automatic.is-playing .drag-finger {
  animation: dragConflictFinger var(--conflict-loop) cubic-bezier(.62, .02, .25, 1) infinite;
}

.conflict-demo--automatic.is-playing .conflict-auto-status {
  animation: showConflictSuccess var(--conflict-loop) ease infinite;
}

@keyframes moveConflictSession {
  0%, 12% {
    left: 25%;
    border-color: #d67b27;
    background: #fff1df;
    box-shadow: 0 10px 24px rgba(123, 66, 13, .16);
    color: #743d0c;
    opacity: 1;
  }
  46% {
    left: 50%;
    border-color: #d67b27;
    background: #fff1df;
    box-shadow: 0 10px 24px rgba(123, 66, 13, .16);
    color: #743d0c;
  }
  52%, 84% {
    left: 50%;
    border-color: #75c79b;
    background: #e5f7ed;
    box-shadow: 0 0 0 4px rgba(33, 138, 88, .11), 0 12px 28px rgba(33, 138, 88, .13);
    color: #175d3a;
    opacity: 1;
  }
  92%, 100% {
    left: 50%;
    border-color: #75c79b;
    background: #e5f7ed;
    box-shadow: 0 0 0 4px rgba(33, 138, 88, .11), 0 12px 28px rgba(33, 138, 88, .13);
    color: #175d3a;
    opacity: 0;
  }
}

@keyframes hideConflictState {
  0%, 45% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes showClearState {
  0%, 47% { opacity: 0; transform: scale(.7); }
  53%, 84% { opacity: 1; transform: scale(1); }
  92%, 100% { opacity: 0; transform: scale(.8); }
}

@keyframes showClearTime {
  0%, 47% { opacity: 0; }
  53%, 84% { opacity: 1; }
  92%, 100% { opacity: 0; }
}

@keyframes dragConflictFinger {
  0% { left: 37.5%; opacity: 0; transform: translate(-50%, 18px) rotate(-8deg); }
  8% { left: 37.5%; opacity: 1; transform: translate(-50%, 4px) rotate(-8deg); }
  12% { left: 37.5%; opacity: 1; transform: translate(-50%, 0) rotate(-8deg); }
  46% { left: 62.5%; opacity: 1; transform: translate(-50%, 0) rotate(-8deg); }
  52% { left: 62.5%; opacity: 1; transform: translate(-50%, 12px) rotate(-8deg); }
  59%, 100% { left: 62.5%; opacity: 0; transform: translate(-50%, 18px) rotate(-8deg); }
}

@keyframes showConflictSuccess {
  0%, 50% { opacity: 0; transform: translateY(10px); }
  58%, 84% { opacity: 1; transform: translateY(0); }
  92%, 100% { opacity: 0; transform: translateY(8px); }
}

@media (prefers-reduced-motion: reduce) {
  #run-today-preview .native-session-list .native-session:first-child .native-message-button {
    animation: none;
  }

  .conflict-demo--automatic .moving-session {
    left: 50%;
    border-color: #75c79b;
    background: #e5f7ed;
    color: #175d3a;
  }

  .conflict-demo--automatic .moving-time--before,
  .conflict-demo--automatic .moving-state--conflict,
  .conflict-demo--automatic .drag-finger {
    display: none;
  }

  .conflict-demo--automatic .moving-time--after,
  .conflict-demo--automatic .moving-state--clear,
  .conflict-demo--automatic .conflict-auto-status {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 620px) {
  #run-today-preview .tap-hint {
    left: 22%;
    padding: 10px 12px;
    gap: 6px;
    font-size: 9px;
  }
}
