@import url('./reset.css');

:root {
  --accent-color: var(--color-accent);
}

html,
body,
input,
button,
select {
  font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html,
body {
  font-size: 16px !important;
  line-height: 1.15 !important;
}

body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--color-foreground);
  overflow: hidden;
}

code {
  font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
    monospace;
}

h4 {
  font-weight: normal;
  font-size: 0.8rem;
  line-height: 1rem;
  margin: 0;
}

h5 {
  font-weight: normal;
  font-size: 0.8rem;
  line-height: 1rem;
  margin: 0;
}

strong {
  margin: 0;
}

ul,
.tags {
  list-style-type: none;
  margin: 0;
}

label {
  color: var(--color-foreground);
}

#root {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: var(--color-background-1);
}

.app-header {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: var(--color-background-2);
  border-bottom: 1px solid var(--color-background-4);
  max-width: 100%;
  flex-wrap: wrap;
}

.lanes {
  background: var(--color-background-1);
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  gap: 40px;
  overflow-x: auto;
  flex-grow: 1;
  margin: 0;
}

@media (pointer: coarse) {
  .lanes {
    scroll-snap-type: x mandatory;
  }
}

.lanes--has-title {
  height: calc(100dvh - 57px - 49px);
}

input,
button,
select {
  height: 32px;
  padding: 4px 15px;
  border-radius: 6px;
  font-size: inherit;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.02);
  box-sizing: border-box;
  color: var(--color-foreground);
  white-space: nowrap;
}

input,
select {
  background: var(--color-background-4);
  border: 0;
}

input {
  font-size: inherit !important;
  height: inherit;
  margin: inherit;
}

button,
select {
  cursor: pointer;
}

button {
  transition: all 0.1s;
  background: var(--color-background-4);
  border: none;
  color: var(--color-foreground);
  text-align: center;
  text-align: -moz-center;
  text-align: -webkit-center;
}

button:hover {
  transition: all 0.1s;
  filter: brightness(1.2);
}

@media (prefers-color-scheme: light) {
  button:hover {
    filter: brightness(1.05);
  }
}

button:active, button.active {
  filter: brightness(0.8);
}

button svg {
 fill: var(--color-foreground); 
}

button.small {
  padding: 0;
  width: 25px;
  height: 25px;
  font-size: 1rem;
  line-height: 1rem;
}

.header-buttons {
  display: flex;
  gap: 6px;
}

.search-input {
  max-width: 232px;
  width: 100%;
}

.app-header__group-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.app-header__group-item-label {
  white-space: nowrap;
}

.app-title {
  margin-top: 12px;
  margin-left: 20px;
  margin-bottom: 0;
}

.lane {
  display: flex;
  flex-direction: column;
  scroll-snap-align: center;
  max-width: 100%;
  transition: translate 0.25s;
}

.lane__header {
  display: flex;
  gap: 6px;
  justify-content: space-between;
  align-items: center;
  cursor: grab;
  margin-bottom: 12px;
  max-width: 300px;
}

.lane__header-name-and-count {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

.lane__header-name {
  min-width: 0;
  word-wrap: break-word;
  text-wrap: balance;
}

.lane__content {
  flex-grow: 1;
  width: 300px;
  background: var(--color-background-2);
  border-radius: 8px;
  padding: 12px;
  box-sizing: border-box;
  overflow-y: auto;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  cursor: grab;
}

.card {
  width: 100%;
  background: var(--color-background-3);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  cursor: pointer;
  font-size: 0.9rem;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.02);
  border-radius: 6px;
  box-sizing: border-box;
  padding: 12px;
  transition: translate 0.25s;
}

.view-mode-extended .card,
.view-mode-regular .card {
  min-height: 75px;
}

.card.card__drag-disabled {
  cursor: pointer !important;
}

.card__name {
  overflow: hidden;
  user-select: none;
}

.card__toolbar {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: start;
  overflow: hidden;
  gap: 8px;
}

.card__toolbar > :first-child {
  flex-grow: 1;
}

.card__tags {
  display: flex;
  align-items: start;
  flex-wrap: wrap;
  gap: 8px;
  overflow: hidden;
  padding: 0;
  /* Those are required to override stacks classes */
  margin: 0;
  list-style-type: none;
}

.card__tags:not(:empty) {
  min-height: 24px;
  margin-top: 8px;
}

.card__due-date {
  display: flex;
  align-items: center;
}

.card__content:not(:empty),
.card__due-date:not(:empty) {
  margin-top: 12px;
}

.card__content {
  display: none;
}

[popover] {
  inset: unset;
  position: absolute;
  border-radius: 6px;
  border: 1px solid var(--color-background-4);
  box-sizing: border-box;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05), 0 2px 2px rgba(0, 0, 0, 0.05),
    0 4px 4px rgba(0, 0, 0, 0.05), 0 6px 8px rgba(0, 0, 0, 0.05),
    0 8px 16px rgba(0, 0, 0, 0.05);
  background: none;
  display: flex;
  flex-direction: column;
  padding: 0;
}

:popover-open {
  display: flex;
  flex-direction: column;
}

[popover] > button {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  text-align: left;
  background: var(--color-background-2);
  border-radius: 0;
  color: var(--color-foreground);
}

[popover] > :first-child {
  border-radius: 6px 6px 0 0;
}

[popover] > :last-child {
  border-radius: 0 0 6px 6px;
}

.tag {
  padding: 4px;
  border-radius: 5px;
  background: var(--color-accent);
  user-select: none;
  white-space: nowrap;
}

.tag--clicable {
  cursor: pointer;
}

.tag h5 {
  color: var(--color-foreground);
}

.counter {
  font-weight: bold;
}

.dialog-backdrop {
  background: rgba(0, 0, 0, 0.5);
  width: 100dvw;
  height: 100dvh;
  position: absolute;
  top: 0;
  left: 0;
}

dialog {
  margin: auto;
  padding: 0;
  width: 100%;
  height: 100%;
  inset: 0px;
  border: none;
  background: var(--color-background-2);
  border-radius: 5px;
}

dialog:not(.dialog--maximized) {
  max-width: 960px;
  max-height: 819px;
}

.dialog__body {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 12px;
  text-align: left;
  height: 100%;
}

.dialog__toolbar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 3rem;
}

.dialog__toolbar h1 {
  margin-top: 0;
}

.dialog__toolbar-name {
  /* https://stackoverflow.com/a/36247448 */
  min-width: 0;
  width: 100%;
  word-wrap: break-word;
  text-wrap: balance;
  display: inline-block;
  margin-top: 0;
  margin-bottom: 0;
  color: var(--color-foreground);
}

.dialog__toolbar-btns {
  flex-grow: 0;
  display: flex;
  gap: 8px;
}

.dialog__toolbar-btn {
  width: 35px;
  height: 35px;
  padding: 0;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
}

.dialog__tags-and-due-date {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  align-items: start;
}

.dialog__tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: start;
}

.dialog__due-date {
  height: 32px;
  gap: 8px;
  display: flex;
  align-items: center;
}

.dialog__due-date label {
  white-space: nowrap;
}

.card__due-date--in-time {
  color: var(--color-alt-3);
}

.card__due-date--past-time {
  color: var(--color-alt-1);
}

.dialog__tags .tag {
  padding: 6px;
}

.dialog__content {
  overflow: hidden;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.input-and-error-msg {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-error {
  outline: 1px solid var(--color-alt-1);
  border-color: var(--color-alt-1);
}

.error-msg {
  color: var(--color-alt-1);
  font-size: 0.8rem;
}

a,
a > * {
  color: var(--color-accent) !important;
}

.color-preview-option {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.being-dragged.card,
.being-dragged > .lane__header,
.being-dragged > .lane__content {
  cursor: grabbing;
}

.being-dragged.card,
.being-dragged > .lane__content {
  box-shadow: rgba(0, 0, 0, 0.3) 0px 0px 12px 0px;
}
#editor-container {
  height: 100%;
  position: relative;
}

.editor {
  height: 100%;
  max-height: none;
  resize: none;
  margin-bottom: 4rem;
  background: var(--color-background-1) !important;
  border: none !important;
  color: var(--color-foreground) !important;
}

.disable-image-upload .js-insert-image-btn {
  display: none;
}

.editor {
  resize: none !important;
}

.editor .s-btn {
  color: var(--color-accent);
}

.editor .s-btn:hover {
  background: var(--color-background-3) !important;
}

.editor .is-selected {
  background: var(--color-accent) !important;
  color: var(--color-accent);
}

.editor .s-popover {
  background: var(--color-background-2);
  border-color: var(--color-accent);
  color: var(--color-foreground);
}

.editor .s-popover button {
  color: var(--color-foreground);
  border: none 0;
}

.editor .s-popover--arrow {
  color: var(--color-foreground) !important;
}

.editor pre {
  background: var(--color-background-2) !important;
}

.editor .s-btn__outlined {
  border-color: var(--color-background-4) !important;
}

.view-mode-extended .card__content {
  display: -webkit-box;
  height: auto;
  text-overflow: ellipsis;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
  max-height: 3rem;
}

.view-mode-compact .card__tags  {
  min-height: 0;
}

.view-mode-tight .card {
  padding: 8px;
}

.view-mode-tight .card__name {
  white-space: nowrap;
  text-overflow: ellipsis;
}

.view-mode-tight .card__tags  {
  flex-wrap: nowrap;
  width: 100%;
  overflow: auto;
  min-height: 0;
}

.view-mode-tight .card__tags:not(:empty),
.view-mode-tight .card__due-date:not(:empty) {
  margin-top: 6px;
}

.view-mode-tight .card__toolbar  {
  gap: 8px;
}

.view-mode-tight .card .tag  {
  padding: 2px;
}

.view-mode-tight .card button {
  height: 20px;
  width: 19px;
}

.view-mode-tight .lane__content {
  gap: 6px;
}

.svg-icon-bg.iconEllipsisHorizontal {
  --bg-icon: url("~@stackoverflow/stacks-icons/src/Icon/EllipsisHorizontal.svg");
}

.s-tag {
  color: var(--color-foreground);
}

.s-tag ~ .ProseMirror-separator {
  display: inline;
}

.editor .s-code-block.markdown {
  height: 100%;
}