/* App Grid */

$app_icon_size: 96px;

// app icons
.icon-grid {
  row-spacing: $base_padding * 4;
  column-spacing: $base_padding * 4;
  max-row-spacing: $base_padding * 7;
  max-column-spacing: $base_padding * 4;
  page-padding-top: 0;
  page-padding-bottom: 0;
  page-padding-left: $base_padding;
  page-padding-right: $base_padding;
}

#uiGroup.mobile .icon-grid {
    row-spacing: 0;
    column-spacing: 0;
}

/* App Icons */

// Icon tiles in the app grid
.app-well-app {
  @include overview_icon($system_fg_color);

  .overview-icon {
    border-radius: $base_border_radius*3;
    color: $system_fg_color;
  }
  .overview-icon.overview-icon-with-label {
  //  text-shadow: 0px 1px 3px 1px rgba(0,0,0,0.4);

    > StBoxLayout {
      spacing: 2px;
    }

    StLabel { @extend %caption; }
  }
}

// app folders
.app-well-app.app-folder {
  @include overview_icon($system_fg_color, $flat: false);
}

// expanded folder
.app-folder-dialog {
  border-radius: $modal_radius*4;
  background-color: $bg_color;
  padding: $base_padding*2;
  box-shadow:inset 0 0 0 1px $outer_borders_color;

  @if $is_highcontrast {
    box-shadow:inset 0 0 0 2px $hc_inset_color;
  }

  & .folder-name-container {
    padding: 12px 42px 0;
    spacing: 12px;

    & .folder-name-label,
    & .folder-name-entry {
      @extend %title_1;
    }

    & .folder-name-entry {
    }

    /* FIXME: this is to keep the label in sync with the entry */
    & .folder-name-label { padding: 5px 7px; color: $system_fg_color; }

    & .edit-folder-button {
      @extend %button;
      padding: 0;
      width: 36px;
      height: 36px;
      border-radius: 99px;
      & > StIcon { icon-size: $base_icon_size }
    }
  }

  & .icon-grid {
   // row-spacing: $base_padding * 2;
   // column-spacing: $base_padding * 5;
    page-padding-top: 0;
    page-padding-bottom: 0;
    page-padding-left: 0;
    page-padding-right: 0;
  }

  & .page-indicators {
    margin-bottom: 18px;
  }
}

.app-folder-dialog-container {
  margin: $base_margin*6;

  width: 640px;
  height: 640px;

  &.mobile {
    width: 360px;
    height: 430px;
  }
}

// Running app indicator (also shown in dash)
.app-well-app-running-dot {
  height: 5px;
  width: 5px;
  border-radius:5px;
  margin-bottom: 8px;
  background-color: $system_fg_color;
}

// Rename popup for app folders
.rename-folder-popup {
  .rename-folder-popup-item {
    spacing: $base_padding;
    &:ltr, &:rtl { padding: 0 $base_padding * 2; }
  }
}

// App Grid pagination indicators
.page-indicator {
  padding: $base_padding $base_padding 0;
  transition-duration:400ms;

  .page-indicator-icon {
    width: 10px;
    height: 10px;
    border-radius: 10px; // the same as height&width
    background-color: white;
    transition-duration: 400ms;
  }
}

// the osk also has page indicators, we only want margin here
#overviewGroup .page-indicators {
  margin-top: 12px;
}

#uiGroup.mobile #overviewGroup .page-indicators {
  margin-bottom: 18px;
}

.apps-scroll-view {
  padding: 0;
}

// shutdown and other actions in the grid
.system-action-icon {
  background-color: transparentize($system_fg_color,.9);
  color: $system_fg_color;
  border-radius: 99px;
  icon-size: $app_icon_size * 0.5;
  @if $is_highcontrast {
    box-shadow: inset 0 0 0 2px $hc_inset_color;
  }
}

.page-navigation-hint {
  &.dnd {
    background: rgba(255, 255, 255, 0.1);
  }

  &.next:ltr,
  &.previous:rtl {
    background-gradient-start: rgba(255, 255, 255, 0.05);
    background-gradient-end: transparent;
    background-gradient-direction: horizontal;
    border-radius: $modal_radius*1.5 0px 0px $modal_radius*1.5;
  }

  &.previous:ltr,
  &.next:rtl {
    background-gradient-start: transparent;
    background-gradient-end: rgba(255, 255, 255, 0.05);
    background-gradient-direction: horizontal;
    border-radius: 0px $modal_radius*1.5 $modal_radius*1.5 0px;
  }
}

.page-navigation-arrow {
  margin: 6px;
  padding: 18px;
  width: 24px;
  height: 24px;
  border-radius: 99px;
  transition-duration: 100ms;

  > StIcon { color: $system_fg_color;}

  @if $is_highcontrast {
    @include button(normal, $system_fg_color, transparentize($system_bg_color, 0.5));
  }

  &:insensitive { @include button(undecorated, $system_fg_color, transparentize($system_bg_color, 0.5));}
  &:hover { @include button(hover, $system_fg_color, transparentize($system_bg_color, 0.5));}
  &:active { @include button(active, $system_fg_color, transparentize($system_bg_color, 0.5));}
}
