/* App Grid */

%icon_tile {
  color: on(dark);
  border-radius: $material-radius * 1.5;
  padding: $space-size * 2;
  border: none;
  transition-duration: $longer-duration;
  text-align: center;
}

// app icons
.icon-grid {
  row-spacing: 12px;
  column-spacing: 12px;
  max-row-spacing: 42px;
  max-column-spacing: 42px;
  page-padding-top: 24px;
  page-padding-bottom: 24px;
  page-padding-left: 18px;
  page-padding-right: 18px;
}

/* App Icons */

%app-well-app,
.show-apps,
.app-well-app,
.grid-search-result {
  .overview-icon {
    @extend %icon_tile;
  }

  &:hover .overview-icon,
  &:focus .overview-icon,
  &:selected .overview-icon {
    background-color: on(dark, divider);
    transition-duration: 0ms;
    border-image: none;
    background-image: none;
  }

  &:active .overview-icon,
  &:checked .overview-icon {
    background-color: on(dark, track);
    box-shadow: none;
    transition-duration: $longer-duration;
  }

  .overview-icon.overview-icon-with-label {
    > StBoxLayout {
      spacing: $space-size;
    }
  }
}

/* App Folders */
.app-well-app.app-folder {
  background: none;
  border-radius: $material-radius * 2;

  .overview-icon {
    background-color: on(dark, divider);
    border-radius: $material-radius * 2;
  }

  &:hover .overview-icon {
    background-color: on(dark, divider);
  }
}

// expanded folder
.app-folder-dialog { //style like the dash
  border-radius: $material-radius * 4;
  border: 0 solid rgba(white, 0.15);
  background-color: rgba($system, 0.95);
  spacing: 6px;

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

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

    .folder-name-entry {
      min-height: 28px;
      padding: $space-size;
      border: none;
      color: on(dark);
      background-color: rgba(white, 0.15);
      caret-color: on(dark);
      selection-background-color: $primary;
      selected-color: on(dark);
      width: 300px;

      &:focus {
        color: on(dark);
        background-color: rgba(white, 0.25);
      }

      .search-entry-icon { color: rgba(white, 0.85); }

      &:hover, &:focus {
        .search-entry-icon { color: rgba(white, 0.95); }
      }

      &:insensitive, StLabel.hint-text {
        color: rgba(white, 0.45);
      }
    }

    /* FIXME: this is to keep the label in sync with the entry */
    .folder-name-label { padding: 5px 7px; color: on(dark, secondary); }

    .edit-folder-button {
      background-color: on(dark, divider);
      color: on(dark, secondary);
      border: none;
      height: 32px;
      width: 32px;
      padding: $space-size;
      border-radius: if($corner_style == 'circular', $circular-radius, $material-radius);

      > StIcon { icon-size: 16px }

      &:hover { background-color: on(dark, divider); }
      &:checked, &:active { background-color: on(dark, track); }
    }
  }

  .icon-grid {
    row-spacing: 12px;
    column-spacing: 30px;
    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 {
  width: 8px; height: 2px;
  border-radius: 0;
  background-color: on(dark);
  margin-bottom: 0;
}

StWidget.focused .app-well-app-running-dot {
  width: 16px;
  background-color: $primary;
}

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

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

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

  .page-indicator-icon {
    width: 10px;
    height: 10px;
    border-radius: 10px; // 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(0,0,0,0.8);
  color: #fff;
  border-radius: $circular-radius;
}

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

  &.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 {
  & > StIcon {
    margin: 6px;
    padding: 18px;
    width: 24px;
    height: 24px;
    border-radius: $circular-radius;
    color: on(dark);
  }

  &:insensitive > StIcon {
    background-color: rgba(white, 0.06);
    color: white;
  }

  &:hover > StIcon {
    background-color: rgba(white, 0.12);
    color: white;
  }

  &:active > StIcon {
    background-color: rgba(white, 0.24);
    color: white;
  }
}
