/* ════════════════════════════════════════════════════════════════════
   Buttons (shadcn-style) + theme toggle in the header
   ════════════════════════════════════════════════════════════════════ */

button.primary, button.btn-primary {
  background: var(--primary); color: var(--primary-foreground);
  padding: 8px 16px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  font-family: var(--font-mono);
  transition: opacity .15s, transform .15s;
}
button.primary:hover { opacity: .9; }

button.ghost, button.btn-outline {
  background: transparent; color: var(--foreground);
  border: 1px solid var(--border-strong);
  padding: 7px 14px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  transition: background .15s, border-color .15s;
}
button.ghost:hover, button.btn-outline:hover {
  background: rgba(255,255,255,.04);
}
button.danger:hover {
  color: var(--loss); border-color: rgba(228,0,20,.4);
  background: rgba(228,0,20,.06);
}
button.ghost-icon {
  background: transparent; border: 1px solid var(--border);
  color: var(--muted-foreground);
  padding: 4px 10px; border-radius: var(--radius);
  font-size: 14px;
}
button.ghost-icon:hover { color: var(--foreground); border-color: var(--border-strong); }

/* Header theme toggle — sits next to "+ Add Deal". One button, two icons
   (sun + moon) layered absolutely; opacity + rotation cross-fade based on
   the current theme so flipping feels chic rather than abrupt. */
.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* 32×32 = same vertical footprint as .primary (Calculate) and .ghost
     (+ Add Deal): font-size 13px line-height ~16 + 8/8 padding = 32. Width
     matches height so the icon button stays a square. */
  width: 32px;
  height: 32px;
  background: transparent;
  color: var(--muted-foreground);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.theme-toggle:hover {
  color: var(--foreground);
  border-color: var(--ring);
  background: var(--hover-tint, rgba(255, 255, 255, 0.04));
}
.theme-toggle svg {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  transition: opacity .28s ease, transform .28s cubic-bezier(.4, 0, .2, 1);
}
/* Default = dark theme: show moon (the current state); hide sun behind it. */
.theme-toggle .ico-sun  { opacity: 0; transform: rotate(-90deg) scale(.6); }
.theme-toggle .ico-moon { opacity: 1; transform: rotate(0)      scale(1);  }
/* Light theme: flip — sun rotates in, moon rotates out. */
:root[data-theme="light"] .theme-toggle .ico-sun  { opacity: 1; transform: rotate(0)     scale(1);  }
:root[data-theme="light"] .theme-toggle .ico-moon { opacity: 0; transform: rotate(90deg) scale(.6); }
