/* ==========================================================================
   Buttons — shared across the site. The base handles layout/typography so
   every CTA lines up the same way; modifiers set emphasis/color so new
   buttons stay part of the same system instead of one-off styles.
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 0.8rem 1.75rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-base),
    background var(--transition-base),
    border-color var(--transition-base),
    color var(--transition-base);
}

.btn:focus-visible {
  outline: 2px solid var(--oasis-light);
  outline-offset: 2px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none !important;
  box-shadow: none !important;
}

/* Primary — the site's main call to action (play, enter, submit). */

.btn-primary {
  color: var(--obsidian);
  background: linear-gradient(135deg, var(--oasis-light), var(--oasis-green));
}

.btn-primary:hover,
.btn-primary:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(168, 217, 59, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Secondary — outlined, for pairing next to a primary action or standing
   alone where a full-color CTA would be too loud (e.g. the IP-copy button). */

.btn-secondary {
  color: var(--text-primary);
  background: rgba(244, 246, 248, 0.04);
  border-color: var(--border-strong);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  border-color: var(--algorithm-light);
  color: var(--algorithm-light);
  background: rgba(62, 143, 217, 0.08);
}

/* Copy-feedback state — applied by js/components/copy-ip.js. Works on
   top of any variant, since the button's default look (already-green
   primary vs. outlined secondary) determines what "success" needs to
   look like: secondary fills in with the brand gradient, primary
   (already that color) gets a ring instead so the change still reads. */

.btn.is-copied {
  animation: btn-copy-pulse 400ms ease;
}

.btn-secondary.is-copied {
  color: var(--obsidian);
  background: linear-gradient(135deg, var(--oasis-light), var(--oasis-green));
  border-color: transparent;
}

.btn-primary.is-copied {
  box-shadow: 0 0 0 3px rgba(244, 246, 248, 0.3);
}

@keyframes btn-copy-pulse {
  0% {
    transform: scale(1);
  }

  40% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

/* Ghost — minimal, for low-emphasis actions inside dense UI. */

.btn-ghost {
  color: var(--text-muted);
  background: transparent;
  border-color: transparent;
  padding: 0.6rem 1.1rem;
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  color: var(--text-primary);
  background: rgba(244, 246, 248, 0.06);
}

/* Size modifiers */

.btn-sm {
  padding: 0.55rem 1.2rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1.05rem;
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }

  .btn.is-copied {
    animation: none;
  }
}
