/* Flex display */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

/* Container stlying */
.container {
  display: flex;
  flex-flow: column;
  height: 100%;
}

.container>.container-header {
  align-items: center;

  header {
    background-color: var(--tds-color--tertiary);
  }

  .global-search {
    width: 300px;
  }

  .header-schematics-page{
    display: block;
    padding: 4px 16px;
    text-align: center;
  }
}

.container>.container-header>.filter-div {
  padding: 5px 0px 5px;
  border-bottom: 1px solid var(--tds-theme-border);
}

.container>.container-body {
  flex: 1 1 auto;
  height: 85%;

  .explorer-match-highlight-all{
    font-weight: bold;
  }

  .explorer-match-highlight-selected{
    fill: var(--tds-color--blue30);
    text-decoration: underline;
    font-weight: bold;
  }
}

.container-body>.container-schematics {
  width: 100%;
  height: 95%;

  svg {  
    position: relative;
    left: 0;
    top: 0;
  
    width: 100%;
    height: 100%;

    .pin-highlight {
      cursor: pointer;
      font-weight: bold;
      fill: var(--tds-theme-primary);
      filter: drop-shadow(0px 0px 150px var(--tds-theme-primary));
    }
  }
}

.container>.container-footer {
  position: absolute;
  bottom: 0%;
  height: 36px;
  border-top: 1px solid var(--tds-theme-border);
}

/* Dark mode support */
.tds-scrim--black {
  .container-schematics, .connector-terminal-faceview, .connector-connector-location {
    filter: invert(1);
  }
}

/* Header modal */
.page-list-nav-title {
  padding-top: 0px;
  padding-bottom: 20px;
  text-decoration: underline;
}

.page-list-nav-link-container {
  padding-bottom: 7px;
}

.user-tutorial-section {
  li {
    padding: 3px 0px;
  }

  .keyboard-shortcuts {
    padding-left: 40px;
    padding-right: 100px;

    li {
      display: flex; 
      justify-content: space-between;
    }
  }
}

/* Header filter menu */

.filter-cell-text-center {
  text-align: center;
}
.filter-cell-text-right {
  text-align: right;
  padding: 0 10px;
}
.filter-table {
  margin: auto;
}

/* Explorer modal */
.explorer-modal {
  position: absolute;
  margin-top: 3px;
  max-height: 170px;

  background-color: var(--tds-theme-background-dialog);
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
  opacity: 0.99;
  padding: 5px 40px 5px 0px;

  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  z-index: 1;

  .explorer-nav{
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;

    padding: 5px 0px;

    .tds-modal-close {
      position: absolute;
      margin-left: 10px;
      margin-right: 10px;
      right: 0px;
      width: 40px;
      z-index: 5;
    }
  }

  .explorer-progress {
    padding: 0px 15px 0px 15px;
    width: 90px;

    font-size: 12px;
    font-weight: bold;
    line-height: 15px;
    text-align: center;
  }

  .explorer-error {
    /* Overlap explorer navigation */
    position: absolute;
    left: 0;
    top: 0;
    width: 86%;
    height: 60px;
    background-color: var(--tds-theme-background-dialog);
    z-index: 5;

    /* Align text in the center */
    display: none;
    justify-content: center;
    align-items: center;
    text-align: center;

    font-size: 16px;
    font-weight: bold;
    white-space: pre;
    color: var(--tds-color--error);
  }

  .explorer-pages {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;

    width: 300px;
    /* manually center */
    margin-left: 40px;
    margin-top: 5px;
    padding: 5px 5px 0px 5px;

    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    border-top: 1px solid var(--tds-theme-border);
  
    overflow-y: auto;
    font-size: 11px;

    .explorer-pages-list-div {
      padding-bottom: 5px;
      a {
        cursor: pointer;
      }
    }
  }
}

/* Connector modal (popup) */

.connector-modal{
  max-height: 600px;
  width: 350px;
  padding: 5px;

  background-color: var(--tds-theme-background-dialog);
  border: 1px solid var(--tds-theme-border);
  border-radius: 3px;

  font-size: 15px;
  text-align: center;

  .connector-pin-number {
    font-weight: bold;
    border-bottom: 1px solid var(--tds-theme-border);
    padding: 5px;
  }

  .connector-terminal-faceview img {
    max-height: 150px;
    max-width: 340px;
    padding-top: 10px
  }

  .connector-connector-location img {
    height: 250px;
    max-width: 340px;
    padding-bottom: 10px;
  }

  .connector-connector-information, .connector-terminal-information {
    line-height: 15px;
    text-align: left;
    padding: 6px 10px;
    border-top: 1px solid var(--tds-theme-border);
    p {
      padding-bottom: 3px;
      font-weight: 500;
    }
    div {
      font-size: 12px;
      padding-left: 20px;
    }
  }
  .connector-terminal-information, .connector-diagnostic-information {
    border-top: 1px solid var(--tds-theme-border);
  }
}

/* Connector modal (overlay) */
.connector-overlay-modal{
  width: 70%;
  .connector-reference-link {
    display: inline-block;
    color: var(--tds-theme-primary-highlight);
    border-bottom: 1px solid currentColor;
    line-height: 28px;
  }

  .connector-image-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 100%;
    border-bottom: 1px solid var(--tds-theme-border);
    padding-bottom: 10px;
  }

  .connector-terminal-faceview img {
    max-height: 250px;
    max-width: 40%;
    padding-right: 10px;
  }

  .connector-connector-location img {
    max-height: 350px;
    max-width: 60%;
    object-fit: contain;
    padding-left: 10px;
    border-left: 1px solid var(--tds-theme-border);
  }

  .connector-connector-information, .connector-terminal-information, .connector-diagnostic-information {
    padding: 10px 0px;
    border-top: 1px solid var(--tds-theme-border);
    font-size: var(--tds-font-size-30);
    line-height: var(--tds-line-height-20);
    p {
      font-size: var(--tds-font-size-40);
      font-weight: var(--tds-font-weight-medium);
      padding-bottom: 4px;
    }
    div {
      margin-left: 20px;
    }
    .connector-terminal-can-device-res, .connector-terminal-can-harness-res {
      padding-left: 40px;
    }
  }

  .connector-cavities {
    border-top: 1px solid var(--tds-theme-border);
    padding-top: 10px;
    .tds-accordion-content {
      padding: 10px;
    }
    .tds-table-row td.clickable {
      cursor: pointer;
      transition: background-color 0.3s, color 0.3s;
    }

    .tds-table-row td.clickable:hover {
      font-weight: bold;
      background-color: var(--tds-color--tertiary);
      color: var(--tds-theme-primary);
    }
  }  
}

/* SVG view control */
.svg-controls {
  position: absolute;
  top: 120px;
  left: 1%;
  z-index: 5;
  opacity: 0.9;
}

/* Schematics page control */
.schematics-controls {
  z-index: 5;
  opacity: 0.9;
  font-size: 12px;

  span {
    line-height: 15px;
  }

  #schematics-next, #schematics-prev{
    position: absolute;
    bottom: 45px;
    width: 250px;
    height: 45px;
  }

  #schematics-next{
    right: 1%;
    padding-left: 50px;
    padding-right: 20px;
  }

  #schematics-prev{
    left: 1%;
    padding-left: 20px;
    padding-right: 50px;
  }

  .schematics-next-icon, .schematics-prev-icon {
    position: absolute;
    width: 30px;
  }

  .schematics-next-icon {
    left: 10px;
  }

  .schematics-prev-icon {
    right: 10px;
  }
}

/* Search highlight style */
g > text.search-highlight {
  fill: var(--tds-theme-primary);;
  font-weight: bold;
}

g > path.search-highlight {
  fill: var(--tds-theme-primary);
  fill-opacity: 0.4;
}

/* Hover over styles */
path.connector-block-shadow {
  fill: var(--tds-theme-primary);
  fill-opacity: 0.2;
  stroke: var(--tds-theme-primary-highlight);
  filter: drop-shadow(0px 0px 100px var(--tds-theme-primary));
  cursor: pointer;
}

/* Responsive display */

@media screen and (max-width: 1500px) {
  .filter-option-code {
    display: none !important;
  }
}

@media screen and (max-width:960px) {
  .filter-device-pin {
    display: none !important;
  }
}

@media screen and (max-width:800px) {
  .list-schematics-title {
    display: none !important;
  }
}

@media screen and (max-width: 600px) {
  .svg-controls {
    display: none !important;
  }
}

/* SVG container */
