/*
  Button 08 — Copy Button — standalone HTML/CSS/JS implementation.
  No build step, no framework, no external dependency: copy index.html,
  this file, and script.js into any project as-is. `--button-accent` is a
  plain custom property — override it wherever this button is used.
*/

:root {
  --button-accent: #39ff14;
  --button-foreground: #0f172a;
  --button-border: #d4d4d8;
  --button-border-hover: #a1a1aa;
}

.copy-btn {
  display: inline-flex;
  height: 2rem;
  align-items: center;
  gap: 0.375rem;
  border-radius: 0.375rem;
  border: 1px solid var(--button-border);
  background-color: #ffffff;
  padding: 0 0.625rem;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--button-foreground);
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease;
}

.copy-btn:hover {
  border-color: var(--button-border-hover);
}

.copy-btn:active {
  transform: scale(0.96);
}

.copy-btn:focus-visible {
  outline: 2px solid var(--button-accent);
  outline-offset: 2px;
}

.copy-btn__icon {
  display: flex;
  flex-shrink: 0;
  width: 0.875rem;
  height: 0.875rem;
}

.copy-btn__icon svg {
  width: 100%;
  height: 100%;
}

.copy-btn__icon--check {
  display: none;
}

.copy-btn[data-status="copied"] .copy-btn__icon--copy,
.copy-btn[data-status="error"] .copy-btn__icon--copy {
  display: none;
}

.copy-btn[data-status="copied"] .copy-btn__icon--check {
  display: flex;
}

.copy-btn__face {
  display: inline-block;
  animation: copy-btn-fade-in 180ms ease;
}

@keyframes copy-btn-fade-in {
  from {
    opacity: 0;
    transform: translateY(1px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .copy-btn {
    transition: border-color 150ms ease;
    transform: none;
  }

  .copy-btn:active {
    transform: none;
  }

  .copy-btn__face {
    animation: none;
  }
}

/*
  Page layout — the canvas this resource is presented on. Adjust or drop it
  when placing the resource inside your own layout.
*/

body {
  margin: 0;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(to bottom, #fafafa, #f4f4f5);
}
.button08-layout {
  display: flex;
  min-height: 20rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.button08-layout__card {
  width: 100%;
  max-width: 28rem;
  border-radius: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background-color: #ffffff;
  padding: 0.75rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 16px 40px -16px rgba(0, 0, 0, 0.14);
}
.button08-layout__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #d4d4d8;
  background-color: #fafafa;
  padding: 0.625rem 0.625rem 0.625rem 0.875rem;
}
.button08-layout__code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.75rem;
  color: rgba(15, 23, 42, 0.8);
}
