/**
 * Icon-only Midnight wallet popover — small orange card above the connect button.
 */

.midnight-wallet-icon-popover {
  position: fixed;
  z-index: 10050;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(249, 115, 22, 0.45);
  background: #0a0a0f;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(249, 115, 22, 0.08),
    0 0 22px rgba(249, 115, 22, 0.14);
}

.midnight-wallet-icon-popover__icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
}

.midnight-wallet-icon-popover__icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(15, 15, 20, 0.88);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    opacity 0.15s ease,
    transform 0.15s ease;
}

.midnight-wallet-icon-popover__icon-btn:hover:not(:disabled):not(.midnight-wallet-icon-popover__icon-btn--dimmed) {
  border-color: rgba(249, 115, 22, 0.65);
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.25), 0 0 14px rgba(249, 115, 22, 0.22);
  transform: translateY(-1px);
}

.midnight-wallet-icon-popover__icon-btn:focus-visible {
  outline: none;
  border-color: rgba(249, 115, 22, 0.75);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.35);
}

.midnight-wallet-icon-popover__icon-btn--dimmed {
  opacity: 0.45;
  cursor: pointer;
}

.midnight-wallet-icon-popover__icon-btn--dimmed:hover {
  opacity: 0.58;
}

.midnight-wallet-icon-popover__icon-btn--connecting {
  cursor: wait;
}

.midnight-wallet-icon-popover__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
  pointer-events: none;
}

.midnight-wallet-icon-popover__spinner {
  position: absolute;
  inset: -3px;
  border-radius: 14px;
  border: 2px solid rgba(148, 163, 184, 0.25);
  border-top-color: rgba(249, 115, 22, 0.95);
  animation: midnight-wallet-icon-popover-spin 0.75s linear infinite;
  pointer-events: none;
}

.midnight-wallet-icon-popover__icon-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(249, 115, 22, 0.35);
  color: rgba(248, 250, 252, 0.96);
  font-size: 0.68rem;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
  z-index: 2;
}

.midnight-wallet-icon-popover__icon-btn:hover::after,
.midnight-wallet-icon-popover__icon-btn:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.midnight-wallet-icon-popover__hint {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(249, 115, 22, 0.45);
  color: rgba(248, 250, 252, 0.96);
  font-size: 0.66rem;
  line-height: 1.2;
  white-space: nowrap;
  z-index: 3;
  pointer-events: none;
}

@keyframes midnight-wallet-icon-popover-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .midnight-wallet-icon-popover__spinner {
    animation: none;
    border-top-color: rgba(148, 163, 184, 0.55);
  }

  .midnight-wallet-icon-popover__icon-btn:hover:not(:disabled):not(.midnight-wallet-icon-popover__icon-btn--dimmed) {
    transform: none;
  }
}
