/* Swiffy components for the web — CSS versions of the app's shared widgets
   (lib/core/widgets/, lib/features/assistant/ui/chat_parts.dart).
   Needs tokens.css. Class prefix: sw-. */

/* Button — ElevatedButton theme: black, white Inter Tight 600 17, height 48, radius 12 */
.sw-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--sw-button-height); padding: 0 24px;
  border: 1px solid var(--sw-primary); border-radius: var(--sw-radius);
  background: var(--sw-primary); color: #fff;
  font: 600 var(--sw-title-s)/1 var(--sw-font-display);
  text-decoration: none; cursor: pointer;
  transition: opacity var(--sw-duration) var(--sw-ease), transform var(--sw-duration) var(--sw-ease);
}
.sw-button:hover { opacity: 0.82; }
.sw-button:active { transform: scale(0.98); }
.sw-button:focus-visible { outline: 2px solid var(--sw-cyan); outline-offset: 3px; }
.sw-button--light { background: var(--sw-surface); color: var(--sw-text); border-color: var(--sw-alternate); }
.sw-button--on-dark { background: #fff; color: #000; border-color: #fff; }

/* Pill — white, full radius, hairline shadow (search bar, chips, tab bar) */
.sw-pill {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: var(--sw-pill-height); padding: 0 16px;
  background: var(--sw-surface); border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--sw-radius-pill); box-shadow: var(--sw-shadow-hairline);
  font: 400 var(--sw-body-m)/1.2 var(--sw-font-body); color: var(--sw-text);
}
.sw-pill--muted { color: var(--sw-text-secondary); }

/* Card — CardSurface: white, radius 22, soft shadow, no border */
.sw-card {
  background: var(--sw-surface); border-radius: var(--sw-radius-l);
  box-shadow: var(--sw-shadow-card); padding: 20px;
}

/* Field — InputDecoration theme: white, 1px alternate border, radius 12, black on focus */
.sw-field {
  width: 100%; min-height: var(--sw-button-height); padding: 14px 16px;
  background: var(--sw-surface); border: 1px solid var(--sw-alternate); border-radius: var(--sw-radius);
  font: 400 var(--sw-body-m)/1.3 var(--sw-font-body); color: var(--sw-text);
}
.sw-field::placeholder { color: var(--sw-text-secondary); }
.sw-field:focus { outline: none; border-color: var(--sw-primary); }

/* Verified badge — Material "verified" icon in cyan */
.sw-verified { width: 18px; height: 18px; color: var(--sw-cyan); flex: none; }

/* Label — the app's label style (Inter 13, secondary text) */
.sw-label { font: 400 var(--sw-body-s)/1.4 var(--sw-font-body); color: var(--sw-text-secondary); }

/* Chat — user bubble black on the right; the assistant answers as plain text beside its orb */
.sw-bubble {
  align-self: flex-end; max-width: 78%;
  padding: 10px 16px; border-radius: var(--sw-radius-l);
  background: var(--sw-primary); color: #fff;
  font: 400 var(--sw-chat)/1.4 var(--sw-font-chat);
}
.sw-assistant { display: flex; align-items: flex-start; gap: 10px; font: 400 var(--sw-chat)/1.45 var(--sw-font-chat); color: var(--sw-text); }
.sw-assistant .sw-orb { --size: 26px; margin-top: 1px; }

/* Orb — the assistant's face: a turning cyan/teal/sky sweep, blurred, lit from the top left */
.sw-orb {
  --size: 160px;
  position: relative; flex: none; width: var(--size); height: var(--size);
  border-radius: 50%; overflow: hidden; isolation: isolate;
  box-shadow: 0 0 calc(var(--size) * 0.4) rgba(0, 192, 255, 0.32);
}
.sw-orb::before {
  content: ""; position: absolute; inset: -25%;
  background: conic-gradient(var(--sw-cyan), var(--sw-teal), var(--sw-sky), var(--sw-cyan));
  filter: blur(calc(var(--size) * 0.16));
  animation: sw-orb-turn 9s linear infinite;
}
.sw-orb::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(85% 85% at 32% 27%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 70%);
}
@keyframes sw-orb-turn { to { transform: rotate(1turn); } }

@media (prefers-reduced-motion: reduce) {
  .sw-orb::before { animation: none; }
  .sw-button { transition: none; }
}
