/*
* Microsoft Fluent UI Theme for Bootstrap Controls
* Applies Fluent Design System styling to Bootstrap components
*/

/* ==================== Fluent Design Variables ==================== */
:root {
  /* Fluent Colors */
  --fluent-primary: #0078D4;
  --fluent-primary-hover: #106EBE;
  --fluent-primary-pressed: #005A9E;
  --fluent-neutral-foreground: #323130;
  --fluent-neutral-foreground-hover: #201F1E;
  --fluent-neutral-background: #FFFFFF;
  --fluent-neutral-background-hover: #F3F2F1;
  --fluent-neutral-background-pressed: #EDEBE9;
  --fluent-neutral-stroke: #8A8886;
  --fluent-neutral-stroke-hover: #605E5C;
  --fluent-border: #D1D1D1;
  --fluent-border-hover: #8A8886;
  --fluent-shadow-2: 0 0.3px 0.9px rgba(0, 0, 0, 0.1), 0 1.6px 3.6px rgba(0, 0, 0, 0.13);
  --fluent-shadow-4: 0 1.6px 3.6px rgba(0, 0, 0, 0.13), 0 0.3px 0.9px rgba(0, 0, 0, 0.1);
  --fluent-shadow-8: 0 3.2px 7.2px rgba(0, 0, 0, 0.13), 0 0.6px 1.8px rgba(0, 0, 0, 0.1);
  --fluent-shadow-16: 0 6.4px 14.4px rgba(0, 0, 0, 0.13), 0 1.2px 3.6px rgba(0, 0, 0, 0.1);
  --input-placeholder-rest: #707070;
  /* This should match ::placeholder in portalbasictheme.css */

  /* Fluent Typography */
  --fluent-font-family: "Segoe UI", "Segoe UI Web (West European)", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
  --fluent-font-size-base: 14px;
  --fluent-font-size-small: 12px;
  --fluent-font-weight-regular: 400;
  --fluent-font-weight-semibold: 600;

  /* Fluent Spacing */
  --fluent-spacing-xs: 4px;
  --fluent-spacing-sm: 8px;
  --fluent-spacing-md: 12px;
  --fluent-spacing-lg: 16px;
  --fluent-spacing-xl: 20px;

  /* Fluent Border Radius */
  --fluent-border-radius: 2px;
  --fluent-border-radius-medium: 4px;
}

.cell.form-control-cell:is(.text, .lookup) div.control {
  box-sizing: border-box;
  position: relative;
  color: inherit;
  border: calc(var(--stroke-width) * 1px) solid transparent;
  border-radius: calc(var(--control-corner-radius) * 1px);
  height: calc((var(--base-height-multiplier) + var(--density)) * var(--design-unit) * 1px);
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  background: padding-box linear-gradient(var(--neutral-fill-input-rest), var(--neutral-fill-input-rest)), border-box var(--neutral-stroke-input-rest);

  .form-control {
    outline: none;
    box-shadow: none;
    appearance: none;
    color: inherit;
    background: transparent;
    border: 0px;
    height: calc(100% - 4px);
    margin-top: auto;
    margin-bottom: auto;
    padding: 0 calc(var(--design-unit) * 2px + 1px);
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
  }

  &:not(:has(input:disabled)):active::after,
  &:not(:has(input:disabled)):focus-within:not(:active)::after {
    content: "";
    position: absolute;
    height: calc(var(--focus-stroke-width) * 1px);
    bottom: 0px;
    left: 0;
    right: 0;
    border-bottom: calc(var(--focus-stroke-width) * 1px) solid var(--accent-fill-rest);
    border-bottom-left-radius: calc(var(--control-corner-radius) * 1px);
    border-bottom-right-radius: calc(var(--control-corner-radius) * 1px);
    z-index: 2;
    transition: 300ms cubic-bezier(0.1, 0.9, 0.2, 1);
  }

  .input-group {

    button.btn,
    button.btn:active {
      color: #707070 !important;
      background-color: transparent !important;
      border-color: transparent !important;
      outline: none;
    }
  }
}

/* Only appearance accent and neutral seems to allow background-color to be changed */
/* Making the selector be ID-specific to get around limitations of Fluent UI */
fluent-button#cancelButton[appearance="neutral"],
fluent-button#saveDraftButton[appearance="neutral"],
fluent-button#requestApprovalButton[appearance="neutral"] {
  font-weight: 600;
  line-height: 20;

  /* Font Color */
  /* --neutral-foreground-rest: green; */

  /* Background Color */
  --neutral-fill-rest: white;
  --neutral-fill-hover: white;

  /* Border */
  --neutral-stroke-control-rest: white;
}

/* Only appearance accent and neutral seems to allow background-color to be changed */
/* Making the selector be ID-specific to get around limitations of Fluent UI */
fluent-button#backButton[appearance="neutral"],
fluent-button#requestConfirmationButton[appearance="neutral"],
fluent-button#addKpiButton[appearance="neutral"] {
  font-family: inherit !important;
  font-weight: 600;
  line-height: 20;

  /* Font Color */
  /* --neutral-foreground-rest: green; */

  /* Background Color */
  --neutral-fill-rest: white;
  --neutral-fill-hover: white;
}

/* Only appearance accent and neutral seems to allow background-color to be changed */
/* Making the selector be ID-specific to get around limitations of Fluent UI */
fluent-button#submitButton[appearance="neutral"],
fluent-button#createNewRequestSTA[appearance="neutral"] {
  font-family: inherit !important;
  font-weight: 600;
  line-height: 20;

  /* Font Color */
  --neutral-foreground-rest: white;

  /* Background Color */
  --neutral-fill-rest: #00A5E3;
  --neutral-fill-hover: #008EC2;
  --neutral-fill-active: #008EC2;


}

fluent-button#submitButton[appearance="neutral"] .start,
fluent-button#createNewRequestSTA[appearance="neutral"] .start {
  padding-top: 2px;
  margin-right: 9px;
}

/* AKA the Save & Next Button */
#UpdateButton,
#InsertButton {
  font-family: inherit !important;
  font-weight: 600;
  font-size: 14px;
  height: 32px;
  padding: 0px 14px;
  margin: 0 !important;
  background-color: #00A5E3 !important;
  border-radius: 4px;
  border: none;
  outline: none;
}

#UpdateButton:hover,
#InsertButton:hover {
  background-color: #008EC2 !important;
}

/* Action Buttons Bar */
.pge-action-buttons-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0px !important;
  padding: 1.5rem;
  border-top: 1px solid #e0e0e0;
}

.pge-action-left {
  display: flex;
  gap: 12px;
  align-items: center;
}

.pge-action-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

.pge-savenext-button {
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Segoe UI', sans-serif;
}

.pge-savenext-button::part(control) {
  background: #00A5E3 !important;
  color: white !important;
  border: none !important;
  border-radius: 4px !important;
  padding: 5px 14px 7px 12px !important;
}

.pge-savenext-button:hover::part(control) {
  background: #0078D4 !important;
}

.pge-savenext-button:active::part(control) {
  background: #005A9E !important;
}

.pge-submit-button::part(control) {
  padding: 5px 14px 7px 14px !important;
}


/* Custom Toast Styles - Figma Design */
.pge-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pge-toast {
  background-color: white;
  border-radius: 4px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.14), 0px 0px 2px 0px rgba(0, 0, 0, 0.12);
  padding: 12px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 320px;
  max-width: 420px;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.pge-toast.hiding {
  animation: slideOut 0.3s ease-out;
}

.pge-toast-content {
  display: flex;
  flex: 1;
  gap: 8px;
  align-items: flex-start;
}

.pge-toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pge-toast-message {
  flex: 1;
  font-family: var(--pge-font-family);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  color: #242424;
  word-wrap: break-word;
}

.pge-toast-close {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.pge-toast-close:hover {
  opacity: 1;
}

/* Form Fill Assistant Button */
.pge-form-fill-btn {
  margin-right: auto;
  margin-left: 4px;
  margin-top: 4px;
  background: linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, #36D7F5 0%, #4ADE80 25%, #F59E0B 50%, #EF4444 75%, #A855F7 100%) border-box;
  border: 2px solid transparent;
  border-radius: 4px;
  padding: 6px 12px;
  font-family: 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  color: #242424;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  position: relative;
  transition: opacity 0.1s ease;
}

.pge-form-fill-btn:hover {
  opacity: 0.85;
}

.pge-form-fill-btn:active {
  opacity: 0.7;
}