//
// Gnome Software
//

.details-page {
  margin: $base_padding * 4 0px;
}

.installed-overlay-box {
  font-size: smaller;
  background-color: $accent_color;
  border-radius: 0;
  color: $accent_fg_color;
  text-shadow: 0 1px 0 gtkalpha(black, 0.2);
}

screenshot-carousel box.frame {
  border-width: 1px 0;
  border-radius: 0;
}

screenshot-carousel button,
.featured-carousel button {
  margin: $base_padding * 2;
}

.screenshot-image-main .image1,
.screenshot-image-main .image2 {
  margin-top: $base_padding;
  margin-bottom: $base_padding * 2;
  margin-left: $base_padding;
  margin-right: $base_padding;
}

.app-tile-label {
  font-size: 105%;
}

.review-textbox {
  padding: $base_padding;
}

.origin-rounded-box {
  background-color: $hover_color;
  border-radius: $circular_radius;
  padding: $base_padding - 2px;
}

.origin-beta {
  color: $warning;
}

.origin-button > button {
  padding: $base_padding / 2 $base_padding * 1.5;
}

.card flowboxchild {
  &.card {
    border: none;
    box-shadow: none;
    padding: 0;
    background: none;
  }
}

.category-tile.card {
  padding: $base_padding * 3.5;
  border: none;
  border-radius: $button_radius;
  min-width: 140px;
  font-weight: 900;
  font-size: larger;
  box-shadow: $shadow-z3;

  &.category-tile-iconless {
    padding: $base_padding * 1.5 $base_padding * 2.5;
    min-width: 130px;
    font-size: 105%;
    font-weight: normal;
    box-shadow: none;
    background-color: $button_color;
  }

  // Styling for specific category buttons.
  &.category-create {
    background: linear-gradient(180deg, #ce8cd7 0%, #2861c6 100%);
    color: white;

    &:hover {
      background: linear-gradient(180deg, shade(#ce8cd7, 1.07) 0%, shade(#2861c6, 1.1) 100%);
      color: white;
    }

    &:active {
      background: linear-gradient(180deg, shade(#ce8cd7, .95) 0%, shade(#2861c6, .95) 100%);
      color: white;
    }
  }

  &.category-develop {
    background: #5e5c64;
    color: white;

    &:hover {
      background: shade(#5e5c64, 1.2);
      color: white;
    }

    &:active {
      background-color: shade(#5e5c64, .95);
      color: white;
    }
  }

  &.category-learn {
    background: linear-gradient(180deg, #2ec27e 30%, #27a66c 100%);
    color: white;

    &:hover {
      background: linear-gradient(180deg, shade(#2ec27e, 1.06) 30%, shade(#27a66c, 1.06) 100%);
      color: white;
    }

    &:active {
      background: linear-gradient(180deg, shade(#2ec27e, .95) 30%, shade(#27a66c, .95) 100%);
      color: white;
    }
  }

  &.category-play {
    background: linear-gradient(75deg, #f9e2a7 0%, #eb5ec3 50%, #6d53e0 100%);
    color: #393484;

    &:hover {
      background: linear-gradient(75deg, shade(#f9e2a7, 1.07) 0%, shade(#eb5ec3, 1.07) 50%, shade(#6d53e0, 1.07) 100%);
      color: #393484;
    }

    &:active {
      background: linear-gradient(75deg, shade(#f9e2a7, .97) 0%, shade(#eb5ec3, .95) 50%, shade(#6d53e0, 1.07) 100%);
      color: #393484;
    }
  }

  &.category-socialize {
    background: linear-gradient(90deg, #ef4e9b 0%, #f77466 100%);
    color: $secondary_text_color;

    &:hover {
      background: linear-gradient(90deg, shade(#ef4e9b, 1.08) 0%, shade(#f77466, 1.08) 100%);
    }

    &:active {
      background: linear-gradient(90deg, shade(#ef4e9b, .95) 0%, shade(#f77466, .95) 100%);
    }
  }

  &.category-work {
    padding: 1px; /* FIXME: work around https://gitlab.gnome.org/GNOME/gtk/-/issues/4324 */
    color: #1c71d8;
    background-color:#fdf8d7;
    background-image: linear-gradient($border_color 1px, transparent 1px),
             linear-gradient(90deg, $border_color 1px, transparent 1px);
    background-size: 10px 10px, 10px 10px;
    background-position: -1px -4px, center -1px;

    &:hover {
      color: #1c71d8;
      background-color: lighten(#fdf8d7, 5%);
      background-image: linear-gradient($border_color 1px, transparent 1px),
               linear-gradient(90deg, $border_color 1px, transparent 1px);
    }

    &:active {
      color: #1c71d8;
      background-color: darken(#fdf8d7, 5%);
      background-image: linear-gradient($border_color 1px, transparent 1px),
               linear-gradient(90deg, $border_color 1px, transparent 1px);
    }
  }
}

clamp.medium .category-tile:not(.category-tile-iconless),
clamp.large .category-tile:not(.category-tile-iconless) {
  font-size: larger;
}

// The rest of the featured-tile CSS is loaded at runtime in gs-feature-tile.c
.featured-tile {
  padding: 0;
  box-shadow: none;
  color: $text_color;

  label.title-1 {
    margin-top: $base_padding;
    margin-bottom: $base_padding;
  }

  &.narrow label.title-1 {
    font-size: 16pt;
  }
}

.application-details-infobar {
  &, &.info {
    background-color: $button_color;
    color: $text_color;
    border: 1px solid $border_color;
  }

  &.warning {
    background-color: $warning_color;
    color: $warning_fg_color;
    border: 1px solid gtkalpha($warning_fg_color, 0.1);
  }
}

@keyframes install-progress-unknown-move {
  0% { background-position: 0%; }
  50% { background-position: 100%; }
  100% { background-position: 0%; }
}

.application-details-description .button {
  padding-left: $base_padding * 4;
  padding-right: $base_padding * 4;
}

.install-progress {
  background-image: linear-gradient(to top, $accent_color 2px, gtkalpha($accent_color, 0) 2px);
  background-repeat: no-repeat;
  background-position: 0 bottom;
  background-size: 0;
  transition: none;
}

.install-progress:dir(rtl) { background-position: 100% bottom; }

.review-row > * {
  margin: $base_padding * 2;
}

.review-row button { font-size: smaller; }

.review-row .vote-buttons button {
  margin-right: -1px;
}

// this is the separator between yes and no vote buttons, gtk+ 3.20 only
.review-row .vote-buttons button:not(:first-child) {
  border-image: linear-gradient(to top, $border_color, $border_color) 0 0 0 1 / 5px 0 5px 1px;
}

.review-row .vote-buttons button:hover,
.review-row .vote-buttons button:active,
.review-row .vote-buttons button:hover + button,
.review-row .vote-buttons button:active + button {
  border-image: none;
}

review-bar {
  color: $disabled_text_color;
  background-image: none;
  background-color: $secondary_disabled_text_color;
}

.review-histogram star-image {
  color: $disabled_text_color;
}

.version-arrow-label {
  font-size: x-small;
}

.overview-more-button {
  font-size: smaller;
  padding: 0 $base_padding * 2 + 4px;
}

.app-row-origin-text {
  font-size: smaller;
}

.app-listbox-header {
  padding: $base_padding;
  border-bottom: 1px solid $border_color;
}

.image-list {
  background-color: transparent;
}

box.star {
  background-color: transparent;
  background-image: none;
}

button.star {
  outline-offset: 0;
  background-color: transparent;
  background-image: none;
  border-image: none;
  border-radius: 0;
  border-width: 0;
  padding: 0;
  box-shadow: none;
  outline-offset: -1px;
}

star-image {
  color: $yellow-dark;
}

.dimmer-label {
  opacity: 0.25;
}

.update-failed-details {
  font-family: Monospace;
  font-size: smaller;
  padding: $base_padding * 2 + 4px;
}

.upgrade-banner {
  padding: 0px;
  border-radius: $button_radius;
  border: none;
}

.upgrade-banner-background {
  background: linear-gradient(to bottom, $green-light, $blue-light);
  color: white;
}

.upgrade-buttons #button_upgrades_install {
  padding-left: $base_padding * 2 + 4px;
  padding-right: $base_padding * 2 + 4px;
}

scrolledwindow.list-page > viewport > clamp > box {
  margin: $base_padding * 4 $base_padding * 2;
  border-spacing: $base_padding * 4;
}

.update-preferences preferencesgroup > box > box {
  margin-top: $base_padding * 3;
}

.section > label:not(:first-child) { margin-top: $base_padding; }

.section > box:not(:first-child) { margin-top: $base_padding * 2; }

clamp.status-page {
	margin: $base_padding * 6 $base_padding * 2;
}

clamp.status-page .iconbox {
  min-height: 128px;
  min-width: 128px;
}

clamp.status-page .icon {
  color: $disabled_text_color;
  min-height: 32px;
  min-width: 32px;
}

clamp.status-page .icon:not(:last-child) {
  margin-bottom: $base_padding * 6;
}

clamp.status-page .title:not(:last-child) {
  margin-bottom: $base_padding * 2;
}

app-context-bar {
  .context-tile {
    border: 1px solid $border_color;
    background-color: transparent;
    border-radius: 0;
    padding: $base_padding * 4 $base_padding * 2 $base_padding * 3.5 $base_padding * 2;
    outline-offset: 5px;
    transition-property: outline, outline-offset, background-image;
    border-bottom: none;
    border-right: none;

    &:hover {
      background-image: none;
      background-color: $hover_color;
    }

    &.keyboard-activating,
    &:active {
      background-color: $active_color;
    }

    &:focus:focus-visible {
      outline-offset: -1px;
    }
  }

  &.horizontal box:first-child .context-tile:first-child,
  &.vertical .context-tile:first-child {
    border-left: none;
  }

  &.horizontal .context-tile,
  &.vertical box:first-child .context-tile {
  	border-top: none;
  }

  > box:not(:first-child) > button.flat {
    border-radius: 0;

    &:last-child {
      border-radius: 0 $button_radius $button_radius 0;
    }
  }

  > box:first-child > button.flat {
    border-radius: 0;

    &:first-child {
      border-radius: $button_radius 0 0 $button_radius;
    }
  }

  > box > button.flat {
    border-left-color: $border_color;
  }
}

carousel.card {
  border: none;
  background-color: $button_color;
}

.context-tile-lozenge {
  min-height: 28px;
  min-width: 28px;
  padding: $base_padding;
  font-size: 18px;
  font-weight: bold;
  border-radius: $circular_radius;

  &.large {
    font-size: 24px;
    padding: 16px;
    min-width: 24px;  /* 60px minus the left and right padding */
    min-height: 24px;  /* 60px minus the top and bottom padding */
  }

  &.wide-image image {
    margin-top: -28px;
    margin-bottom: -28px;
  }

  image { -gtk-icon-style: symbolic; }

  &.grey {
    color: $text_color;
    background-color: $hover_color;
  }

  &.green, &.details-rating-0 {
    color: gtkmix(black, $success_color, 15%);
    background-color: gtkalpha($success_color, 0.15);
  }

  &.blue,
  &.details-rating-5 {
    color: $blue-light;
    background-color: gtkalpha($blue-light, 0.15);
  }

  &.yellow, &.details-rating-12 {
    color: gtkmix(black, $warning_color, 15%);
    background-color: gtkalpha($warning_color, 0.15);
  }

  &.details-rating-15 {
    color: $orange-light;
    background-color: gtkalpha($orange-light, .15);
  }

  &.red, &.details-rating-18 {
    color: gtkmix(black, $error_color, 15%);
    background-color: gtkalpha($error_color, 0.15);
  }
}

.eol-red {
  font-weight: bold;
  color: $error_color;
}

window.narrow .app-title {
  font-size: 16pt;
}

window.narrow .app-developer {
  font-size: small;
}

.install-progress-label {
  font-size: smaller;
  font-feature-settings: "tnum";
}

scrolledwindow.fake-adw-status-page > viewport > box { margin: $base_padding * 6 $base_padding * 2; }
scrolledwindow.fake-adw-status-page > viewport > box > clamp:not(:last-child) > box { margin-bottom: $base_padding * 6; }
scrolledwindow.fake-adw-status-page > viewport > box > clamp > box > .icon:not(:last-child) { margin-bottom: $base_padding * 6; }
scrolledwindow.fake-adw-status-page > viewport > box > clamp > box > .title:not(:last-child) { margin-bottom: $base_padding * 2; }

statuspage.icon-dropshadow image.icon {
	-gtk-icon-shadow: 0 1px 12px rgba(0,0,0,0.05),
	                  0 -1px rgba(0,0,0,0.05),
	                  1px 0 rgba(0,0,0,0.1),
	                  0 1px rgba(0,0,0,0.3),
	                  -1px 0 rgba(0,0,0,0.1);
}

window.info scrollbar.vertical {
  margin-top: 48px;
  background: none;
  box-shadow: none;
}

window.info scrollbar.vertical trough {
  margin-top: 0;
}

// GsAppRow
row.app > box.header {
  margin-left: $base_padding * 2;
  margin-right: $base_padding * 2;
}

row.app > box.header {
  border-spacing: $base_padding * 2;
}

row.app > box.header > image {
  margin-top: $base_padding * 2;
  margin-bottom: $base_padding * 2;
}

row.app label.warning {
  color: $error;
}

// GtkSpinner

// Ensure the spinner is hidden before the animation is triggered.
@keyframes pre-delay {
  from { opacity: 0; }
  to { opacity: 0; }
}

@keyframes fade-in {
  from { filter: opacity(0%); }
}

/* Give a fade-in animation to spinners. */
spinner.fade-in:checked {
  animation: pre-delay 0.5s linear 1, fade-in 1s linear 1, spin 1s linear infinite;
  animation-delay: 0s, 0.5s, 0.5s;
}