/* Liquid glass buttons — ported from liquid-radio / shadcn glass segmented control */

.lg-svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

:root {
  --lg-shadow-dark:
    0 0 8px rgba(0, 0, 0, 0.03),
    0 2px 6px rgba(0, 0, 0, 0.08),
    inset 3px 3px 0.5px -3.5px rgba(255, 255, 255, 0.09),
    inset -3px -3px 0.5px -3.5px rgba(255, 255, 255, 0.85),
    inset 1px 1px 1px -0.5px rgba(255, 255, 255, 0.6),
    inset -1px -1px 1px -0.5px rgba(255, 255, 255, 0.6),
    inset 0 0 6px 6px rgba(255, 255, 255, 0.12),
    inset 0 0 2px 2px rgba(255, 255, 255, 0.06),
    0 0 12px rgba(0, 0, 0, 0.15);
  --lg-shadow-light:
    0 0 6px rgba(0, 0, 0, 0.03),
    0 2px 6px rgba(0, 0, 0, 0.08),
    inset 3px 3px 0.5px -3px rgba(0, 0, 0, 0.9),
    inset -3px -3px 0.5px -3px rgba(0, 0, 0, 0.85),
    inset 1px 1px 1px -0.5px rgba(0, 0, 0, 0.6),
    inset -1px -1px 1px -0.5px rgba(0, 0, 0, 0.6),
    inset 0 0 6px 6px rgba(0, 0, 0, 0.12),
    inset 0 0 2px 2px rgba(0, 0, 0, 0.06),
    0 0 12px rgba(255, 255, 255, 0.15);
  --lg-surface: rgba(255, 255, 255, 0.06);
  --lg-border: rgba(255, 255, 255, 0.11);
  --lg-text: rgba(255, 255, 255, 0.9);
  --lg-shadow: var(--lg-shadow-dark);
}

html[data-theme="light"] {
  --lg-surface: rgba(255, 255, 255, 0.72);
  --lg-border: rgba(28, 24, 20, 0.1);
  --lg-text: #1c1814;
  --lg-shadow: var(--lg-shadow-light);
}

.lg-btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 18px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--lg-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition:
    color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lg-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--lg-surface);
  border: 1px solid var(--lg-border);
  box-shadow: var(--lg-shadow);
  filter: url("#lg-glass");
  transition:
    background 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.3s ease;
  z-index: 0;
  pointer-events: none;
}

.lg-btn > * {
  position: relative;
  z-index: 1;
}

.lg-btn:hover {
  transform: none;
}

.lg-btn--ghost:hover {
  color: inherit;
}

.lg-btn:hover::before {
  border-color: rgba(200, 200, 208, 0.38);
}

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

.lg-btn--icon {
  width: 40px;
  min-width: 40px;
  padding: 0;
  font-size: 16px;
}

.lg-btn--sm {
  min-height: 36px;
  padding: 0 16px;
  font-size: 12.5px;
  border-radius: 11px;
}

.lg-btn--block {
  width: 100%;
}

.lg-btn--primary {
  --lg-surface: rgba(200, 200, 208, 0.28);
  --lg-border: rgba(212, 183, 106, 0.48);
  --lg-text: #1a1610;
  color: #1a1610;
}

.lg-btn--primary::before {
  background: linear-gradient(145deg, rgba(232, 232, 236, 0.72), rgba(200, 200, 208, 0.48));
}

html[data-theme="light"] .lg-btn--primary {
  --lg-text: #1a1610;
  color: #1a1610;
}

.lg-btn--primary:hover {
  color: #12100a;
}

.lg-btn--ghost {
  --lg-surface: rgba(255, 255, 255, 0.03);
  --lg-text: rgba(255, 255, 255, 0.55);
  color: rgba(255, 255, 255, 0.55);
}

.lg-btn--ghost::before {
  box-shadow: none;
  filter: none;
  border-color: rgba(255, 255, 255, 0.07);
}

.lg-btn--ghost:hover {
  color: rgba(200, 200, 208, 0.92);
}

html[data-theme="light"] .lg-btn--ghost {
  --lg-text: rgba(28, 24, 20, 0.55);
  color: rgba(28, 24, 20, 0.55);
}

.lg-btn--ghost:hover {
  color: #8a6d35;
}

.lg-btn .iconify {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* Segmented control (optional) */
.lg-segment {
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: center;
  gap: 0;
  padding: 3px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.lg-segment__thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--lg-border);
  box-shadow: var(--lg-shadow);
  filter: url("#lg-glass");
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 0;
}

.lg-segment[data-active="1"] .lg-segment__thumb {
  transform: translateX(100%);
}

.lg-segment__item {
  position: relative;
  z-index: 1;
  min-height: 34px;
  padding: 0 16px;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.48);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.25s ease;
}

.lg-segment__item.is-active {
  color: rgba(255, 255, 255, 0.95);
}

/* Dashboard bridge */
.dash2-btn.lg-btn {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  border-radius: var(--dash-radius-pill, 999px);
}

.dash2-btn.lg-btn:hover,
.dash2-btn.lg-btn:active {
  box-shadow: none;
}

.dash2-btn.lg-btn,
.dash2-btn-primary.lg-btn {
  min-height: 42px;
}

.dash2-btn.lg-btn::before,
.dash2-btn-primary.lg-btn::before {
  border-radius: inherit;
}

.dash2-btn-primary.lg-btn {
  --lg-surface: rgba(200, 200, 208, 0.28);
  --lg-border: rgba(212, 183, 106, 0.48);
  color: #1a1610;
}

.dash2-btn-ghost.lg-btn {
  --lg-surface: rgba(255, 255, 255, 0.04);
}
