/* ============================================================
   VANILLA UI — Button
   Identical to shadcn/ui Button (new-york style)
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  white-space: nowrap;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
  cursor: pointer;
  user-select: none;
  border: none;
  outline: none;
  text-decoration: none;
  transition:
    background-color var(--duration-fast) ease,
    color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease,
    opacity var(--duration-fast) ease;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}

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

.btn:disabled,
.btn[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.5;
}

/* ---- Variants ---- */

/* default */
.btn-default {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: var(--shadow-xs);
}
.btn-default:hover {
  background: oklch(from var(--primary) calc(l - 0.05) c h);
}
.btn-default:active { transform: scale(0.98); }

/* destructive */
.btn-destructive {
  background: var(--destructive);
  color: var(--destructive-foreground);
  box-shadow: var(--shadow-xs);
}
.btn-destructive:hover {
  opacity: 0.9;
}
.btn-destructive:active { transform: scale(0.98); }

/* outline */
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--foreground);
  box-shadow: var(--shadow-xs);
}
.btn-outline:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}
.btn-outline:active { transform: scale(0.98); }

/* secondary */
.btn-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
  opacity: 0.8;
}
.btn-secondary:active { transform: scale(0.98); }

/* ghost */
.btn-ghost {
  background: transparent;
  color: var(--foreground);
}
.btn-ghost:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}
.btn-ghost:active {
  background: var(--accent);
  transform: scale(0.98);
}

/* link */
.btn-link {
  background: transparent;
  color: var(--primary);
  text-underline-offset: 4px;
}
.btn-link:hover { text-decoration: underline; }

/* ---- Sizes ---- */

/* default */
.btn-size-default { height: 2.25rem; padding: 0 1rem; }

/* sm */
.btn-size-sm {
  height: 1.875rem;
  padding: 0 0.75rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

/* lg */
.btn-size-lg {
  height: 2.75rem;
  padding: 0 1.5rem;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

/* icon */
.btn-size-icon {
  height: 2.25rem;
  width: 2.25rem;
  padding: 0;
}

/* icon-sm */
.btn-size-icon-sm {
  height: 1.75rem;
  width: 1.75rem;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* icon-lg */
.btn-size-icon-lg {
  height: 2.75rem;
  width: 2.75rem;
  padding: 0;
}

/* ---- Button Group ---- */
.btn-group {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
}
.btn-group > .btn {
  border-radius: 0;
  border: none;
  border-right: 1px solid var(--border);
}
.btn-group > .btn:last-child { border-right: none; }
.btn-group > .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.btn-group > .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.btn-group > .btn:only-child { border-radius: var(--radius-sm); }

.btn-group-text {
  display: inline-flex;
  align-items: center;
  padding: 0 0.5rem;
  height: 1.75rem;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  border-right: 1px solid var(--border);
  background: transparent;
}
.btn-group-text:last-child { border-right: none; }
