/* App Grid */

$app_icon_size: 96px;

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

/* App Icons */

// Icon tiles in the app grid
.app-well-app,
%app-well-app {
  @include overview-icon($selected_fg_color);

  .overview-icon.overview-icon-with-label {
    padding: 10px 8px 5px 8px;

    > StBoxLayout {
      spacing: $base_spacing;
    }
  }
}

.icon-grid .overview-icon {
  border-radius: $base_border_radius * 2;
}

/* App Folders */
.app-well-app.app-folder {
  background-color: transparent !important;
  border-radius: $base_border_radius * 2; // same as %icon_tile

  .overview-icon {
    background-color: rgba(white, 0.1);
  }

  @include overview-icon($selected_fg_color);
}

// expanded folder
.app-folder-dialog { //style like the dash
  border-radius: $modal_radius * 1.5;
  background-color: rgba($system_bg_color, 1);
  padding: 8px !important;
  box-shadow: none;
  outline: none;

  .folder-name-container {
    padding: 24px 36px 0;
    spacing: 12px;

    .folder-name-label,
    .folder-name-entry {
      font-size: 18pt;
      font-weight: 800;
    }

    .folder-name-entry {
      width: 300px;
      box-shadow: none;
      border-radius: $circular_radius;
      border: 2px solid transparent;
      background-color: darken($dash_background_color, 3%);
      color: $osd_fg_color;

      &:hover, &:focus {
        background-color: darken($dash_background_color, 3%);
        color: rgba(white, 0.75);
        border-color: $selected_bg_color;
        box-shadow: none;
      }
    }

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

    .edit-folder-button {
      // @extend %button;
      border: none;
      box-shadow: none;
      background-color: rgba(white, 0.1);
      color: rgba(white, 0.75);
      padding: 0;
      width: 36px;
      height: 36px;
      border-radius: 18px;

      &:hover { background-color: rgba(white, 0.15); }

      &:active { background-color: rgba(white, 0.2); }

      > StIcon { icon-size: 16px }
    }
  }

  .icon-grid {
    row-spacing: $base_spacing * 2;
    column-spacing: $base_spacing * 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 {
  padding: 12px;
  width: 620px;
  height: 620px;
}

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

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

// right-click app menu
.app-menu,
.app-well-menu {
  max-width: 27.25em;
}

// App Grid pagination indicators
.page-indicator {
  padding: $base_padding $base_padding * 2 0;

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

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

// shutdown and other actions in the grid
.system-action-icon {
  background-color: rgba($fg_color, 0.1);
  color: $fg_color;
  border-radius: 1000px;
  icon-size: $app_icon_size * 0.5;
  border: none;
}

.page-navigation-hint {
  width: 300px;

  &.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: 15px 0px 0px 15px;
  }

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

.page-navigation-arrow {
  color: $osd_fg_color;

  > StIcon {
    margin: 6px;
    padding: 18px;
    width: 24px;
    height: 24px;
    border-radius: $circular_radius;
    color: rgba($osd_fg_color, 0.75);
  }

  &:insensitive > StIcon { @include button(insensitive, $tc: $osd_fg_color, $c: transparentize($osd_bg_color, 0.5), $shadow: none); }
  &:hover > StIcon { @include button(hover, $tc: $osd_fg_color, $c: transparentize($osd_bg_color, 0.5), $shadow: none); }
  &:active > StIcon { @include button(active, $tc: $osd_fg_color, $c: transparentize($osd_bg_color, 0.5), $shadow: none); }
}
