/*Styles for the structure detection page*/
/*Basic style*/
.detect-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr minmax(calc(var(--f7-chip-height) + 33px), auto) auto min-content;
  grid-template-areas: 
    "image-view"
    "result-view"
    "detect-settings"
    "menu-view";
  justify-items: center;
  height: calc(100% - var(--f7-navbar-height) - var(--f7-safe-area-top) - var(--f7-safe-area-bottom));
  max-height: calc(100% - var(--f7-navbar-height) - var(--f7-safe-area-top) - var(--f7-safe-area-bottom));
}

.image-container {
  grid-area: image-view;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  position: relative;
  display: flex;
  align-self: stretch;
}

.popover-button-menu {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
}

.segment-button-menu {
  flex-wrap: nowrap;
  flex-direction: column;
  max-height: 100%;
  min-height: 0px;
}

.chip-media {
  background-color: var(--chip-media-background) !important;
}

.chip-results {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 10px;
  --f7-chip-border-radius: 16px;
  --f7-chip-media-size: 32px;
  --f7-chip-font-weight: normal;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 100%;
}

.chip-results .chip {
  padding-left: 8px;
}

.progress-hide {
  display: hidden;
}

.selected-chip {
  font-weight: 500;
  box-shadow: 4px 4px 1px var(--avn-theme-color);
  transform: translate(-2px, -2px);
}

.detect-inputs {
  display: flex;
  align-items: center;
  margin: 5px;
  width: 100%;
  max-width: 400px;
  min-width: 192px;
}

.level-slide-vert {
  display: none;
}

.image-menu {
  grid-area: menu-view;
  margin: 5px;
  max-width: 400px;
  min-width: 192px;
}

.image-menu .button {
  aspect-ratio: 1;
  height: auto;
  padding: 5px;
  flex: 1 1 0%;
}

.image-menu > .button > svg {
  aspect-ratio: 1;
  height: auto;
  width: 100%;
}

.segment-button-menu .button {
  padding: 8px;
  aspect-ratio: 1;
  width: auto;
  flex: 1 1 0%;
  max-height: 100px;
  max-width: 100px;
}

.dialog-buttons {
  align-items: center;
}

.avn-dialog-button {
  font-size: 17px;
  align-self: center;
}

/*Additional styles for small format landscape orientation*/
@media (max-height: 450px) and (orientation: landscape) {
  .detect-grid {
    grid-template-columns: minmax(0,1fr) minmax(56px,max-content) auto auto;
    grid-template-rows: calc(100vh - var(--f7-navbar-height) - var(--f7-safe-area-top) - var(--f7-safe-area-bottom) - 64px);
    grid-template-areas: 
      "image-view result-view detect-settings menu-view";
    justify-items: stretch;
    align-items: stretch;
    height: calc(100% - var(--f7-navbar-height) - var(--f7-safe-area-top) - var(--f7-safe-area-bottom));
    max-height: calc(100% - var(--f7-navbar-height) - var(--f7-safe-area-top) - var(--f7-safe-area-bottom));
    position: relative;
  }

  .chip-results {
    flex-direction: column;
    max-height: 100%;
    justify-self: start;
    flex-wrap: nowrap;
  }
  
  .detect-inputs {
    flex-direction: column;
    min-width: 0;
    max-width: 72px;
  }

  .level-slide-horz {
    display: none;
  }

  .level-slide-vert {
    display: block;
  }


  .image-container {
    flex-direction: column;
  }

  .image-menu {
    flex-direction: column;
    aspect-ratio: .25;
    width: auto;
    min-width: 0;
    height: 100%;
  }

  .image-menu .button {
    aspect-ratio: 1;
    width: auto;
    height: 100%;
    flex: 1 1 0%;
    border-bottom: 1px solid var(--f7-segmented-raised-divider-color);
    border-bottom-left-radius: 0px !important;
  }

  .segment-button-menu {
    flex-direction: row;
    max-height: 100%;
    min-height: 0px;
  }

  .segment-button-menu .button {
    height: auto;
    flex: 1 1 0%;
    max-height: 100px;
    max-width: 100px;
  }

  .button > svg {
    width: 100%;
    height: auto;
  }
}
