@use 'variables' as vars;

// Select Page Type
// /////////////////////////////////////////////////////////////////////////////
.select-page-block {
  cursor: pointer;
  text-align: center;

  p {
    margin-top: 4px;
  }
}

.select-page-type {
  align-items: center;
  background-color: var(--background-warning);
  border-radius: 8px;
  color: var(--foreground-on-warning);
  display: flex;
  height: 60px;
  justify-content: center;
  width: 60px;

  svg {
    path {
      fill: var(--foreground-on-warning);
    }
  }
}

// Left Nav
.left-nav-link {
  align-items: center;
  display: flex;
  justify-content: space-between;
  width: 100%;
}

// Page Change Panel
// /////////////////////////////////////////////////////////////////////////////
.page-change {
  padding: vars.$spacing-sm;

  h2 {
    font-weight: bold;
  }
}

// Dashboard
// /////////////////////////////////////////////////////////////////////////////
.dashboard {
  padding: vars.$spacing-sm;

  .dashboard-scrollable {
    height: 356px;

    // hide scrollbar
    -ms-overflow-style: none;
    overflow-y: scroll;
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;

    &::-webkit-scrollbar {
      display: none;
    }
  }
}

.card {
  border: 2px solid var(--figma-color-border);
  border-radius: 6px;
  display: inline-flex;
  flex-direction: column;
  margin: 0 16px 16px 0;
  padding: vars.$spacing-sm;
  width: 212px;

  .view-condensed & {
    width: 234px;

    &:nth-child(2n) {
      margin-right: 0;
    }
  }

  .view-full & {
    &:nth-child(3n) {
      margin-right: 0;
    }
  }

  &.selected {
    border-color: var(--border-accent);
  }
}

.card-title {
  font-size: 11px;
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-type {
  align-items: center;
  align-self: flex-start;
  display: flex;
}

.flow-type-text {
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
  text-transform: capitalize;
}

.dashboard-footer {
  background-color: var(--figma-color-bg);
  border-top: 1px solid var(--figma-color-border);
  bottom: 0;
  height: 62px;
  left: 0;
  padding: vars.$spacing-sm;
  position: absolute;
  width: 100%;
}

.container-modal {
  align-items: center;
  display: flex;
  height: 100vh;
  justify-content: center;
  left: 0;
  position: absolute;
  top: 0;
  width: 100vw;
  z-index: 100;
}

.modal {
  background-color: var(--figma-color-bg);
  border: 1px solid var(--figma-color-border);
  border-radius: 6px;
  color: var(--figma-color-text);
  outline: 0;
  padding: vars.$spacing-sm;
  position: absolute;
  width: 344px;
  z-index: 300;

  h2 {
    font-size: 13px;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 280px;
  }

  .container-close {
    border-radius: 4px;
    cursor: pointer;
    padding: vars.$spacing-xs;
    position: absolute;
    right: -4px;
  }

  p {
    font-size: 11px;
    line-height: 14px;
  }
}

.modal-overlay {
  background-color: var(--figma-color-text-tertiary);
  height: 100vh;
  left: 0;
  opacity: 0.2;
  position: absolute;
  top: 0;
  width: 100vw;
  z-index: 200;
}

// Feedback
// /////////////////////////////////////////////////////////////////////////////
.feedback {
  padding: vars.$spacing-sm;

  p {
    font-size: 14px;
  }

  h2 {
    font-weight: bold;
  }

  textarea {
    background-color: var(--figma-color-bg);
    border-color: var(--figma-color-border);
    color: var(--figma-color-text);
    font-family: sans-serif;
    height: 240px;
    max-height: 356px;
    max-width: 668px;
    min-width: 668px;
    outline: none;
    padding: vars.$spacing-xs;
    width: 100%;

    &:focus {
      box-shadow: 0 0 2px 1px var(--border-accent);
    }
  }

  .feedback-footer {
    background-color: var(--figma-color-bg);
    border-top: 1px solid var(--figma-color-border);
    bottom: 0;
    display: flex;
    flex-direction: row;
    height: 62px;
    left: 0;
    padding: vars.$spacing-sm;
    position: absolute;
    width: 100%;
  }
}

// Landmarks
// /////////////////////////////////////////////////////////////////////////////
.row-landmark {
  height: 32px;
}

.landmark-type {
  text-transform: capitalize;
}

// Button selection containers (gestures, landmarks, headings, focus groups)
// /////////////////////////////////////////////////////////////////////////////
$selection-button-width: 72px;

.button-group {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
}

.container-selection-button {
  align-items: center;
  display: inline-flex;
  flex-direction: column;
  margin-right: 14px;
  scroll-snap-align: center;
  text-align: center;
  width: $selection-button-width; // scrollbar visible or not, still displaying fine
  
  &.small {
    height: 40px;
    margin-right: 12px;
    width: 40px;
  }
}

.selection-button {
  align-items: center;
  background-color: #e5e5e5;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  height: $selection-button-width;
  justify-content: center;
  overflow: hidden;
  position: relative;
  width: $selection-button-width;

  &:active {
    background-color: #8f8f8f;
    border-color: var(--border-accent);
  }

  &.small {
    height: 40px;
    width: 40px;

    svg {
      height: 50%;
      width: 50%;
    }
  }

  &.no-events {
    cursor: default;
    pointer-events: none;
  }

  .faded {
    opacity: 0.4;
  }

  .limit-reached {
    background-color: var(--figma-color-bg-disabled);
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    bottom: 0;
    color: var(--figma-color-text);
    font-size: 12px;
    position: absolute;
    text-align: center;
    transition: all 200ms ease;
    width: $selection-button-width;
  }
}

.selection-button-label {
  font-size: 11px;
  margin: 4px 0 12px;
  user-select: none;
}

// Headings
// /////////////////////////////////////////////////////////////////////////////
.heading-title {
  font-size: 12px;
  overflow: hidden;
  padding-left: vars.$spacing-xs;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 260px;
}

// Reading Order
// /////////////////////////////////////////////////////////////////////////////
.reading-order-text {
  flex: 1;
  margin-top: 8px;
  max-width: 194px;
}

.focus-order-line {
  align-items: center;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  min-height: 32px;

  & .drag-handle {
    width: 64px;
  }
}

// Color Contrast
// /////////////////////////////////////////////////////////////////////////////
.contrast-row {
  align-items: center;
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  justify-content: space-between;

  .contrast-goto {
    display: none;
  }

  &:hover .contrast-goto {
    display: block;
  }
}

.contrast-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 348px;
}

// Color Blindness
// /////////////////////////////////////////////////////////////////////////////
.cb-controls {
  background-color: var(--figma-color-bg);
  border-bottom: 1px solid var(--figma-color-border);
  margin: 0 0 0 -16px;
  padding: 16px;
  position: sticky;
  top: -16px;
  width: calc(100% + 32px);
  z-index: 100;

  p {
    font-weight: bold;
  }
}

.cb-glossary-item {
  align-items: center;
  display: flex;
  flex-direction: row;
  font-size: 11px;
  justify-content: space-between;
  margin-bottom: 8px;
  max-width: 500px;
  width: 100%;

  & .cb-glossary-desc {
    flex: 1;
    margin: 0 8px;
  }

  & .cb-pop {
    color: var(--foreground-muted);
  }
}

.cb-types {
  display: grid;
  grid-gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));

  & .cb-type {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 46px;
    justify-content: center;
  }

  & .cb-selected {
    border-color: var(--figma-color-border-onselected-strong);
    font-weight: bold;
  }
}

.cb-preview-content {
  border: 1px solid var(--figma-color-border);
  display: flex;
  margin-top: 16px;
  position: relative;

  & svg {
    position: absolute;
    top: 0;
    z-index: -1000;
  }

  & img {
    height: auto;
    width: 100%;
  }
}

.protanopia {
  filter: url("#protanopia");
}

.protanomaly {
  filter: url("#protanomaly");
}

.deuteranopia {
  filter: url("#deuteranopia");
}

.deuteranomaly {
  filter: url("#deuteranomaly");
}

.tritanopia {
  filter: url("#tritanopia");
}

.tritanomaly {
  filter: url("#tritanomaly");
}

.achromatopsia {
  filter: url("#achromatopsia");
}

.achromatomaly {
  filter: url("#achromatomaly");
}

// Settings
// /////////////////////////////////////////////////////////////////////////////
.settings {
  padding: vars.$spacing-sm;

  footer {
    bottom: 0;
    left: 0;
    position: absolute;
    width: 100%;
  }
}

// Breakpoints
// /////////////////////////////////////////////////////////////////////////////
.container-breakpoints {
  width: 100%;
}

.breakpoint-row {
  height: 36px;
}

.breakpoint-label {
  align-items: center;
  color: var(--foreground-muted);
  display: flex;
  flex-direction: row;
  padding-right: 4px;

  svg {
    margin-right: 4px;
  }
}

.input-name {
  width: 96px;
}

.input-width {
  text-align: right;
  width: 64px;
}

.add-breakpoint-row {
  border-radius: 4px;
  cursor: pointer;
  margin: 16px 0;
  padding: 8px 0;
  width: fit-content;
  
  svg {
    margin-right: 4px;
  }
}