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

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes fade-out {
  to {
    opacity: 0;
  }
}

@keyframes slide-from-right {
  from {
    transform: translateX(60px);
  }
}

@keyframes slide-up {
  from {
    transform: translateY(130px);
  }
}

@keyframes slide-to-left {
  to {
    transform: translateX(-30px);
  }
}

@keyframes tab-enter {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tab-leave {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.animate-tab-enter {
  animation: tab-enter 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-tab-leave {
  animation: tab-leave 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

::view-transition-old(root) {
  animation: 90ms cubic-bezier(0.4, 0, 1, 1) both fade-out,
    300ms cubic-bezier(0.4, 0, 0.2, 1) both slide-to-left;
}

::view-transition-new(root) {
  animation: 210ms cubic-bezier(0, 0, 0.2, 1) 90ms both fade-in,
    300ms cubic-bezier(0.4, 0, 0.2, 1) both slide-from-right;
}

html,
body {
  overscroll-behavior: none;
}

@media (max-width: 767px) {
  .intercom-lightweight-app-launcher {
    bottom: 80px !important;
  }
}

/* Drag and Drop Styles for Form Builder */
.drag-ghost {
  opacity: 0.4;
}

.drag-chosen {
  transform: scale(1.02);
  box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.dragging {
  opacity: 0.8;
  transform: rotate(2deg);
}

:where(lexxy-editor, .lexxy-content) {
  &[attachments="false"] button[name="upload"] {
    display: none;
  }

  ul,
  ol {
    list-style: revert;
    padding: revert;
    margin: revert;
  }

  a {
    @apply text-blue-500;
  }
}

.autocomplete-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  position: absolute;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  cursor: pointer;
  max-width: 500px;
  z-index: 1000;
  display: none;
  font-size: 0.875rem;
  color: #374151;
  transition: background-color 0.2s ease;
}

.autocomplete-suggestion:hover {
  background-color: #f3f4f6;
}

.autocomplete-shortcut-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 500;
}

.autocomplete-shortcut-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  padding: 0.125rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background: #f9fafb;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.autocomplete-suggestion-text {
  flex: 1;
  padding-right: 0.5rem;
}

.autocomplete-loader {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border: 2px solid #d1d5db;
  border-top-color: #3b82f6;
  border-radius: 9999px;
  animation: autocomplete-spin 0.75s linear infinite;
}

@keyframes autocomplete-spin {
  to {
    transform: rotate(360deg);
  }
}
