@landing-portal-color: @global-primary-background;
@landing-inverse-color: @global-inverse-color;
@landing-z-index: @global-z-index - 20;

@landing-header-height: @global-header-height;
@landing-sidebar-height: calc(100vh - @landing-header-height);

@landing-left-sidebar-width: 100px;
@landing-left-sidebar-background: @global-inverse-color;
@landing-left-sidebar-border-width: @global-border-width;
@landing-left-sidebar-border: @global-border;

@landing-right-sidebar-min-width: 360px;
@landing-right-sidebar-background: @table-color;

@landing-action-button-background: @global-background;
@landing-action-button-border-width: @global-border-width;
@landing-action-button-border: transparent;
@landing-action-button-border-radius: @global-small-border-radius;
@landing-action-button-hover-background: @global-background;

@landing-action-button-portal-background: @landing-portal-color;
@landing-action-button-portal-color: @landing-inverse-color;
@landing-action-button-portal-border: @landing-action-button-portal-background;
@landing-action-button-portal-hover-background: @global-background;
@landing-action-button-portal-hover-color: @landing-portal-color;

@landing-action-button-orcid-color: @orcid-color;
@landing-action-button-orcid-border: @orcid-color;
@landing-action-button-orcid-disabled-color: @global-muted-color;
@landing-action-button-orcid-disabled-border: @global-muted-color;

@landing-section-min-height: 60vh;
@landing-section-border-width: 3px;
@landing-section-separator: fade(@landing-portal-color, @global-opacity);

@landing-tab-background: @global-muted-background;
@landing-tab-border-width: 4px;
@landing-tab-border-radius: @global-small-border-radius;
@landing-tab-background-active: @global-background;
@landing-tab-color-active: @landing-portal-color;
@landing-tab-border-active: @landing-portal-color;

@landing-card-tab-border-radius: @global-border-radius;
@landing-card-tab-border-width: 5px;

@landing-action-bar-padding: 10px 30px;
@landing-action-bar-grid-gap: 20px;
@landing-action-bar-border-width: @global-border-width;
@landing-action-bar-border-radius: @global-small-border-radius;

@landing-metrics-grip-gap: 80px;

.landing {
  #landing-center-content {
    min-height: @landing-sidebar-height;
  }

  #landing-left-sidebar {
    width: @landing-left-sidebar-width;
    background: @landing-left-sidebar-background;
    border-right: @landing-left-sidebar-border-width solid @landing-left-sidebar-border;

    & > .uk-sticky {
      height: @landing-sidebar-height;
    }
  }

  #landing-right-sidebar {
    min-width: @landing-right-sidebar-min-width;
    background: @landing-right-sidebar-background;

    & > .uk-sticky {
      height: @landing-sidebar-height;
    }
  }

  #landing-right-sidebar-switcher {
    top: 50vh !important;
  }

  #main-tabs-div {
    z-index: @landing-z-index - 2;
  }

  #graph_and_feedback {
    z-index: @landing-z-index - 1;
  }

  #landing-sections {
    .landing-section {
      padding-bottom: 80px;

      &:not(:first-child) {
        margin-top: 80px;
      }

      &:not(.landing-section-height-auto) {
        min-height: @landing-section-min-height;
      }

      &:not(:last-child) {
        border-bottom: @landing-section-border-width solid @landing-section-separator;
      }
    }
  }

  .landing-action-button {
    &:extend(.uk-icon-button-small);
    background-color: @landing-action-button-background;
    border: @landing-action-button-border-width solid @landing-action-button-border;
    border-radius: @landing-action-button-border-radius;

    &:hover {
      background: @landing-action-button-hover-background;
      border: transparent;
    }

    &.landing-action-button-portal {
      background-color: @landing-action-button-portal-background;
      color: @landing-action-button-portal-color;
      border-color: @landing-action-button-portal-border;

      &:hover {
        background: @landing-action-button-portal-hover-background;
        color: @landing-action-button-portal-hover-color;
      }
    }

    &.landing-action-button-orcid {
      color: @landing-action-button-orcid-color;
      border-color: @landing-action-button-orcid-border;

      &.uk-disabled {
        color: @landing-action-button-orcid-disabled-color;
        border-color: @landing-action-button-orcid-disabled-border;
      }
    }
  }

  .landing-tab:extend(.uk-text-small) {
    background: @landing-tab-background;
    border-radius: @landing-tab-border-radius;

    & .uk-tab {

      & > * > a {
        border-bottom: none;
        border-top: @landing-tab-border-width solid transparent;
      }

      & > .uk-active > a {
        border-color: @landing-tab-border-active;
        background: @landing-tab-background-active;
        color: @landing-tab-color-active;
        position: relative;
      }
    }
  }

  .uk-dropdown {
    z-index: @landing-z-index + 1;
  }

  .card-tab {
    border-radius: @landing-card-tab-border-radius;
    border-left: @landing-card-tab-border-width solid @landing-section-separator;
  }

  .landing-action-bar {
    padding: @landing-action-bar-padding;
    border-radius: @landing-action-bar-border-radius;
    border: @landing-portal-color solid @landing-action-bar-border-width;

    & .uk-grid-divider > :not(.uk-first-column)::before {
      border-color: @disable-color;
      top: 4px;
      bottom: 4px;
    }
  }

  // TODO: when we get there
  .landing-action-bar-mobile {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: @global-z-index - 20;

    & > div {
      padding: 10px 20px;
      border-top: @landing-action-bar-border-width solid lightgrey;
    }
  }

  .landing-metrics-overview {
    grid-gap: @landing-metrics-grip-gap;
  }

  .landing-metrics-card {
    background-image: url("../metrics-bg.svg");
    background-repeat: no-repeat;
    background-size: cover;
  }

  // rules for overriding styles of altmetrics embedded library
  .altmetric-embed {
    position: relative !important;
    z-index: 1 !important;
  }

  .altmetric-normal-legend {
    margin: 0 40px 0 0 !important;

    .altmetric-see-more-details {
      display: none !important;
    }
  }

  .altmetric-popover-content {
    background-color: unset !important;
    font-size: unset !important;
    font-family: unset !important;
  }
}
