@use './mixins' as *;

$dot: #8f91a3;
$shadow: 0 0 10px rgba(102, 102, 102, 0.4);

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
	html, body { height: 100%; overflow-y: hidden; overflow-x: auto; margin: 0; }
	html { font-size: 16px; }
	body {
		font-family: var(--primary-font);
		font-weight: 400;
		line-height: 150%;
		background: var(--white);
		color: var(--body-text);
		font-size: 0.875rem;
		-webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-smoothing: antialiased;
	}

  .material-symbols-rounded {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;

    &.fill {
      font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    }
  }

  /* @supports (-webkit-font-smoothing: subpixel-antialiased) {
    body {
      -webkit-font-smoothing: subpixel-antialiased;
    }
  }

  @supports (font-smoothing: subpixel-antialiased) {
    body {
      font-smoothing: subpixel-antialiased;
    }
  } */

	img { display: initial; max-width: initial; }

	textarea, input {
    &::placeholder {
      color: var(--placeholder-text) !important;
    }
  }

	textarea, input {
    &::-ms-input-placeholder { /* Edge 12 -18 */
      color: var(--placeholder-text) !important;
    }
  }

	input[type='file']::-webkit-file-upload-button { cursor:pointer; }

	a { cursor: pointer; }

  h1, h2, h3, h4, h5, h6, .h7 { @apply text-title-text font-semibold; }
  h1 { font-size: 32px; line-height: 150%; }
  h2 { font-size: 28px; line-height: 150%; }
  h3 { font-size: 24px; line-height: 150%; }
  h4 { font-size: 22px; line-height: 150%; }
  h5 { font-size: 20px; line-height: 150%; }
  h6 { font-size: 18px; line-height: 150%; }
  .h7 { font-size: 1rem; }
  .caption { @apply text-xs; }
  .up-title { @apply caption uppercase tracking-widest text-caption-text font-medium; }

  text { font-family: inherit !important; }

  *::-webkit-scrollbar {
    width: 6px !important;
    height: 6px !important;
    background: transparent !important;
  }

  *::-webkit-scrollbar-thumb {
    border-radius: 6px !important;
    background: var(--scrollbar-bg) !important;
  }
}

@layer utilities {
	.absolute-xy-center {
		position: absolute;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
	}
	.absolute-x-center {
		position: absolute;
		left: 50%;
		transform: translateX(-50%);
	}
	.absolute-y-center {
		position: absolute;
		top: 50%;
		transform: translateY(-50%);
	}

  .bg-full-layout { background-image: url('../assets/images/full-layout-bg.png') }
  .bg-half-layout { background-image: url('../assets/images/half-layout-bg.png') }

  .shadow-card { box-shadow: 0px 1px 6px 0px rgba(0, 22, 221, 0.16); }
  .shadow-inner-card { box-shadow: 0px 2px 6px 0px #EDEEFA; }
  .shadow-alert { box-shadow: 0px 4px 12px 0px rgba(64, 57, 40, 0.12); }
}

@layer components {
  .mod-btn {
		@apply text-sm flex items-center gap-1.5 justify-center px-4 max-w-full duration-150 whitespace-nowrap rounded-lg h-10 w-full;

    .icon {
      @apply text-base shrink-0; line-height: 18px; overflow: hidden;

      img { @apply block; }
    }

    &.xs {
      @apply rounded-md h-6 gap-1;

      .icon {
        @apply text-base; line-height: 16px;
      }
    }

		&.s {
      @apply rounded-lg h-8 gap-1;

      .icon {
        @apply text-base; line-height: 16px;
      }
    }
    &.m {
      @apply rounded-lg h-10;
      .icon { @apply text-base; line-height: 18px; }
    }
		&.l {
      @apply rounded-lg h-12 text-base;
      .icon { @apply text-xl; line-height: 20px; }
    }

    &.solid {
      @apply text-white;

      &.primary {
        background: var(--primary) !important;
        &:not(:disabled):hover { box-shadow: 0px 2px 8px 0px #D4D6F4; }
      }
      &.secondary {
        background: var(--secondary) !important;
        &:not(:disabled):hover { box-shadow: 0px 2px 8px 0px #d7f3ff; }
      }
      &.success { background: var(--green-6) !important; }
      &.warning { background: var(--warning) !important; }
      &.error { background: var(--error) !important; }
      &.gradient { @include gradient-x(); }
      &.delete {
        @apply bg-black-6;
        &:not(:disabled):hover { @apply bg-black-7; }
      }
      &.my-ai { @apply bg-my-ai; }
      &.pinmall { @apply bg-pinmall; }
      &:disabled { @apply cursor-default; background: var(--black-4) !important; }
    }

    &.outline {
      @apply border border-solid bg-white;
      outline-style: none !important;

      &.primary {
        @apply text-primary; border-color: var(--purple-3);
        &:not(:disabled):hover { @apply border-primary; }
      }
      &.secondary {
        @apply text-secondary; border-color: var(--blue-3);
        &:not(:disabled):hover { @apply border-secondary; }
      }
      &.success { @apply border-green-6 text-green-6; }
      &.warning { @apply border-warning text-warning; }
      &.error { @apply border-error text-error; }
      &.delete {
        @apply border-black-6 text-black-6;
        &:not(:disabled):hover { @apply text-black-7 border-black-7; }
      }
      &.my-ai { @apply border-my-ai text-my-ai; }
      &.pinmall { @apply border-pinmall text-pinmall; }
      &:disabled { @apply cursor-default; color: var(--black-5); border-color: var(--black-5); }
    }

    &.text {
      &.primary { @apply text-primary; }
      &.secondary { @apply text-secondary; }
      &.success { @apply text-green-6; }
      &.warning { @apply text-warning; }
      &.error { @apply text-error; }
      &.delete { @apply text-black-6; }
      &.my-ai { @apply text-my-ai; }
      &.pinmall { @apply text-pinmall; }

      &:disabled { @apply cursor-default; color: var(--black-5); }
      &:not(:disabled):hover {
        @apply underline;

        &.delete { @apply text-black-7; }
      }
    }
	}

  .mod-icon-btn {
		@apply flex items-center justify-center duration-150 whitespace-nowrap rounded-lg h-10 w-10;

    .icon { @apply flex items-center justify-center; font-size: inherit; }

    &.xs { @apply rounded-md h-6 w-6 text-base; }
		&.s { @apply rounded-lg h-8 w-8 text-base; }
    &.m { @apply rounded-lg h-10 w-10 text-xl; }
		&.l { @apply rounded-lg h-12 w-12 text-xl; }

    &.solid {
      @apply text-white;

      &.primary {
        background: var(--primary) !important;
        &:not(:disabled):hover { box-shadow: 0px 2px 8px 0px #D4D6F4; }
      }
      &.secondary {
        background: var(--secondary) !important;
        &:not(:disabled):hover { box-shadow: 0px 2px 8px 0px #d7f3ff; }
      }
      &.success { background: var(--green-6) !important; }
      &.warning { background: var(--warning) !important; }
      &.error { background: var(--error) !important; }
      &.gradient { @include gradient-x(); }
      &.delete {
        @apply bg-black-6;
        &:not(:disabled):hover { @apply bg-black-7; }
      }
      &.my-ai { @apply bg-my-ai; }
      &.pinmall { @apply bg-pinmall; }
      &:disabled { @apply cursor-default; background: var(--black-4) !important; }
    }

    &.outline {
      @apply border border-solid;
      outline-style: none !important;

      &.primary {
        @apply text-primary; border-color: var(--purple-3);
        &:not(:disabled):hover { @apply border-primary; }
      }
      &.secondary {
        @apply text-secondary; border-color: var(--blue-3);
        &:not(:disabled):hover { @apply border-secondary; }
      }
      &.success { @apply border-green-6 text-green-6; }
      &.warning { @apply border-warning text-warning; }
      &.error { @apply border-error text-error; }
      &.delete {
        @apply border-black-6 text-black-6;
        &:not(:disabled):hover { @apply text-black-7 border-black-7; }
      }
      &.my-ai { @apply border-my-ai text-my-ai; }
      &.pinmall { @apply border-pinmall text-pinmall; }
      &:disabled { @apply cursor-default; color: var(--black-5); border-color: var(--black-5); }
    }

    &.text {
      &.primary { @apply text-primary; }
      &.secondary { @apply text-secondary; }
      &.success { @apply text-green-6; }
      &.warning { @apply text-warning; }
      &.error { @apply text-error; }
      &.delete { @apply text-black-6; }
      &.my-ai { @apply text-my-ai; }
      &.pinmall { @apply text-pinmall; }

      &:disabled { @apply cursor-default; color: var(--black-5); }
      &:not(:disabled):hover {
        &.delete { @apply text-black-7; }
      }
    }
	}

  .mod-label {
    @apply text-sm font-normal mb-1 text-title-text flex items-center;

    &.required {
      &::before { @apply text-error mr-0.5; content: '*'; }
      &.end {
        &::before { content: initial; }
        &::after { @apply text-error ml-0.5; content: '*'; }
      }
    }
  }

  .mod-invalid-msg { @apply text-error text-sm font-normal mt-0.5 inline-block; }
  .mod-invalid-helper { @apply text-caption-text text-sm font-normal mt-0.5 inline-block; }

	.mod-main-card {
		@apply bg-white rounded-2xl py-4 px-6 flex flex-col;
		&:not(:first-child) { @apply mt-4; }
	}

  .mod-modal-wrapper {
    @apply flex justify-center items-center fixed top-0 left-0 w-full h-full p-6 overflow-auto;
    z-index: 2000;

    .mod-modal-backdrop {
      @apply fixed top-0 left-0 w-full h-full bg-opacity-bg; animation-timing-function: ease-out; animation-duration: 0.2s;
    }

    .mod-modal {
      @apply bg-white relative flex flex-col rounded-2xl; max-height: calc(100vh - 48px);

      &.animate__fadeInDown, &.animate__fadeOutUp { animation-timing-function: ease-out; animation-duration: 0.2s; }
      &.s { @apply h-auto; width: 400px; }
      &.m { @apply h-auto; width: 640px; }
      &.l { @apply h-auto; width: 900px; }
      &.xl { @apply h-auto; width: 1140px; }

      > .close {
        @apply absolute top-2 right-2 text-2xl text-title-text;

        button { @apply text-title-text text-2xl; }
      }

      .mod-modal-header {
        @apply px-6 pt-6 shrink-0;
        &:has(*) + .mod-modal-body:has(*) { @apply pt-4; }
      }
      .mod-modal-body {
        @apply px-6 overflow-auto;
        &:has(*) + .mod-modal-footer:has(*) { @apply pt-6; }
        > * { @apply flex flex-col items-center justify-center gap-2; }
      }
      .mod-modal-footer {
        @apply px-6 pb-6 shrink-0;
        > * { @apply flex items-center justify-center gap-2; }
      }
    }
  }

  .mod-textfield {
    @apply duration-100 flex;

    &.s { @apply
      rounded-lg h-8;
      .append, .prepend { min-width: 32px; }
      .material-symbols-rounded { @apply text-lg; }
    }
    &.m { @apply
      rounded-lg h-10;
      .append, .prepend { min-width: 40px; }
      .material-symbols-rounded { @apply text-xl; }
    }
    &.l { @apply
      rounded-lg h-12 text-base;
      .append, .prepend { min-width: 48px; }
      .material-symbols-rounded { @apply text-2xl; }
    }

    &:focus-within { border-color: var(--secondary) !important; }

    &.fill { @apply bg-input-bg border border-solid border-transparent; }
    &.outline { @apply border border-solid border-black-4 bg-white; outline-style: none; }
    &.error {
      @apply border border-solid border-error;
      &:focus-within { border-color: var(--error) !important; }
    }
    &.disabled {
      @apply bg-black-2;

      input { @apply text-caption-text; }
    }

    input {
      @apply bg-transparent flex-grow flex-shrink text-body-text; outline: none;
      &:first-child { @apply pl-3; }
      &:last-child { @apply pr-3; }
    }

    .material-symbols-rounded { color: inherit; }

    .append, .prepend { @apply px-2 flex items-center justify-center text-placeholder-text; }
  }

  .mod-textarea {
    @apply p-2 rounded-lg border border-solid border-black-4 bg-white duration-100 flex flex-col;

    &:focus-within:not([class*='!border-error']) { border-color: var(--secondary) !important; }

    &.fill { @apply bg-input-bg border border-solid border-transparent; }
    &.outline { @apply border border-solid border-black-4 bg-white; outline-style: none; }
    &.error {
      @apply border border-solid border-error;
      &:focus-within { border-color: var(--error) !important; }

      .char-limit { @apply text-error; }
    }
    &.disabled {
      @apply bg-black-2;

      input { @apply text-caption-text; }
    }

    textarea {
      @apply flex-grow h-[84px] w-full appearance-none outline-0 resize-none bg-transparent;
    }

    .char-limit {
      @apply shrink-0 text-xs text-black-5 text-right;
    }
  }

  .mod-text-editor {
    --ck-border-radius: 8px;
    --ck-color-toolbar-background: var(--purple-0);
    --ck-color-toolbar-border: var(--purple-2);
    --ck-color-base-background: var(--white);
    --ck-color-base-border: var(--black-4);
    --ck-focus-ring: 1px solid var(--secondary);
    --ck-inner-shadow: none;
    --ck-spacing-small: 8px;
    --ck-spacing-standard: 8px;
    --ck-spacing-large: 8px;
    --ck-ui-component-min-height: 24px;
    --ck-color-button-default-hover-background: var(--purple-1);
    --ck-color-button-on-background: var(--purple-1);
    --ck-color-button-on-hover-background: var(--purple-1);
    --ck-color-button-on-active-background: var(--purple-1);
    --ck-color-button-on-active-shadow: none;
    --ck-color-button-default-active-background: var(--purple-1);
    --ck-color-button-default-active-shadow: none;
    --ck-color-text: var(--body-text);
    --ck-color-engine-placeholder-text: var(--placeholder-text);
    --ck-color-dropdown-panel-border: var(--black-3);
    --ck-drop-shadow: var(--dropdown-shadow);
    --ck-color-list-button-on-background: transparent;
    --ck-color-list-button-on-text: var(--secondary);
    --ck-color-list-button-hover-background: var(--blue-1);

    @apply relative;

    .ck-editor {
      @apply pr-5 flex flex-col;

      .ck-editor__top { @apply shrink-0; }
      .ck-editor__main { @apply flex-grow; }
    }

    .ck-sticky-panel__placeholder { display: none !important; }
    .ck-sticky-panel__content {
      position: static !important;
      height: 41px !important;
      width: 100% !important;
      box-shadow: none !important;
    }

    .ck-toolbar {
      border-radius: 8px !important;
      border-bottom-left-radius: 0 !important;
      border-bottom-right-radius: 0 !important;

      > .ck-toolbar__items {
        @apply flex items-center gap-2;

        > *:not(.ck-toolbar__separator),
        > .ck-toolbar__grouped-dropdown { margin: 8px 0 !important; }
        > .ck-button:not(.ck-fontsize-option) .ck-button__label { display: none !important; }
        > .ck-dropdown > .ck-button .ck-button__label { display: none !important; }
        .ck-dropdown__panel { left: -8px !important; top: calc(100% + 10px) !important; border-radius: 8px !important; }
      }

      .ck-toolbar__separator { @apply bg-purple-1; margin: 0 !important; }

      .ck-color-ui-dropdown {
        > .ck-button {
          @apply w-6 h-6 p-0;
          padding: 0 !important;

          .ck-dropdown__arrow { display: none !important; }
        }

        .ck-color-grid {
          @apply p-4 gap-4;
          .ck-color-grid__tile {
            width: 32px !important; height: 32px !important; border-radius: 32px !important;
            box-shadow: none !important; border: 1px solid var(--black-3) !important;

            path.ck-icon__fill { fill: transparent !important; }
            path:not(.ck-icon__fill) { fill: var(--white) !important; }
          }
        }
      }

      .ck-font-size-dropdown {
        .ck-list {
          @apply p-2 gap-1;

          .ck-list__item {
            @apply min-w-16;

            .ck-button {
              @apply h-10 justify-start rounded-md hover:bg-blue-1;
              padding: 8px !important;

              &.ck-on .ck-button__label { @apply font-semibold; }
            }
          }
        }
      }

      .emoji-dropdown-panel {
        .ck-list {
          @apply grid grid-cols-9 w-max p-2 h-64 overflow-auto;

          .ck-list__separator {
            @apply col-span-9 my-2 bg-black-3;

            &:first-child {
              @apply hidden;
            }
          }

          .ck-list__item {
            @apply items-center justify-center;
            min-width: 32px !important; display: flex !important;

            .ck-button {
              @apply text-base;
              height: 32px !important;
            }
          }
        }
      }

      .ck-button {
        @apply cursor-pointer min-h-0 min-w-0 h-6 w-6 flex justify-center;
        border-radius: 4px !important;
        border: none !important;

        .ck-tooltip { display: none !important; }

        &.ck-disabled { @apply opacity-50; }
        &.ck-button_with-text { padding: 0 !important; }
        &.ck-color-table__remove-color { display: none !important; }
      }

      .material-symbols-rounded {
        cursor: pointer;
        font-size: 24px !important;
        font-family: 'Material Symbols Rounded' !important;
        font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 16 !important;
        height: 24px !important;
        line-height: 24px !important;
      }
    }

    .ck-content {
      @apply min-h-[142px] max-h-[540px];
      padding-right: 24px !important;
      transition: min-height 0.3s, border-color 0.15s !important;

      ul { @apply list-disc pl-6; }
      ol { @apply list-decimal pl-6; }
    }

    .cur-color {
      @apply absolute top-7 left-[72px] w-7 h-3 pointer-events-none bg-purple-0;

      &::before {
        @apply absolute rounded-sm left-[5px] bottom-2 h-1 w-[18px];
        content: ""; background: var(--cur-color, --body-text);
      }
    }

    .char-limit { @apply text-13 text-black-5 text-right absolute bottom-2 right-2; }
    .has-char-limit .ck-content { padding-bottom: 24px !important; }

    &.error {
      --ck-color-base-border: var(--error);
      .char-limit { @apply text-error; }
    }

    &.expand .ck-content { min-height: 540px !important; }
  }

  .mod-accordion {
    .mod-accordion-header {
      @apply h-12 flex justify-between items-center border-b border-solid border-border-bg text-title-text font-semibold;

      .material-symbols-rounded { @apply text-primary; }
    }

    .mod-accordion-content {
      @apply py-0 mb-0 overflow-hidden;

      &.open { @apply py-4; }
    }
  }

  .mod-chip {
    @apply rounded-3xl px-2 flex justify-center items-center w-max gap-1;

    .icon { @apply flex items-center justify-center;}
    .del { @apply cursor-pointer -mr-1 text-base; }

    &.xs {
      @apply h-4 text-xs;

      .icon, .del { @apply text-sm; }
    }
    &.s {
      @apply h-5 text-xs;

      .icon, .del { @apply text-sm; }
    }
    &.m {
      @apply h-6 text-sm;

      .icon, .del { @apply text-base; }
    }
    &.l {
      @apply h-7 text-sm;

      .icon, .del { @apply text-base; }
    }
    &.xl {
      @apply h-8 text-base;

      .icon, .del { @apply text-lg; }
    }

    &.fill {
      &.magenta { @apply text-magenta-4 bg-magenta-1; }
      &.primary { @apply text-primary bg-purple-1; }
    }

    &.outline {
      @apply border border-solid outline-none;
      &.magenta { @apply text-magenta-4 bg-magenta-1; }
      &.primary { @apply text-primary border-primary; }
    }
  }

  .mod-dots {
    @apply flex gap-1.5 items-center justify-center;

    span {
      @apply block w-4 h-1.5 bg-black-4 rounded-lg cursor-pointer duration-200 ease-linear;

      &.current { @apply bg-secondary w-8; }
    }
  }

  .mod-alert {
    @apply fixed top-2 left-1/2 -translate-x-1/2 bg-white flex items-center gap-2 p-2 rounded-lg shadow-card z-10 w-max text-title-text;
    max-width: calc(100vw - 48px);

    .status {
      @apply w-8 h-8 rounded-lg flex items-center justify-center shrink-0;

      &.success { background: var(--success) !important; }
      &.warning {
        background: var(--warning) !important;
        .material-symbols-rounded { @apply text-xl; font-variation-settings: 'FILL' 1; }
      }
      &.error { background: var(--error) !important; }
      &.info {
        background: var(--secondary) !important;
        .material-symbols-rounded { @apply text-xl; }
      }

      .material-symbols-rounded {
        @apply text-[22px] text-white font-semibold;
        font-variation-settings: 'wght' 600;
      }
    }

    p { @apply font-semibold text-base; }
  }

  .mod-sidebar {
    @apply w-[60px] h-full bg-purple-8 relative duration-300 text-white grid grid-cols-1 grid-rows-[auto_minmax(0,100%)_auto];

    &.expand {
      @apply w-[232px];

      .main-route { @apply pl-3.5 pr-[5px] mr-[5px] pb-4; }
      .fixed-route { @apply p-3; }

      .main-menu { @apply pr-1 justify-start; }
    }

    .toggle-btn {
      @apply rounded-full bg-white absolute -right-4 top-20 w-8 h-8 flex items-center justify-center;

      box-shadow: $shadow;
    }

    .main-route {
      @apply flex flex-col gap-2 p-2 overflow-y-scroll overflow-x-hidden cursor-pointer duration-300;

      &::-webkit-scrollbar-thumb {
        background: transparent !important;
      }
      &:hover::-webkit-scrollbar-thumb {
        background: var(--scrollbar-bg) !important;
      }
    }

    .fixed-route {
      @apply h-16 p-2 flex items-center border-t border-solid border-[#8083A4] duration-300;
    }

    .main-menu {
      @apply py-2 px-2.5 rounded h-10 flex items-center justify-center duration-200 hover:bg-[#353963] flex-grow;

      &.current { @apply bg-purple-7; }
    }

    .sub-menu {
      @apply mt-1 relative;

      &::before {
        @apply border-r border-solid absolute top-5 left-[18px];

        content: ''; width: 0; height: calc(100% - 40px); z-index: 1; border-color: $dot;
      }

      &.expand {
        > a { @apply visible h-10 py-2; }
      }

      > a {
        @apply invisible py-0 pl-9 rounded h-0 flex items-center duration-200 overflow-hidden hover:bg-[#353963] relative cursor-pointer;

        &.current {
          &::before { @apply bg-secondary; }

          > p { @apply opacity-100; }
        }

        &::before {
          @apply w-1.5 h-1.5 rounded-full absolute top-1/2 -translate-y-1/2 left-[15.5px];

          content: ''; background: $dot; z-index: 1;
        }

        > p { @apply opacity-50 shrink-0 pr-2 flex-grow; }
      }
    }

    .badge {
      @apply block px-1 rounded bg-secondary text-white text-xs font-semibold h-5 leading-5;
    }
  }

  .mod-checkbox {
    @apply flex items-center gap-2 cursor-pointer;

    &.error {
      > .checkbox .box { @apply border-error; }
    }

    &:not(.error):hover {
      > .checkbox input:not(:disabled) ~ .box { @apply shadow-checkbox-hover; }
    }

    > .checkbox {
      @apply relative w-5 h-5 shrink-0;

      input {
        @apply opacity-0;

        &:checked ~ span {
          &.all { @apply opacity-100; }
          &.some { @apply opacity-100; }
          &.line { @apply opacity-0; }
        }

        &:checked:disabled ~ span {
          &.box { @apply bg-purple-3 border-purple-3; }
          &.all { @apply opacity-100 bg-purple-3; }
          &.some { @apply opacity-100 bg-purple-3; }
          &.line { @apply opacity-0; }
        }

        &:not(:checked) ~ span {
          &.all { @apply opacity-0; }
          &.some { @apply opacity-0; }
          &.line { @apply opacity-0; }
        }

        &:not(:checked):disabled ~ span {
          &.box { @apply bg-black-2 border-black-5; }
          &.all { @apply opacity-0; }
          &.some { @apply opacity-0; }
          &.line { @apply opacity-100; }
        }
      }

      span {
        @apply transition duration-200 absolute;

        &.box { @apply top-0 left-0 w-full h-full bg-white border border-solid border-primary rounded; }
        &.all { @apply top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 flex items-center justify-center text-white text-lg w-full h-full bg-primary rounded invisible opacity-0; }
        &.some { @apply top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-3 h-3 rounded-sm bg-purple-5 invisible opacity-0; }
        &.line { @apply top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-black-5 text-base opacity-0; }
      }
    }

    > .append { min-width: 16px; }
    > .material-symbols-rounded { @apply text-base text-primary; }
  }

  .mod-dropdown {
    @apply relative;

    &.s {
      .mod-dropdown-btn { @apply h-8 rounded-lg; }
    }
    &.m {
      .mod-dropdown-btn { @apply h-10 rounded-lg; }
    }
    &.l {
      .mod-dropdown-btn { @apply h-12 rounded-lg; }
    }
    &.disabled {
      .mod-dropdown-wrapper { @apply cursor-default; }
      .mod-dropdown-btn { @apply bg-black-2 cursor-default; }
    }
  }
  .mod-dropdown-wrapper { @apply absolute top-0 right-0 bottom-0 left-0 cursor-pointer; }
  .mod-dropdown-btn {
    @apply h-8 pl-2 pr-1 border border-solid border-black-4 bg-white rounded-lg flex items-center gap-2 cursor-pointer justify-between w-full;

    &.s { @apply h-8 rounded-lg; }
    &.m { @apply h-10 rounded-lg; }
    &.l { @apply h-12 rounded-lg; }
  }
  .mod-dropdown-content {
    @apply rounded-lg bg-white border border-solid border-black-3 p-2 top-full left-0 shadow-dropdown overflow-auto;

    > *:not(.separate) {
      @apply flex items-center p-2 gap-2 cursor-pointer hover:bg-blue-1 transition duration-150 rounded-md;
    }

    .separate {
      @apply text-caption-text text-xs text-center flex leading-[inherit] items-center my-1;

      span { @apply shrink-0 px-2; }

      &::after {
        @apply h-[1px] bg-black-3 flex-grow;
        content: '';
      }
    }
  }
  .mod-dropdown-backdrop { background: transparent !important; pointer-events: none !important; }
  .mod-dropdown-overlay-inside-modal { z-index: 2001 !important; }

  /* For Chat
  .mod-dropdown-multi-channel-btn {
    @apply p-1 flex items-center gap-1.5 bg-black-2 rounded-2xl w-full min-w-60;
  } */

  .mod-dropdown-multi-channel-content {
    @apply p-2 border border-solid border-black-3 rounded-lg bg-white shadow-dropdown;

    .separate {
      @apply text-caption-text text-xs text-center flex leading-[inherit] items-center my-1;

      span { @apply shrink-0 px-2; }

      &::after {
        @apply h-[1px] bg-black-3 flex-grow;
        content: '';
      }
    }

    ::ng-deep .mod-btn { @apply px-2; }

    .material-symbols-rounded {
      font-variation-settings: 'wght' 300;
    }
  }

  .mod-loading {
    @apply flex justify-center items-center h-full w-full relative;

    img {
      @apply absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2;

      &:nth-child(01) {
        @apply h-16;
      }

      &:nth-child(02) {
        @apply h-[100px] w-[100px];
        animation: rotating 1.2s linear infinite;
      }
    }
  }

  .mod-loading-page {
    @apply fixed top-0 left-0 bottom-0 right-0 z-[9999] flex items-center justify-center bg-[rgba(255,255,255,0.5)];
  }

  @keyframes rotating {
    0% {
      transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
      transform: translate(-50%, -50%) rotate(360deg);
    }
  }

  mod-tooltip {
    @apply fixed pointer-events-none z-[999];
  }

  .mod-tooltip-container {
    @apply fixed pointer-events-none;

    &.fadeIn {
      animation-name: fadeIn;
      animation-fill-mode: both;
      animation-timing-function: ease-in;
      animation-duration: 0.1s;
    }

    &.fadeOut {
      animation-name: fadeOut;
      animation-fill-mode: both;
      animation-timing-function: ease-out;
      animation-duration: 0.1s;
    }

    @keyframes fadeIn {
      0% { opacity: 0 }
      to { opacity: 1 }
    }

    @keyframes fadeOut {
      0% { opacity: 1 }
      to { opacity: 0 }
    }

    .mod-tooltip {
      @apply bg-black-2 p-[10px] rounded-lg max-w-[420px] pointer-events-auto absolute justify-center gap-2 w-max;
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);

      .tooltip-matIcon {
        @apply text-white text-xs bg-success h-4 rounded-full aspect-square flex items-center justify-center my-auto shrink-0;
      }
      .tooltip-message {
        @apply w-full whitespace-pre-line break-words text-body-text flex items-center gap-2;
        word-break: break-word;
      }
    }
  }

  .mod-toggle {
    @apply bg-black-3 flex gap-1 p-1 rounded-lg w-fit;

    .toggle-button {
      @apply flex h-full aspect-square items-center justify-center cursor-pointer duration-100 text-placeholder-text;

      &.toggle-selected {
        @apply bg-white rounded text-primary;

        .material-symbols-rounded {
          @apply text-primary;
        }

        .caption {
          @apply text-title-text font-semibold;
        }
      }

      .material-symbols-rounded {
        @apply text-xl duration-100;
      }

      .caption {
        @apply px-1 duration-100;
      }
    }
  }

  .mod-switch {
    @apply flex gap-2 items-center w-fit cursor-pointer;

    &:has(input:disabled) {
      @apply cursor-not-allowed;

      .switch-container {
        @apply opacity-50;
      }

      .switch-message {
        @apply text-black-5;
      }
    }

    input {
      @apply hidden;
    }

    .switch-container {
      @apply w-11 h-[26px] rounded-full p-1 transition-all shrink-0;

      .switch-knob {
        @apply bg-white h-[18px] w-[18px] rounded-full transition-all relative pointer-events-none;

        .material-symbols-rounded {
          @apply absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 pointer-events-none text-sm;
          font-variation-settings: "FILL" 0, "wght" 600, "GRAD" 0, "opsz" 24;
        }
      }
    }

    .switch-message {
      @apply text-black-8;

      &:empty {
        @apply hidden;
      }
    }
  }

  .mod-radio {
    &[disabled]{@apply cursor-not-allowed;}
    @apply flex items-center gap-2 cursor-pointer;
    &.group:not([disabled]) {
      &:hover {
        .circle {
          @apply shadow-checkbox-hover bg-white;
        }
      }
    }
    >.radio-content{
      @apply text-black-5
    }
    >.radio { @apply relative shrink-0;
      input { @apply opacity-0;
        &:disabled:not(:checked){
          ~span.circle{
            @apply bg-black-2 border-black-5
          }
          ~.checkedSlash {
            @apply opacity-100;
          }
        }
        &:checked:disabled{
          ~span.circle {
              @apply bg-purple-3 border-purple-3
          }
          ~.checkedCircle {
            @apply opacity-100;
          }
        }
        &:checked:not(:disabled){
          ~span.circle{
              @apply bg-primary;
          }
          ~.checkedCircle {
            @apply opacity-100;
          }
          ~.checkedSlash {
            @apply opacity-100;
          }
        }
      }
    }
    span{
      &.checkedCircle {
        @apply transition duration-200 absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-white opacity-0;
      }
      &.checkedSlash{
        @apply transition duration-200 absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-2 h-[2px] bg-black-5 opacity-0;
      }
      &.circle {
      @apply transition duration-200 absolute top-0 left-0 w-full h-full bg-white border border-solid border-primary rounded-full;
        &[validate] {
          @apply border-error;
        }

      }
    }
  }

  .mod-tabs {
    @apply flex h-8 items-stretch;

    .tab {
      @apply h-8 py-2 px-4 flex items-center justify-center cursor-pointer border-b-2
              border-solid border-transparent duration-100;

      &.current {
        @apply border-primary font-bold text-primary;
      }
    }
  }

  .mod-table {
    @apply flex flex-col flex-grow;

    .thead {
      @apply flex items-center text-caption-text border-b border-solid border-black-3 shrink-0 pr-4;

      .th {
        @apply px-2 h-12 leading-[48px] whitespace-nowrap flex items-center gap-1 line-clamp-2;

        ::ng-deep mod-dropdown-btn {
          @apply flex items-center gap-1;
        }

        &:not(.flex-1) {
          @apply shrink-0;
        }

        .material-symbols-rounded {
          @apply text-primary;
        }
      }
    }

    .tbody {
      @apply h-64 flex-grow overflow-y-auto overflow-x-hidden pr-2;
      scrollbar-gutter: stable;

      .tr {
        @apply flex items-center;
      }

      .td {
        @apply p-2 overflow-hidden line-clamp-2;

        > * { @apply truncate; }

        &:not(.flex-1) {
          @apply shrink-0;
        }
      }
    }
  }

  mod-permission-overlay {
    @apply absolute top-0 left-0 right-0 bottom-0 flex flex-col items-center justify-center gap-4 p-6 rounded-2xl z-10;
    background: rgba(255,255,255,0.5);

    > div {
      @apply rounded-full flex items-center justify-center;
      background: rgba(35,38,73,0.2); width: 152px; height: 152px;
    }

    .material-symbols-rounded {
      @apply text-8xl text-white;
      font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
    }
  }

  .mod-num-title {
    @apply w-8 h-8 flex items-center justify-center font-semibold text-white rounded-full bg-primary text-lg shrink-0;
  }

  $fb_bg_bubble: var(--facebook);
  $fb_txt_bubble: var(--white);

  $line_bg_bubble: var(--green-4);
  $line_txt_bubble: var(--title-text);

  $mpm_bg_bubble: var(--pinmall);
  $mpm_txt_bubble: var(--white);

  $myai_bg_bubble: var(--my-ai);
  $myai_txt_bubble: var(--white);

  .mod-preview-msg-block {
    @apply shrink-0 rounded-2xl shadow-button w-[361px] 1920:w-[584px] sticky top-0 right-0 h-full flex flex-col max-h-[642px] 1920:max-h-[713px];

    .preview-title {
      @apply bg-purple-0 rounded-t-2xl h-[60px] px-3 py-4 flex items-center shrink-0;
    }

    .room-wrapper {
      @apply flex-grow rounded-b-2xl px-4 py-5 grid grid-rows-[auto_minmax(0,100%)_auto] gap-2;
      height: calc(100% - 60px);

      .room-header {
        @apply flex items-center gap-2 border-b border-solid border-black-3 pb-5;
      }

      .room-body {
        @apply overflow-auto flex flex-col gap-4;

        .row {
          @apply relative flex flex-row-reverse justify-end pt-2 mx-0 flex-nowrap gap-2 items-end;

          &.separate-row { @apply pt-3; }

          &.mine {
            @apply flex-row;

            ::ng-deep {
              > *:not(div) {
                @apply flex-row-reverse;
              }

              .bubble {
                background: $fb_bg-bubble; color: $fb_txt_bubble;
              }

              .text-message {}
              .time-message { @apply items-end; }
            }
          }

          > *:not(div) {
            @apply flex items-end gap-2;
          }
        }

        ::ng-deep .bubble {
          @apply max-w-[280px] flex relative bg-black-2 rounded-lg mx-1;

          &.generic {
            @apply max-w-0;
          }

          .link-on-chat-bubble {
            cursor: pointer !important; color: inherit !important;
          }

          .text-on-chat-bubble-file {
            @apply truncate p-3 items-center gap-1;
          }

          .audio-on-chat-bubble {
            max-width: 280px;
            padding: 12px;
            word-wrap: break-word;
            white-space: break-spaces;
            font-style: normal;
            font-weight: 600;
            font-size: 14px;
            line-height: 21px;
            display: flex;
            align-items: center;
            color: #4A4A4A;

            flex: none;
            order: 1;
            flex-grow: 0;

            .audio-duration{
              text-align: left;

            }
            .disabled{
              color: #8C8C8C;
            }
          }
        }
      }

      .room-footer {
        @apply rounded-lg border border-solid border-black-3 p-2;
      }

      /* Social Color */
      &.fb .mine ::ng-deep .bubble {
        background: $fb_bg-bubble !important; color: $fb_txt_bubble !important;
        &:before { border-top-color: $fb_bg_bubble !important; }
      }
      &.line .mine ::ng-deep .bubble {
        background: $line_bg-bubble !important; color: $line_txt_bubble !important;
        &:before { border-top-color: $line_bg_bubble !important; }
      }
      &.mpm .mine ::ng-deep .bubble {
        background: $mpm_bg-bubble !important; color: $mpm_txt_bubble !important;
        &:before { border-top-color: $mpm_bg_bubble !important; }
      }
      &.my-ai .mine ::ng-deep .bubble {
        background: $myai_bg-bubble !important; color: $myai_txt_bubble !important;
        &:before { border-top-color: $myai_bg_bubble !important; }
      }
    }
  }

  .mod-avatar-group {
    @apply flex flex-row-reverse items-center w-max pl-1.5;

    > mod-avatar {
      @apply -ml-1.5;
    }
  }

}

.sidebar .tooltip.menu-item { width: max-content; }

.e-tooltip-wrap * { font-family: inherit !important; }

.apexcharts-legend-text { font-family: inherit !important; }

.other-sell {
  .tt-suggestion.tt-selectable {
    font-size: 14px !important;
  }
  .tt-menu {
    width: 100% !important;
    left: 0px !important;
    text-align: left;
    height: 250px;
    overflow-y: scroll;
    border: none;
  }
}

.create-order {
  .twitter-typeahead:nth-of-type(3),
  .twitter-typeahead:nth-of-type(4),
  .twitter-typeahead:nth-of-type(5) {
    position: unset !important;
    display: none !important;
  }

  .tt-input,
  .tt-hint {
    height: 36px;
  }

  .tt-suggestion.tt-selectable {
    font-size: 14px !important;
  }
  .tt-dataset.tt-dataset-0 {
    width: 100% !important;
  }
  .tt-menu {
    width: 100% !important;
    left: 0 !important;
    overflow-x: hidden;
  }
}

button.submit {
  background: linear-gradient(
      278.15deg,
      rgba(39, 170, 225, 0) 28.68%,
      #27aae1 90.64%
    ),
    #4e54a3;
  border-radius: 4px;
  width: 100%;
  height: 32px;
  color: white;
  border: none;
}

.field-group {
  .tt-menu {
    width: 100% !important;
    height: auto !important;
    max-height: 250px !important;
    left: 0 !important;
    overflow-y: scroll;

    .tt-suggestion {
      font-size: 13px;

      strong.tt-highlight {
        font-size: 13px;
      }
    }
  }
}

.autocomplete-search-thailand {
  .twitter-typeahead:nth-of-type(3),
  .twitter-typeahead:nth-of-type(4),
  .twitter-typeahead:nth-of-type(5) {
    position: unset !important;
    display: none !important;
  }

  .tt-input,
  .tt-hint {
    height: 36px;
  }

  .tt-suggestion.tt-selectable {
    font-size: 14px !important;
  }
  .tt-dataset.tt-dataset-0 {
    width: 100% !important;
  }
  .tt-menu {
    width: 100% !important;
    left: 0px !important;
    text-align: left;
    max-height: 250px;
    overflow-y: scroll;
    border: none;
  }
}

input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
}

.address-thailand-select {

  .tt-suggestion.tt-selectable {
    font-size: 14px !important;
  }

  .tt-menu {
    width: 100% !important;
    left: 0px !important;
    text-align: left;
    max-height: 250px;
    overflow-y: scroll;
  }
}

.other-sell {
  .payment-type-group {
    .dropdown-menu {
      transform: translate3d(0px, 31px, 0px) !important;
    }
  }
}

.header {
  .user {
    .dropdown-menu {
      max-width: 220px !important;
    }
  }
}

.modal-size-wallet-balance-express {
  max-width: 706px !important;
  width: 706px !important;
}

.modal-size-express-inform {
  max-width: 609px !important;
  width: 609px !important;
}

.modal-margin-for-center {
  left: 125px;
  max-width: 388px !important;
  width: 388px !important;
}

.tooltip-pie-chart-sales-report {
  position: relative;
  .wrapper {
    width: 389px;
    height: 36px;
    min-height: 36px;
    max-height: 346px;
    padding: 10px;
    min-width: 389px;
    color: black;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    .wrapper-product-name {
      display: flex;
      align-items: center;
      .dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        margin-right: 10px;
      }
      .product-name {
        white-space: nowrap;
        width: 220px;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 14px;
        font-weight: 600;
      }
    }
    .product-amount {
      font-size: 14px;
      font-weight: 600;
      color: #4e54a3;
      font-family: "Noto Sans";
    }
    .product-percent {
      font-size: 14px;
      font-weight: 600;
      color: #4e54a3;
      font-family: "Noto Sans";
    }
  }

  .wrapper-detail {
    width: 389px;
    background-color: white;
    padding: 0px 10px 10px 10px;
    .detail {
      display: flex;
      justify-content: space-between;
      padding: 4px 0;
      .product-name {
        font-size: 14px;
        font-weight: 400;
        color: #21244b;
        width: 240px;
        overflow: hidden;
        text-overflow: ellipsis;
        font-family: "Noto Sans";
      }
      .product-amount {
        font-size: 14px;
        font-weight: 400;
        color: #4e54a3;
        font-family: "Noto Sans";
      }
      .product-percent {
        font-size: 14px;
        font-weight: 400;
        color: #4e54a3;
        font-family: "Noto Sans";
      }
    }
    .amount-another {
      font-weight: 400;
      font-size: 14px;
      color: #27aae1;
    }
  }
}

#pie-chart-sales-report .apexcharts-tooltip {
  transform: translateX(130px) translateY(10px);
}

.modal-for-advance-setting {
  max-width: 696px !important;
  width: 696px !important;
}

.z-index-1 {
 z-index: 1;
}

.common-card-feature {
  border-radius: 8px;
}

@keyframes marquee {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(-100%, 0); }
}

.customer-review-modal,
.edit-customer-info-modal,
.customer-appointment-modal,
.customer-appointment-feedback-modal {
  mat-dialog-container {
    border-radius: 10px !important;
    padding: 20px !important;
  }
}
