/* packages/facsimile/src/ControlBar.css */
.control-bar {
  position: absolute;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  padding: 0.5rem;
  border-radius: 0.25rem;
  opacity: 0.7;
  &:hover {
    opacity: 1;
  }
  transition: opacity 0.2s;
  button {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 0.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    &:disabled {
      opacity: 1;
      color: grey;
    }
    &.active {
      font-weight: bold;
      background: #ddd;
    }
  }
}

/* packages/facsimile/src/Tooltip.css */
.tooltip {
  position: fixed;
  width: 10em;
  padding: 0.5em;
  font-size: 0.8em;
  background-color: rgba(255, 255, 255, 0.5);
}

/* packages/facsimile/src/FacsimileView.css */
.facsimile-view {
  > .control-bar {
    top: 0.5rem;
    left: 0.5rem;
  }
  .navigation {
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-family: monospace;
    .control-bar {
      position: relative;
      button {
        justify-content: center;
      }
    }
    .info {
      background: rgba(255, 255, 255, 0.66);
      border-radius: 0.25rem;
      padding: 0.5rem;
      font-size: 0.8em;
    }
  }
}

/* node_modules/@knaw-huc/original-layout/dist/assets/original-layout.css */
*,
*:before,
*:after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  width: 100%;
  font-family: sans-serif;
  font-size: 1rem;
}
.original-layout {
  overflow: hidden;
  position: relative;
}
.original-layout .text {
  position: absolute;
  top: 0;
  left: 0;
}
.original-layout .line-numbers {
  position: absolute;
}
.original-layout .line-numbers .line-number {
  position: absolute;
  color: #00c800;
  font-family: monospace;
}
.original-layout .bounding-box {
  border: dashed 1px blue;
}
.original-layout .fragment {
  font-size: 8px;
  font-family: monospace;
  white-space: nowrap;
}
.original-layout .blocks,
.original-layout .boundaries {
  display: block;
}

/* packages/line-by-line/src/NormalizedLayout.css */
.normalized-view {
  margin-left: 0.5em;
  white-space: pre-wrap;
  overflow: hidden;
  display: grid;
  width: fit-content;
  padding-right: 1em;
  .text,
  .overlay {
    grid-area: 1 / 1;
  }
  .overlay {
    width: 100%;
    height: 100%;
    pointer-events: none;
  }
  .text {
    width: fit-content;
  }
  .line {
    display: flex;
    line-height: 1.75em;
    .line-number {
      flex-shrink: 0;
      font-family: monospace;
      margin-right: 0.5em;
      margin-left: 0.5em;
      color: grey;
    }
  }
  .block-group {
    border-left: 3px solid transparent;
    &.selected {
      background: inherit;
      border-left-color: rgba(0, 150, 0, 0.5);
    }
  }
  .word {
    cursor: pointer;
    &:hover {
      background: rgba(0, 0, 0, 0.05);
    }
    &.selected {
      background: greenyellow;
    }
  }
}

/* src/document/layout/Splitter.css */
.splitter {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eee;
  &:hover {
    background: #ddd;
  }
  &:focus-visible {
    outline: none;
  }
  &.active {
    background: #ccc;
  }
  .splitter-grip {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 1em;
    .grip-icon {
      width: 0.75em;
    }
  }
  &.horizontal {
    cursor: col-resize;
  }
  &.vertical {
    cursor: row-resize;
    .grip-icon {
      transform: rotate(90deg);
    }
  }
}

/* src/document/layout/Header.css */
.header {
  display: flex;
  align-items: center;
  background: #eee;
  padding: 0.33rem 0.5rem;
  gap: 2rem;
  flex-shrink: 0;
  z-index: 20;
  .region {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
    &.center {
      flex: 1;
      min-width: 0;
    }
    button,
    .zoom-slider {
      height: 2rem;
      background: white;
      border: 1px solid #ddd;
      border-radius: 0.2rem;
      cursor: pointer;
      display: flex;
      align-items: center;
      padding: 0.25rem 0.5rem;
    }
    button:disabled {
      opacity: 1;
      color: grey;
    }
    button.active {
      font-weight: bold;
    }
  }
}

/* src/document/layout/DocumentLayout.css */
.document-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* src/document/TranscriptionView.css */
.message {
  margin: 2rem;
  color: grey;
  &.error {
    color: indianred;
  }
}
.transcription-view {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  > .control-bar {
    top: 0;
    right: 0;
  }
  .zoom-slider {
    display: flex;
    align-items: center;
    background: #f6f6f6;
    border: 1px solid #ddd;
    border-radius: 0.2rem;
    padding: 0.2rem;
    gap: 0.2rem;
    input {
      width: 6rem;
    }
    input,
    .icon {
      cursor: pointer;
    }
  }
  .content {
    flex: 1;
    overflow: hidden;
    display: grid;
    position: relative;
    .viewport {
      grid-area: 1 / 1;
      visibility: hidden;
    }
    .viewport.active {
      visibility: visible;
    }
    .diplomatic-viewport {
      position: absolute;
      inset: 0;
      overflow: auto;
      .ratio-box {
        margin: 0 auto;
      }
      .with-blocks {
        width: 100%;
        height: 100%;
        position: relative;
        overflow: hidden;
      }
    }
    .line-by-line-viewport {
      overflow: auto;
    }
  }
}
.entity {
  background: color-mix(in srgb, var(--color) 15%, transparent);
  border-bottom: 1px solid var(--color);
  &.date {
    --color: #6b72d4;
  }
  &.document {
    --color: #9ca3af;
  }
  &.name-of-location {
    --color: #4db88a;
  }
  &.ship-type {
    --color: #5a9bd8;
  }
  &.civic-status {
    --color: #d86a6a;
  }
  &.name-of-person {
    --color: #c9a832;
  }
  &.ship-name {
    --color: #2aa8ba;
  }
  &.quantity {
    --color: #a87ac4;
  }
  &.other-persons-attributes-than-per-or-status {
    --color: #dc8a4a;
  }
  &.commodity-qualifier-colors-processing {
    --color: #3aab9a;
  }
  &.name-of-commodity {
    --color: #42b8c8;
  }
  &.ethno-religious-appellation-or-attribute-not-derived-from-location-name {
    --color: #d07aa0;
  }
  &.derived-adjectival-form-of-location-name {
    --color: #4aab6a;
  }
  &.profession-title {
    --color: #7a7ab8;
  }
  &.organisation-name {
    --color: #c2462a;
  }
}
.text {
  .selected {
    background: greenyellow;
  }
}

/* src/document/DocumentView.css */
html,
body,
#root {
  height: 100%;
  margin: 0;
}
.facsimile-view {
  overflow: hidden;
}

/* src/document/example/ManifestDropdown.css */
.manifest-dropdown {
  position: relative;
  width: 100%;
  height: 2rem;
  input {
    width: 100%;
    height: 100%;
    border: 1px solid #ddd;
    border-radius: 0.2rem;
    padding: 0 0.5rem;
    background: white;
    font: inherit;
  }
  ul {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 20rem;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-radius: 0 0 0.2rem 0.2rem;
    list-style: none;
    margin: 0;
    padding: 0;
    z-index: 100;
    li {
      font-size: 0.9rem;
      padding: 0.25rem 0.5rem;
      cursor: pointer;
      &:hover {
        background: #f0f0f0;
      }
      &.selected {
        font-weight: bold;
      }
      &.more-info {
        color: grey;
        cursor: default;
        &:hover {
          background: inherit;
        }
      }
    }
  }
}
