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

.app {
  font-family: "Inter";

  box-sizing: border-box;

  --gray-50: #f8fafc;
  --gray-100: #f0f5f9;
  --gray-200: #e1e8f0;
  --gray-300: #cad5e0;
  --gray-400: #91a4b7;
  --gray-500: #61758a;
  --gray-600: #445668;
  --gray-800: #1c2a3a;
  --gray-900: #0d1829;

  --blue-100: #ecf0ff;
  --blue-600: #3e64ff;

  --yellow-100: #fff7ec;
  --yellow-600: #ffa83f;

  --red-300: #f1a3a6;
}

input,
select,
textarea,
button {
  font-family: inherit;
}

p,
pre {
  margin: 0;
}

.row {
  display: flex;
  flex-wrap: wrap;
  padding: 8px 16px;
  gap: 8px;
}

.draggable {
  width: 100%;
  justify-content: center;
  text-align: center;
  background-color: var(--gray-50);
  font-size: 0.875rem;
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  color: var(--gray-400);
  padding: 10px;
}

.header {
  display: flex;
  justify-content: flex-start;
  background-color: var(--blue-100);
  padding: 8px 16px;
  margin-bottom: 12px;
  /* border-radius: 0.5rem 0.5rem 0 0; */
  border-bottom: solid 1px var(--gray-200);
  gap: 16px;
}

.input,
select.input {
  width: 100%;
  padding: 8px 12px;
  background-color: var(--gray-50);
  font-size: 0.875rem;
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  color: var(--gray-600);
}

input[type="file"] {
  display: none;
}

input[type="number"] {
  appearance: textfield;
}

input[required].empty {
  border: 1px solid var(--red-300);
}

.input::placeholder {
  color: var(--gray-400);
}

.input--sm {
  width: auto;
  min-width: 300px;
}

.input--xs {
  width: auto;
  min-width: 150px;
}

.input--text {
  max-width: 50%;
}

.input-label {
  display: block;
  margin-bottom: 2px;
  font-size: 0.875rem;
  color: var(--gray-800);
  font-weight: 500;
}

.inline-input-label {
  display: block;
  margin-bottom: 2px;
  color: var(--gray-600);
  font-weight: 500;
  padding-right: 6px;
  font-size: 0.875rem;
  text-transform: uppercase;
}

.input-container {
  flex-grow: 1;
  display: flex;
  align-items: center;
}

.field {
  display: flex;
  flex-direction: column;
}

.inline-field {
  display: flex;
  flex-direction: row;
  align-items: baseline;
}

.grow {
  flex: 1;
}

.help-box {
  padding: 8px 16px;
  font-weight: 500;
  color: var(--gray-500);
  display: inherit;
}

.help-box a {
  color: var(--gray-500);
}

.box {
  margin-bottom: 24px;
  padding: 16px;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-700);
  border: solid 1px var(--gray-300);
}

.box > *:not(:first-child) {
  margin-top: 1rem;
}

.box pre code {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  color: var(--gray-900);
}

.box.box-warning {
  color: var(--gray-900);
  background-color: var(--yellow-100);
  border-color: var(--yellow-600);
}

.hidden {
  display: none;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.unavailable {
  color: rgba(0, 0, 0, 0.5);
}

.button--sm {
  margin: 0;
  padding: 5px;
  background: transparent;
  position: relative;
  top: 14px;
}

.button--sm:hover {
  background: transparent;
  cursor: pointer;
}

.button-svg {
  transition-property: all;
  transition-duration: 200ms;
  color: var(--gray-600);
}

.hidden-checkbox-input {
  display: none;
}

.input-icon {
  border: 1px solid var(--gray-200);
  outline: none;
  padding: 8px 12px 8px 42px;
}

.input-icon:hover {
  cursor: pointer;
}

.input-icon.unavailable {
  border-color: var(--red-300);
}

.icon-container {
  position: absolute;
  top: 2px;
  padding: 5px 6px;
  border-right: 1px solid var(--gray-200);
  background-color: var(--gray-200);
  border-radius: 0.4rem;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  margin-left: 1px;
  height: 38px;
}

.icon-container:hover {
  cursor: pointer;
  background-color: var(--gray-300);
}

.input-icon-text {
  border: 1px solid var(--gray-200);
  outline: none;
  padding: 8px 12px 8px 42px;
}

.hidden-checkbox:hover {
  cursor: pointer;
}

/* Switch */

.switch-button {
  display: inline-block;
  position: relative;
  width: 56px;
  height: 28px;
  user-select: none;
}

.switch-button[disabled] {
  pointer-events: none;
  opacity: 0.5;
}

.switch-button-checkbox {
  outline: none;
  appearance: none;
  position: absolute;
  display: block;
  width: 28px;
  height: 28px;
  margin: 0;
  border-radius: 9999px;
  background-color: white;
  border: 5px solid var(--gray-200);
  cursor: pointer;
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 300ms;
}

.switch-button-bg {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 9999px;
  background-color: var(--gray-200);
  cursor: pointer;
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 300ms;
}

.switch-button-checkbox:checked {
  background: white;
  border-color: var(--blue-600);
  transform: translateX(100%);
}

.switch-button-checkbox:checked + .switch-button-bg {
  background-color: var(--blue-600);
}

/* Fix icon position - Safari 11+ */
@media not all and (min-resolution: 0.001dpcm) {
  @supports (-webkit-appearance: none) and (stroke-color: transparent) {
    .icon-container {
      top: 22px;
    }
  }
}

/* Fix icon border - Firefox */
@-moz-document url-prefix() {
  .icon-container {
    height: 24px;
  }
}

/* Hide the delete icon by default and only show it on row hover */
.table-row .delete-icon {
  visibility: hidden; /* Hide delete icon by default */
  position: absolute;
  right: 24px; /* Adjust as needed */
  top: 33%; /* Adjust as needed */
  cursor: pointer;
  color: #ccc; /* Light gray, visible on row hover */
  transition: color 0.3s; /* Smooth transition for color change */
}

/* Show the delete icon only when the row is hovered, and it's not focused */
.table-row:hover:not(.row-focused) .delete-icon {
  visibility: visible;
}

/* Darken the delete icon color when directly hovered over */
.delete-icon:hover {
  color: #333; /* Assuming #333 is the darker color you want */
}

.table-row select {
  min-width: 213px;
  width: auto;
  height: 39px;
  padding-left: 40px;
}
