/* Localsewa v32.9.10 — Provider UI migration to shadcn-compatible interaction contracts. */

/* Provider Sheet */
[role="dialog"][aria-label="Provider navigation"][data-ls-provider-surface="sheet"] {
  outline: none;
}
[role="dialog"][aria-label="Provider navigation"] [data-ls-provider-sheet-content="true"] {
  border-left: 1px solid rgb(255 255 255 / .10);
  outline: none;
}
[role="dialog"][aria-label="Provider navigation"] :is(a,button):focus-visible {
  outline: 2px solid color-mix(in srgb, #86efac 82%, white);
  outline-offset: 2px;
}

/* Provider notifications: Sheet on phone/tablet, Popover on desktop. */
[role="dialog"][aria-label="Notifications"][data-ls-provider-notifications="true"] .ls-customer-notification-surface {
  overscroll-behavior: contain;
}
@media (max-width: 767.98px) {
  [role="dialog"][aria-label="Notifications"][data-ls-provider-notifications="true"] > button[aria-label="Close notifications"] {
    background: rgb(15 23 42 / .34) !important;
    backdrop-filter: blur(2px) !important;
  }
  [role="dialog"][aria-label="Notifications"][data-ls-provider-notifications="true"] .ls-customer-notification-surface {
    inset: auto 10px max(10px, env(safe-area-inset-bottom)) 10px !important;
    width: auto !important;
    max-height: min(80dvh, 700px) !important;
    border-radius: 26px !important;
  }
}
@media (min-width: 768px) {
  [role="dialog"][aria-label="Notifications"][data-ls-provider-notifications="true"] > button[aria-label="Close notifications"] {
    background: transparent !important;
    backdrop-filter: none !important;
  }
  [role="dialog"][aria-label="Notifications"][data-ls-provider-notifications="true"] .ls-customer-notification-surface {
    left: auto !important;
    right: 20px !important;
    top: 76px !important;
    width: min(410px, calc(100vw - 32px)) !important;
    border-radius: 20px !important;
  }
}

/* Availability Switch */
button[data-ls-provider-switch="true"] {
  position: relative;
  flex: 0 0 auto;
  border: 1px solid rgb(255 255 255 / .18);
  outline: none;
  cursor: pointer;
}
button[data-ls-provider-switch="true"]:focus-visible {
  box-shadow: 0 0 0 3px rgb(134 239 172 / .30);
}
button[data-ls-provider-switch="true"][aria-checked="true"] {
  border-color: rgb(134 239 172 / .48);
}
button[data-ls-provider-switch="true"]:disabled {
  cursor: wait;
  opacity: .62;
}

/* Provider Request Tabs */
[data-ls-provider-tabs="true"] {
  scrollbar-width: none;
}
[data-ls-provider-tabs="true"]::-webkit-scrollbar { display: none; }
[data-ls-provider-tabs="true"] [role="tab"] {
  outline: none;
}
[data-ls-provider-tabs="true"] [role="tab"]:focus-visible {
  box-shadow: 0 0 0 3px rgb(22 163 74 / .16);
}
[data-ls-provider-tabs="true"] [role="tab"][aria-selected="true"] {
  border-color: #15803d !important;
}

/* Provider status badges map to the shared Badge primitive contract. */
[data-ls-provider-badge] {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  white-space: nowrap;
  line-height: 1;
}

/* Provider Request / Service AlertDialog */
[data-ls-provider-alert-dialog] {
  isolation: isolate;
}
[data-ls-provider-dialog-content="true"] {
  border: 1px solid var(--border, #dde9e1);
  color: var(--foreground, #10231a);
}
[data-ls-provider-alert-dialog] :is(button,textarea,input):focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgb(22 163 74 / .14);
}
[data-ls-provider-alert-dialog="remove-service"] [data-ls-provider-dialog-content="true"] {
  border-color: #fecaca;
}

/* Provider Services: standardized Fields/Input/Textarea/Button contract. */
[data-ls-provider-service-form="true"] {
  position: relative;
}
[data-ls-provider-service-form="true"] [data-ls-input="true"],
[data-ls-provider-service-form="true"] [data-ls-textarea="true"] {
  width: 100%;
  border-color: var(--input, #d9e4dd) !important;
  border-radius: var(--radius-md, 12px) !important;
  background: var(--background, #fff);
  color: var(--foreground, #10231a);
  font-family: var(--font-sans, Geist, ui-sans-serif, system-ui, sans-serif);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
[data-ls-provider-service-form="true"] [data-ls-input="true"]:focus,
[data-ls-provider-service-form="true"] [data-ls-textarea="true"]:focus {
  border-color: var(--ring, #16a34a) !important;
  box-shadow: 0 0 0 3px rgb(22 163 74 / .10);
}
[data-ls-provider-service-form="true"] [data-ls-button-variant="default"] {
  border-radius: var(--radius-md, 12px) !important;
  background: var(--primary, #15803d) !important;
  color: var(--primary-foreground, #fff) !important;
}
[data-ls-provider-service-form="true"] [data-ls-button-variant="outline"] {
  border: 1px solid var(--border, #dde9e1) !important;
  border-radius: var(--radius-md, 12px) !important;
  background: #fff !important;
}

/* Editing a service becomes a Drawer on mobile/tablet and Dialog on desktop. */
.ls-provider-service-edit-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10020;
  border: 0;
  background: rgb(15 23 42 / .40);
  backdrop-filter: blur(2px);
}
body.ls-provider-service-edit-open [data-ls-provider-service-form="true"][data-mode="edit"] {
  position: fixed !important;
  z-index: 10021 !important;
  left: 10px !important;
  right: 10px !important;
  bottom: max(10px, env(safe-area-inset-bottom)) !important;
  width: auto !important;
  max-height: min(82dvh, 700px) !important;
  overflow-y: auto !important;
  margin: 0 !important;
  border-radius: 24px !important;
  background: #fff !important;
  box-shadow: 0 28px 90px rgb(15 23 42 / .30) !important;
}
body.ls-provider-service-edit-open [data-ls-provider-service-form="true"][data-mode="edit"] > h2 {
  position: sticky;
  top: 0;
  z-index: 3;
  margin: -16px -16px 12px !important;
  padding: 18px 18px 14px;
  border-bottom: 1px solid #eef3f0;
  background: rgb(255 255 255 / .96);
  backdrop-filter: blur(12px);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -.02em;
}
@media (min-width: 1024px) {
  body.ls-provider-service-edit-open [data-ls-provider-service-form="true"][data-mode="edit"] {
    left: 50% !important;
    right: auto !important;
    top: 50% !important;
    bottom: auto !important;
    width: min(600px, calc(100vw - 48px)) !important;
    max-height: min(78dvh, 760px) !important;
    transform: translate(-50%, -50%) !important;
  }
}

/* Provider Profile Fields / Avatar base primitive alignment. */
body:has([data-ls-avatar="true"]) [data-ls-avatar="true"] {
  overflow: hidden;
  border-radius: 999px;
}
main [data-ls-input="true"],
main [data-ls-textarea="true"],
main [data-ls-select="true"] {
  font-family: var(--font-sans, Geist, ui-sans-serif, system-ui, sans-serif);
}
main [data-ls-input="true"]:focus-visible,
main [data-ls-textarea="true"]:focus-visible,
main [data-ls-select="true"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgb(22 163 74 / .12);
}

/* Localsewa+ dialog surface uses the shared Dialog visual contract without restyling the branded card itself. */
[data-ls-provider-premium-dialog="true"] > :not(button[aria-label^="Close"]) {
  border-color: var(--border, #dde9e1);
}

@media (prefers-reduced-motion: reduce) {
  .ls-provider-service-edit-backdrop,
  body.ls-provider-service-edit-open [data-ls-provider-service-form="true"][data-mode="edit"],
  button[data-ls-provider-switch="true"] {
    transition-duration: 1ms !important;
  }
}
