@use "../../wc";
@use "../../../scss/boot"; // Tabs load in such a way we need to include the global styles on them again

:host {
  @include wc.scrollbars;
  display: contents;
}

//::slotted(zn-sp) {
//  --zn-sp-padding: 0 !important
//}

#mid, #content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tabs {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  min-height: 100%;
  max-height: 100%;
  width: 100%;

  zn-header::part(base) {
    border-bottom-width: 0 !important;
  }
}


h1, h2 {
  padding: 0;
  margin: 0;
}


#mid {
  container-type: inline-size;
  flex-direction: row;
}

#content {
  flex: 1;
  max-height: 100%;
  min-height: 15px;
  @include wc.padding;

  @include wc.scrollbars;
  display: flex;
  align-items: normal;
  overflow: auto;

  > ::slotted(div), > div {
    max-height: 100%;
  }
}

:host([no-scroll]) {
  #content {
    overflow: hidden;

    > div {
      max-height: 100%;
    }

    > ::slotted(div) {
      max-height: 100%;
    }
  }

}

:host([flush]) {
  #content {
    padding: 0;
  }
}

:host([flush-x]) {
  #content {
    padding-left: 0;
    padding-right: 0;
  }
}

#content.contents-slot slot {
  display: contents;
}

#content {
  ::slotted([selected]), > [selected] {
    flex-grow: 1;
  }

  ::slotted(:not([selected])), > :not([selected]):not(slot) {
    display: none !important;
  }
}

:host {

  //slot[name="top"]::slotted(zn-navbar:not([highlight])) {
  //  padding-top: var(--zn-spacing-medium);
  //}

  #header ~ slot[name="top"]::slotted(zn-navbar) {
    padding-top: 0
  }

  #header:not(:empty) {
    display: flex;
    align-items: center;
    padding: var(--zn-spacing-medium);
    gap: var(--zn-spacing-medium);

    #actions ::slotted(*:not(.zn-tb-active)) {
      display: none;
    }

    #actions {
      display: flex;
      overflow: visible;
    }

    h1, h2 {
      flex-grow: 1;
    }
  }

  h2 {
    font-weight: var(--zn-font-weight-bold);
    flex-grow: 1;
    font-size: var(--zn-font-size-medium);
    color: rgba(var(--zn-text-panel-title), 100%);
    padding: 0;
    margin: 0;
  }
}

::slotted(div[ref-tab]:not(.zn-tb-active)) {
  display: none;
}
