@import "variables.css";
@import "reset.css";
@import "base.css";

@import "components/RichTextEditor.css";
@import "components/Snackbar.css";
@import "components/CustomInput.css";
@import "components/DropdownMenu.css";

@keyframes pulse {
  50% {
    opacity: 0.5;
  }
}

.table-loading {
  height: 3rem;
  background-color: light-dark(var(--gray-2), var(--gray-7));
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.primary-btn {
  font-weight: 500;
  cursor: pointer;
  border: none;
  outline: none;
  background: var(--yellow-6);
  color: var(--white);
  border-radius: 5px;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  height: 40px;

  &:disabled {
    opacity: 0.5;
    cursor: not-allowed;

    &:hover {
      background: var(--yellow-4);
    }
  }

  &:hover {
    background: var(--yellow-5);
  }

  &:active {
    background: var(--yellow-4);
  }
}

.default-btn {
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  cursor: pointer;
  color: light-dark(var(--gray-5), var(--gray-4));
  background-color: light-dark(var(--white), var(--gray-9));
  border: 1px solid light-dark(var(--gray-5), var(--gray-6));
  border-radius: 5px;
  height: 40px;
  padding-left: 0.75rem;
  padding-right: 0.75rem;

  &.square {
    padding: 0.5rem;
  }

  &:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  &:hover {
    background-color: light-dark(var(--gray-2), var(--gray-8));
  }

  &:active {
    background-color: light-dark(var(--gray-3), var(--gray-7));
  }

  &:disabled:hover {
    background-color: light-dark(var(--gray-2), var(--gray-8));
  }
}

.card {
  background-color: light-dark(var(--white), var(--gray-8));
  border: 1px solid light-dark(var(--gray-2), var(--gray-7));
  border-radius: 0.5rem;
}

header {
  display: flex;
  align-items: center;
  height: 60px;
  background-color: light-dark(var(--white), var(--gray-8));
  border-bottom: 1px solid light-dark(var(--gray-2), var(--gray-7));
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.subheader {
  color: light-dark(var(--gray-5), var(--gray-4));
}

.selected-link {
  border-left: 4px solid var(--yellow-6);
}

.icon-lg {
  width: 1.5rem;
  height: 1.5rem;
  stroke: currentColor; /* Inherits the text color of the parent button */
}

.icon {
  width: 1.5rem;
  height: 1.5rem;
  stroke: currentColor; /* Inherits the text color of the parent button */
}

.icon-sm {
  width: 1rem;
  height: 1rem;
  stroke: currentColor; /* Inherits the text color of the parent button */
}

.icon-xs {
  width: 0.5rem;
  height: 0.5rem;
  stroke: currentColor; /* Inherits the text color of the parent button */
}

.hamburger-btn {
  cursor: pointer;
  border: none;
  background-color: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem;
  border-radius: 5px;

  &:hover {
    background-color: light-dark(var(--gray-3), var(--gray-6));
  }
}

dialog[x-type="modal"] {
  background-color: light-dark(var(--white), var(--gray-8));
  position: fixed;
  padding: 1rem;
  width: 75%;
  margin-top: 50px;
  margin-left: auto;
  margin-right: auto;
  border: none;
  border-radius: 8px;
  transition: opacity 0.4s allow-discrete;
}

dialog[x-type="modal"]::backdrop {
  pointer-events: none;
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.4);
}

dialog[x-type="sidebar"] {
  border: none;
  padding: 2ch;
  background-color: light-dark(var(--white), var(--gray-8));
  box-sizing: border-box;

  margin-left: auto;
  overflow-y: auto;

  width: 90%;
  max-width: 400px;
  height: 100%;
  max-height: none;

  transform: translateX(0%);

  transition:
    transform 0.4s ease,
    display 0.4s allow-discrete,
    overlay 0.4s allow-discrete;

  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
}

dialog[x-type="sidebar"]::backdrop {
  pointer-events: none;
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.4);
  transition: opacity 0.4s allow-discrete;
}

input[type="checkbox"] {
  border: 1.5px solid var(--gray-6);
  background: light-dark(var(--gray-2), var(--gray-9));
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  cursor: pointer;

  &:checked {
    background: var(--primary-3);

    &:hover {
      background: var(--primary-2);
    }
  }

  &:hover {
    background: light-dark(var(--gray-1), var(--gray-8));
  }
}

@starting-style {
  dialog[x-type="sidebar"] {
    transform: translateX(100%);
  }

  dialog[x-type="sidebar"]::backdrop {
    opacity: 0;
  }

  dialog[x-type="modal"]::backdrop {
    opacity: 0;
  }
}

.link {
  color: light-dark(var(--blue-4), var(--blue-3));
  text-decoration: none;

  &:hover {
    text-decoration: underline;
  }
}

.login-card {
  padding: 2rem;
  max-width: 448px;
  border: 1px solid light-dark(var(--gray-2), var(--gray-6));
  border-radius: 12px;
  background: light-dark(var(--white), var(--gray-8));
  box-shadow: 0 1px 4px oklch(0 0 0 / 0.1);
}

.login-btn {
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 8px;
  color: var(--gray-9);
  background: var(--yellow-5);
  font-weight: 500;
  cursor: pointer;

  &:hover {
    background: var(--yellow-6);
  }

  &:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid light-dark(var(--gray-2), var(--gray-7));
}

thead th,
tbody td {
  padding-left: 1rem;
  padding-right: 1rem;
}

thead th {
  border-top: 1px solid light-dark(var(--gray-2), var(--gray-7));
  height: 4rem;
  font-weight: 600;
  font-size: 0.75rem;
  line-height: 1rem;
  color: light-dark(var(--gray-5), var(--gray-5));
}

tbody td {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: light-dark(var(--gray-9), var(--gray-1));
}

#license-plate-form {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(5, 1fr);

  .col-span-2 {
    grid-column: span 2 / span 2;
  }

  .col-span-3 {
    grid-column: span 3 / span 3;
  }

  .col-span-4 {
    grid-column: span 4 / span 4;
  }

  .col-span-5 {
    grid-column: span 5 / span 5;
  }

  .col-start-1 {
    grid-column-start: 1;
  }

  .col-end-1 {
    grid-column-end: 1;
  }

  .col-end-4 {
    grid-column-end: 4;
  }
}
