
$asset_path: if($variant == 'dark', dark-assets, light-assets);

stage {
  color: $fg_color;
}

.label-shadow {
  color: rgba(0, 0, 0, 0);
}

//
// Buttons
//
%button {
  min-height: 20px;
  padding: 5px 32px;
  transition-duration: 0;

  &, &:focus, &:hover, &:hover:focus, &:active, &:active:focus, &:insensitive {
    border-radius: 2px;
  }

  @include button(normal);

  &:focus { @include button(focus); }
  &:hover { @include button(hover); }
  &:hover:focus { @include button(focus-hover); }
  &:active, &:active:focus { @include button(active); }
  &:insensitive { @include button(insensitive); }
}

%osd_button {
  min-height: 20px;
  padding: 5px 32px;
  transition-duration: 0;
  border-radius: 2px;

  @include button(osd);

  &:hover { @include button(osd-hover); }
  &:focus { color: $accent_color; }
  &:active { @include button(osd-active); }
  &:insensitive { @include button(osd-insensitive); }
}

//
// Entries
//
%entry {
  padding: 7px;
  caret-size: 1px;
  selection-background-color: $accent_color;
  selected-color: $selected_fg_color;
  transition-duration: 300ms;
  border-radius: 3px;

  @include entry(normal);

  &:focus, &:hover { @include entry(focus); }
  &:insensitive { @include entry(insensitive); }

  StIcon.capslock-warning {
    icon-size: 16px;
    warning-color: $warning_color;
    padding: 0 4px;
  }

  StLabel.hint-text { color: transparentize($fg_color, 0.7); }

  StIcon.peek-password {
    icon-size: 16px;
    color: $fg_color;
  }
}

%osd_entry {
  padding: 7px;
  caret-size: 1px;
  caret-color: $osd_fg_color;
  selection-background-color: $accent_color;
  selected-color: $selected_fg_color;
  transition-duration: 300ms;
  border-radius: 3px;

  @include entry(osd);

  &:focus { @include entry(osd-focus); }
  &:insensitive { @include entry(osd-insensitive); }
}

//
// Scrollbars
//
StScrollView {
  &.vfade { -st-vfade-offset: 68px; }
  &.hfade { -st-hfade-offset: 68px; }
}

StScrollBar {

  padding: 8px;

  StScrollView & {
    min-width: 5px;
    min-height: 5px;
  }

  StBin#trough {
    background-color: transparentize($bg_color2, 0.9);
    border-radius: 8px;
  }

  StButton#vhandle, StButton#hhandle {
    border-radius: 2px;
    background-color: $bg_color2;
    border: 0px solid;
    margin: 0px;

    &:hover { background-color: $bg_color3; }

    &:active { background-color: $accent_color; }
  }
}

.separator {
  -gradient-height: 1px;
  -gradient-start: rgba(0,0,0,0);
  -gradient-end: rgba(0,0,0,0);
  -margin-horizontal: 1.5em;
  height: 1em;
}

//
// Ripples
//
.ripple-pointer-location {
  width: 50px;
  height: 50px;
  border-radius: 25px;
  background-color: transparentize($accent_color, 0.7);
  box-shadow: 0 0 2px 2px $accent_color;
}

//
// Slider
//
.popup-slider-menu-item,
.slider {
  -slider-height: 0.3em;
  -slider-background-color: $button_border;                         //background of the trough
  -slider-border-color: transparentize($bg_color, 0.7);             //trough border color
  -slider-active-background-color: $accent_color;                   //active trough fill
  -slider-active-border-color: transparentize($bg_color, 0.7);      //active trough border
  -slider-border-width: 1px;
  -slider-handle-radius: 0.5em;
  height: 1em;
  min-width: 15em;
  border: 0 solid transparent;
  border-right-width: 1px;
  border-left-width: 5px;
}

//
// Check Boxes
//
.check-box {

  CinnamonGenericContainer {
    spacing: .2em;
    min-height: 30px;
    padding-top: 2px;
  }

  StLabel { font-weight: normal; }

  StBin {
    width: 16px;
    height: 16px;
    background-image: url("#{$asset_path}/checkbox/checkbox-unchecked.svg");
  }

  &:focus StBin { background-image: url("#{$asset_path}/checkbox/checkbox-unchecked-focused.svg"); }

  &:checked StBin { background-image: url("#{$asset_path}/checkbox/checkbox-checked.svg"); }

  &:focus:checked StBin { background-image: url("#{$asset_path}/checkbox/checkbox-checked-focused.svg"); }
}

//
// Radio Buttons
//
.radiobutton {

  CinnamonGenericContainer {
    spacing: .2em;
    height: 26px;
    padding-top: 2px;
  }

  StLabel {
    padding-top: 4px;
    font-size: 0.9em;
    box-shadow: none;
  }

  StBin {
    width: 16px;
    height: 16px;
    background-image: url("#{$asset_path}/checkbox/radio-unchecked.svg");
  }

  &:focus StBin { background-image: url("#{$asset_path}/checkbox/radio-unchecked.svg"); }

  &:checked StBin { background-image: url("#{$asset_path}/checkbox/radio-checked.svg"); }

  &:focus:checked StBin { background-image: url("#{$asset_path}/checkbox/radio-checked.svg"); }
}

//
// Switches
//
.toggle-switch {
  width: 50px;
  height: 20px;
  background-size: contain;

  &-us, &-intl {
    background-image: url("#{$asset_path}/switch/switch-off.svg");

    &:checked { background-image: url("#{$asset_path}/switch/switch-on.svg"); }
  }
}

//
// Links
//
.cinnamon-link {
  color: $link_color;
  text-decoration: underline;

  &:hover { color: lighten($link_color,10%); }
}

//
// Tooltip
//
#Tooltip {
  border: none;
  border-radius: 5px;
  padding: 12px 12px;
  background-color: $tooltip_bg_color;
  color: $tooltip_fg_color;
  font-size: 1em;
  font-weight: normal;
  text-align: center;
  margin: 3px;
}

//
// Looking Glass
//
#LookingGlassDialog {
    color: $fg_color;
    border: 1px solid $borders_color;
    border-radius: 3px;
    background-color: $bg_color;
    spacing: 4px;
    padding: 8px;
}

//
// Popovers/Menus
//
.menu {
  color: $fg_color;
  background-color: $bg_color;
  box-shadow: 0 0 6px $shadow_color;

  &-top {
    border-radius: 0 0 $radius $radius;
  }

  &-bottom {
    border-radius: $radius $radius 0 0;
  }

  &-left {
    border-radius: 0 $radius $radius 0;
  }

  &-right {
    border-radius: $radius 0 0 $radius;
  }
}

.popup-sub-menu {
  background-color: $bg_color;
  box-shadow: none;

  .popup-menu-item:ltr { padding-left: 2.5em; }
  .popup-menu-item:rtl { padding-right: 2.5em; }

  StScrollBar {
    padding: 4px;
    StBin#trough, StBin#vhandle { border-width: 0; }
  }
}

.popup-menu-content { padding: 1em 0em 1em 0em; }
.popup-menu-item {
  padding: .4em 1.75em;
  spacing: 1em;
  border-left-width: 0;
  border-right-width: 0;

  &:active {
    color: $noaccent_selected_fg_color;
    background-color: $bg_color2;
  }
  &:insensitive {
    color: transparentize($fg_color, 0.5);
    background: none;
  }
}

.popup-inactive-menu-item { //all icons and other graphical elements
  color: $fg_color;

  &:insensitive { color: $insensitive_fg_color; }
}

/*Scale view context menu*/
.popup-combo-menu {
  color: $fg_color;
  border: 1px solid $borders_color;
  border-radius: 3px;
  background-color: $bg_color2;
  box-shadow: none;
  padding: 1em 0em 1em 0em;
}

.popup-image-menu-item {}

.popup-combobox-item {
  spacing: 1em;
  padding: .4em 1.75em;
  border: 1px solid transparent;
  border-left-width: 0;
  border-right-width: 0;
}

.popup-separator-menu-item {
  -gradient-height: 1px;
  -gradient-start: $separator_color;
  -gradient-end: $separator_color;
  -margin-horizontal: 0;
  height: 1px;
}

.popup-alternating-menu-item:alternate {
  font-weight: normal;
}

.popup-device-menu-item { 
  spacing: .5em;

  font-weight: bold;
  color: $fg_color;

  &:insensitive { color: $fg_color; spacing: 1em;}

  .popup-inactive-menu-item {
    font-weight: normal;
    color: $fg_color;
  }
}

.popup-subtitle-menu-item { font-weight: normal; }

.nm-menu-item-icons { spacing: .5em; }

//
// Panel
//
#panel {
  font-weight: bold;
  /* sets the height of horizontal panels */
  height: 40px;
  /* sets the width of vertical panels */
  width: 32px;
  /* Set the symbolic foreground color for icons, and importantly, the system tray applet icons */
  color: $fg_color;

  &Left {
    spacing: 4px;

    &:dnd {
      background-gradient-direction: vertical;
      background-gradient-start: rgba(255,0,0,0.05);
      background-gradient-end: rgba(255,0,0,0.2);
    }
    &:ltr { padding-right: 4px; }
    &:rtl { padding-left: 4px; }
    &.vertical {
      padding: 0px;
      &:ltr { padding-right: 0px; }
      &:rtl { padding-left: 0px; }
    }
  }

  &Right {

    &:dnd {
      background-gradient-direction: vertical;
      background-gradient-start: rgba(0,0,255,0.05);
      background-gradient-end: rgba(0,0,255,0.2);
    }
    &:ltr { padding-left: 4px; spacing: 0px; }
    &:rtl { padding-right: 4px; spacing: 0px; }
    &.vertical {
      padding: 0px;
      &:ltr { padding-right: 0px; }
      &:rtl { padding-left: 0px; }
    }
  }

  &Center {
    spacing: 4px;

    &:dnd {
      background-gradient-direction: vertical;
      background-gradient-start: rgba(0,255,0,0.05);
      background-gradient-end: rgba(0,255,0,0.2);
    }
  }

  &:highlight {
    border-image: none;
    background-color: transparentize($error_color, 0.5);
  }
}

.panel {

  &Left {
    spacing: 4px;

    &:dnd {
      background-gradient-direction: vertical;
      background-gradient-start: rgba(255,0,0,0.05);
      background-gradient-end: rgba(255,0,0,0.2);
    }
    &:ltr { padding-right: 4px; }
    &:rtl { padding-left: 4px; }

    &.vertical {
      padding: 0px;
      &:ltr { padding-right: 0px; }
      &:rtl { padding-left: 0px; }
    }
  }

  &Right {

    &:dnd {
      background-gradient-direction: vertical;
      background-gradient-start: rgba(0,0,255,0.05);
      background-gradient-end: rgba(0,0,255,0.2);
    }
    &:ltr { padding-left: 4px; spacing: 0px; }
    &:rtl { padding-right: 4px; spacing: 0px; }

    &.vertical {
      padding: 0px;
      &:ltr { padding-left: 0px; spacing: 0px; }
      &:rtl { padding-right: 0px; spacing: 0px; }
    }
  }

  &Center {
    spacing: 4px;

    &.vertical {
      padding-left: 0px;
      padding-right: 0px;
    }

    &:dnd {
      background-gradient-direction: vertical;
      background-gradient-start: rgba(0,255,0,0.05);
      background-gradient-end: rgba(0,255,0,0.2);
    }
  }


  &-top, &-bottom, &-left, &-right {
    color: $selected_fg_color;
    border: none;
    background-color: transparentize($panel_bg, 0.01);
    font-size: 1em;
    padding: 0px;
  }

  &-top {
    box-shadow: 0 1px $bg_color;
  }

  &-bottom {
    box-shadow: 0 -1px $bg_color;
  }

  &-left {
    box-shadow: 1px 0 $bg_color;
  }

  &-right {
    box-shadow: -1px 0 $bg_color;
  }

  &-dummy {
    background-color: transparentize($error_color, 0.5);

    &:entered { background-color: transparentize($error_color, 0.4); }
  }

  &-status-button {
    border-width: 0;
    -natural-hpadding: 3px;
    -minimum-hpadding: 3px;
    font-weight: bold;
    color: $panel_fg;

    &:hover {}
  }

  &-button {
    -natural-hpadding: 6px;
    -minimum-hpadding: 2px;
    font-weight: bold;
    color: green;
    transition-duration: 100;

    &:hover {}
  }
}

.system-status-icon {
  icon-size: 16px;
  padding: 0 1px;

  &.warning { color: $warning_color; }
  &.error { color: $error_color; }
}

//
// Overview
//
#overview { spacing: 12px; }

.window-caption {
  background-color: $osd_bg_color;
  border: 1px solid $osd_bg_color;
  color: $osd_fg_color;
  spacing: 8px;
  border-radius: 2px;
  font-size: 0.9em;
  padding: 5px 8px;
  -cinnamon-caption-spacing: 8px;

  &:focus {
    background-color: $accent_color;
    color: $selected_fg_color;
    border: 1px solid $accent_color;
  }
}

.window-border {
  border: 3px $accent_color;
  border-radius: 2px;
  background-color: rgba(255,255,255,.05);
  /* Cover rounded corners and some bad adjustment gaps */
  box-shadow: 0 0 0 1px $accent_color inset;
}

.overview-empty-placeholder {
  color: #ffffff;
  font-size: 2em;
}

.expo-workspaces-name-entry,
.expo-workspaces-name-entry#selected {
  height: 1.5em;
  border-radius: 2px;
  font-size: 1em;
  padding: 5px 8px;
  -cinnamon-caption-spacing: 4px;
  @include entry(osd);

  &:focus {
    border: 1px solid $accent_color;
    background-color: $accent_color;
    color: $selected_fg_color;
    font-style: italic;
    transition-duration: 300;
    selection-background-color: $selected_fg_color;
    selected-color: $accent_color;
  }
}

.expo-workspace-thumbnail-frame {
  border: 4px solid rgba(255,255,255,0.0);
  background-color: rgba(255,255,255,0.0);
  border-radius: 2px;

  &#active {
    border: 4px solid $accent_color;
    background-color: black;
    border-radius: 2px;
  }
}

.expo-background {
  background-color: opacify($osd_bg_color, 1);
}

.workspace {
  //&-controls { visible-height: 32px; }

  &-thumbnails {
    spacing: 26px;

    &-background, &-background:rtl { padding: 8px; }
  }

  &-add-button {
    background-image: url("common-assets/misc/add-workspace.svg");
    height: 200px;
    width: 35px;
    transition-duration: 100;

    &:hover {
      background-image: url("common-assets/misc/add-workspace-hover.svg");
      transition-duration: 100;
    }
    &:active {
      background-image: url("common-assets/misc/add-workspace-active.svg");
      transition-duration: 100;
    }
  }
  &-overview-background-shade { background-color: rgba(0,0,0,0.5); }
}

.workspace-close-button,
.window-close {
  background-image: url("common-assets/misc/close.svg");
  background-size: 26px;
  height: 26px;
  width: 26px;
  -cinnamon-close-overlap: 12px;

  &:hover {
    background-image: url("common-assets/misc/close-hover.svg");
    background-size: 26px;
    height: 26px;
    width: 26px;
  }
  &:active {
    background-image: url("common-assets/misc/close-active.svg");
    background-size: 26px;
    height: 26px;
    width: 26px;
  }
}

//.workspace-thumbnail-indicator {
//  outline: 2px solid red;
//  border: 1px solid green;
//}
//
//.window-close:rtl {
//  -st-background-image-shadow: 2px 2px 6px rgba(0,0,0,0.5);
//}

.window-close-area {
  background-image: url("common-assets/misc/trash-icon.svg");
  height: 120px;
  width: 400px;
}

//
// Calendar
//
.calendar {
    spacing-rows: 0;
    spacing-columns: 0;
}

.calendar-main-box {
  margin: 0 .8em .5em .8em;
}

.calendar-events-main-box {
  height: 300px;
  margin-right: .5em;
  padding: .5em;
  min-width: 350px;
  border: 1px solid $menus_border_color;
  background-color: $bg_color2;
  border-radius: $radius;
}

.calendar-events-no-events-box {
}

.calendar-events-no-events-button {
  margin: 6px 0 6px 0;
  padding: 6px;

  &:hover {
    background-color: $accent_color;
    border-radius: $radius;

    .calendar-events-no-events-icon,
    .calendar-events-no-events-label {
      color: $selected_fg_color;
    }
  }
}

.calendar-events-no-events-icon,
.calendar-events-no-events-label {
  font-weight: bold;
  color: $fg_color;
  text-align: center;
}

.calendar-events-date-label {
  padding: .1em .1em .5em .1em;
  color: $fg_color;
  font-weight: bold;
  text-align: center;
}

.calendar-events-event-container {
  padding: 0;
}

.calendar-event-button {
  border: 1px solid rgba(0,0,0,0);
  border-radius-topright: $radius;
  border-radius-bottomright: $radius;

  .calendar-event-time-past {
    color: transparentize($fg_color, 0.6);
    font-weight: bold;
    text-align: left;
    margin-bottom: .2em;
  }
  .calendar-event-time-present {
    color: $fg_color;
    font-weight: bold;
    text-align: left;
    margin-bottom: .2em;

    &:all-day {
      color: $accent_color;
    }
  }
  .calendar-event-time-future {
    color: $fg_color;
    font-weight: bold;
    text-align: left;
    margin-bottom: .2em;
  }

  .calendar-event-summary {
    color: $fg_color;
    text-align: left;
    width: 200px;
  }

  .calendar-event-countdown {
    text-align: right;
    margin-bottom: .6em;
    color: $fg_color;

    &:soon {
      font-weight: bold;
    }
    &:imminent {
      font-weight: bold;
      color: $warning_color;
    }
    &:current {
      font-weight: bold;
      color: $accent_color;
    }
  }

  &:hover {
    background-color: $accent_color;
    border: 1px solid $borders_color;
    .calendar-event-time-past,
    .calendar-event-time-present,
    .calendar-event-time-future,
    .calendar-event-summary {
      color: $selected_fg_color
    }

    .calendar-event-countdown {
      text-align: right;
      margin-bottom: .6em;
      color: $selected_fg_color;

      &:soon {
        font-weight: bold;
      }
      &:imminent {
        font-weight: bold;
      }
      &:current {
        font-weight: bold;
      }
    }
  }
}

.calendar-event-row-content {
}

.calendar-event-color-strip {
    width: 3px;
}

.calendar-today-home-button {
  padding: 6px;
}

.calendar-today-day-label {
  font-size: 1.75em;
  color: $fg_color;
  font-weight: bold;
  text-align: center;
  padding-bottom: .1em;
}

.calendar-today-date-label {
  font-size: 1.1em;
  color: $fg_color;
  font-weight: bold;
  text-align: center;
}

.calendar-today-home-button-enabled {
  padding: 6px;
  border-radius: $radius;

  &:hover {
    background-color: $accent_color;

    .calendar-today-day-label {
      color: $selected_fg_color
    }
    .calendar-today-date-label {
      color: $selected-fg-color
    }
  }
}

.calendar-month-label {
  color: $fg_color;
  font-weight: bold;
  padding: 8px 0;
}

.calendar-change-month-back,
.calendar-change-month-forward {
  width: 16px;
  height: 16px;
}

//arrow back
.calendar-change-month-back {
  background-image: url("common-assets/misc/calendar-arrow-left.svg");

  &:focus, &:hover { background-image: url("common-assets/misc/calendar-arrow-left-hover.svg"); }

  &:active { background-image: url("common-assets/misc/calendar-arrow-left.svg"); }

  &:rtl {
    background-image: url("common-assets/misc/calendar-arrow-right.svg");

    &:focus, &:hover { background-image: url("common-assets/misc/calendar-arrow-right-hover.svg"); }

    &:active { background-image: url("common-assets/misc/calendar-arrow-right.svg"); }
  }
}

//arrow forward
.calendar-change-month-forward {
  background-image: url("common-assets/misc/calendar-arrow-right.svg");

  &:focus, &:hover { background-image: url("common-assets/misc/calendar-arrow-right-hover.svg"); }

  &:active { background-image: url("common-assets/misc/calendar-arrow-right.svg"); }

  &:rtl {
    background-image: url("common-assets/misc/calendar-arrow-left.svg");

    &:focus, &:hover { background-image: url("common-assets/misc/calendar-arrow-left-hover.svg"); }

    &:active { background-image: url("common-assets/misc/calendar-arrow-left.svg"); }
  }
}

.calendar-day-event-dot-box {
  margin-top: 1.7em;
  max-rows: 1;
}

.calendar-day-event-dot {
  margin: 1px;
  border-radius: 2px;
  width: 4px;
  height: 4px;
}

.calendar-day-base {
  font-size: 1em;
  text-align: center;
  width: 2.2em;
  height: 2.2em;
  padding: 0.1em;

  &:hover {
    font-weight: bold;
    color: $selected_fg_color;
    background-color: $accent_color;
    border-radius: $radius;
  }
}

.calendar-day-heading {
  color: transparentize($fg_color, 0.15);
  margin-top: 1em;
  font-size: 1.05em;
}

.calendar-day {
  border-width: 0;
  color: transparentize($fg_color, 0.1);
}

.calendar-day-top {
  border-top-width: 0;
}

.calendar-day-left {
  border-left-width: 0;
}

.calendar-nonwork-day {
  color: $fg_color;
  background-color: transparent;
  font-weight: bold;
}

.calendar-today {
  color: $fg_color;
  background-color: if($variant == 'light', transparentize($accent_color, 0.6), transparentize($accent_color, 0.6));
  border-width: 0;
  border-radius: $radius;

  &:selected {
    font-weight: bold;
  }
}

.calendar-not-today {
  color: $fg_color;
  border-radius: $radius;

  &:selected {
    font-weight: bold;
    background-color: if($variant == 'light', transparentize($fg_color, 0.7), transparentize($fg_color, 0.6));

    &:hover {
      font-weight: bold;
      color: $fg_color;
    }
  }
}

.calendar-other-month-day {
  color: transparentize($fg_color, 0.7);
  opacity: 1;
}

.calendar-other-month-day:hover {
  color: $selected_fg_color;
  opacity: 1;
}

.calendar-week-number {
  color: transparentize($fg_color, 0.15);
  font-size: 0.8em;
  margin-top: 0.8em;
}

//
// Notifications
//
#notification {
  box-shadow: 0 1px 15px 4px $borders_color;
  border-top-color: $accent_color;
  border-top: 4px;
  border-radius: 5px;
  background-color: $bg_color;
  padding: 13px;
  spacing-rows: 10px;
  spacing-columns: 10px;
  margin-from-right-edge-of-screen: 20px;
  width: 34em;
  color: $fg_color;

  .popup-menu & {
    color: $fg_color;
    border-image: url("#{$asset_path}/misc/message.svg") 9 9 9 9;

    .notification-button, .notification-icon-button {
      @extend %button;
      padding: 5px;
    }

    StEntry { @extend %entry; }
  }

  &.multi-line-notification {
    padding-bottom: 13px;
    color: $fg_color;
  }

  &-scrollview {
    max-height: 10em;

    > .top-shadow, > .bottom-shadow { height: 1em; }

    &:ltr > StScrollBar { padding-left: 6px; }
    &:rtl > StScrollBar { padding-right: 6px; }
  }

  &-body { spacing: 5px; }
  &-actions { spacing: 10px; }
}

.notification {

  &-with-image {
    min-height: 159px;
    color: $fg_color;
  }

  &-button, &-icon-button {
    @extend %button;
    padding: 5px;
  }

  &-icon-button > StIcon { icon-size: 32px; }

  StEntry { @extend %osd_entry; }
}

//
// Alt Tab
///
#altTabPopup {
  padding: 8px;
  spacing: 16px;
}

.switcher-list {
  color: $fg_color;
  border: 1px solid $borders_color;
  background-color: $panel_bg;
  border-radius: $radius;
  padding: 20px;

  > StBoxLayout {
    padding: 4px;
  }

  &-item-container { spacing: 8px; }

  .item-box {
    padding: 8px;
    border-radius: $radius;

    &:outlined {
      padding: 8px;
      border: 1px solid $accent_color;
    }

    &:selected {
      background-color: $bg_color4;
      border: 0px solid $accent_color;
    }
  }

  .thumbnail { width: 256px; }

  .thumbnail-box {
    padding: 2px;
    spacing: 4px;
  }
  .separator {
    width: 1px;
    background: rgba(255,255,255,0.2);
  }
}

.switcher-arrow {
  border-color: rgba(0,0,0,0);
  color: $fg_color;

  &:highlighted {
    border-color: rgba(0,0,0,0);
    color: $selected_fg_color;
  }
}

//.switcher-preview-backdrop { background-color: rgba(25,25,25,0.95); }

.thumbnail-scroll-gradient-left {
  background-color: rgba(0, 0, 0, 0);
  border-radius: 24px;
  border-radius-topright: 0px;
  border-radius-bottomright: 0px;
  width: 60px;
}

.thumbnail-scroll-gradient-right {
  background-color: rgba(0, 0, 0, 0);
  border-radius: 24px;
  border-radius-topleft: 0px;
  border-radius-bottomleft: 0px;
  width: 60px;
}

//
//Activities Ripples
//
.ripple-box {
  width: 104px;
  height: 104px;
  background-image: url("common-assets/misc/corner-ripple.svg");
  background-size: contain;

  &:rtl { background-image: url("common-assets/misc/corner-ripple.svg"); }
}

//
// Magnifier
//
.magnifier-zoom-region {
  border: 2px solid rgba(128, 0, 0, 1);

  .full-screen { border-width: 0px; }
}

//
// Cinnamon Specific Section
//

//
// Old Menu applet (deprecated since Cinnamon 6.6). Kept here temporarily
// to support spices and old Cinnamon versions
//
.menu {
  &-favorites-box {
    padding: 10px;
    transition-duration: 300;
    background-color: $bg_color2;
    border: 1px solid $menus_border_color;
    border-radius: $radius;
  }

  &-favorites-button {
    padding: .9em 1em;
    border: 1px solid rgba(0,0,0,0);
    border-radius: $radius;

    &:hover {
      background-color: $bg_color3;
      border: 1px solid $menus_border_color;
    }
  }

  &-places {

    &-box {
      padding: 10px;
      border: 0px solid red;
    }

    &-button { padding: 10px; }
  }

  &-categories-box { padding: 10px 30px 10px 30px; }

  &-applications-inner-box,
  &-applications-outer-box { margin: 10px 10px 0 10px; }

  &-application-button {
    padding: 7px;
    border: 1px solid rgba(0,0,0,0);

    // This style is used in menu application buttons for applications which were newly installed
    &:highlighted { font-weight: bold; }

    &-selected {
      padding: 7px;
      color: $noaccent_selected_fg_color;
      background-color: $bg_color2;
      border: 1px solid $menus_border_color;
      border-radius: $radius;

      &:highlighted { font-weight: bold; }
    }

    &-label:ltr { padding-left: 5px; }
    &-label:rtl { padding-right: 5px; }
  }

  &-category-button {
    padding: 7px;
    border: 1px solid rgba(0,0,0,0);

    &-selected {
      padding: 7px;
      color: $noaccent_selected_fg_color;
      background-color: $bg_color2;
      border: 1px solid $menus_border_color;
      border-radius: $radius;
    }
    &-greyed {
      padding: 7px;
      color: $insensitive_fg_color;
      border: 1px solid rgba(0,0,0,0);
    }
    &:hover {
      padding: 7px;
      color: $noaccent_selected_fg_color;
      background-color: $bg_color2;
      border: 1px solid $menus_border_color;;
      border-radius: $radius;
    }

    &-label:ltr { padding-left: 5px; }
    &-label:rtl { padding-right: 5px; }
  }

  // Name and description of the currently hovered item in the menu
  // This appears on the bottom right hand corner of the menu
  &-selected-app-box {
    padding-right: 30px;
    padding-left: 28px;
    text-align: right;
    height: 2.2em;

    &:rtl {
      padding-top: 10px;
      height: 2.2em;
    }
  }

  &-selected-app-title { font-weight: bold; }

  &-selected-app-description { max-width: 150px; }

  &-search-box:ltr { padding-left: 30px; }
  &-search-box-rtl { padding-right: 30px; }
}

#menu-search-entry {
  width: 250px;
  min-height: 16px;
  font-weight: normal;
  caret-color: $fg_color;
  border-radius: $radius;

  @extend %entry;
}

.menu-search-entry-icon {
  icon-size: 1em;
  color: $fg_color;
}

/* Context menu (at the moment only for favorites) */
.menu-context-menu {
}

// New menu (since Cinnamon 6.6)
//
// Class diagram:
// appmenu-main-box
// ├─ appmenu-right-box
// |  ├─ appmenu-search-box
// |  |  └─ appmenu-system-box
// |  └─ appmenu-categories-applications-box
// |     ├─ appmenu-categories-scrollview
// |     |  └─ appmenu-categories-box
// |     └─vfade appmenu-applications-scrollview
// |        └─ appmenu-applications-box
// └─ appmenu-sidebar
//    ├─ appmenu-sidebar-user-box
//    |  └─ user-widget user-widget-label
//    ├─ appmenu-sidebar-scrollview
//    |  └─ appmenu-sidebar-scrollbox
//    |     ├─ appmenu-places-box
//    |     └─ appmenu-favs-box
//    └─ appmenu-system-box

$appmenu_small_padding: 5px;
$appmenu_padding: 10px;
$appmenu_large_padding: 15px;
$base_padding: 7px;

%appmenu_button {
  padding: $base_padding;
  spacing: 5px;
  border-radius: $radius;
}
.appmenu {

  // this can be used to color the entire menu background but we aren't using it here
  &-background {
    // using this to override the default padding on menus so widgets can span edge
    // to edge. The side effect is that some of our internal container widgets
    // will need to have a border-radius added to them or the corners will poke out
    // the edges of the menu.
    .popup-menu-content { padding: 0; }
  }

  &-main-box {
    spacing: $appmenu_padding;
  }

  &-right-box {
    spacing: $appmenu_small_padding;
    padding: $appmenu_padding $appmenu_padding;
  }

  &-categories-applications-box {
    spacing: $appmenu_large_padding;

    &:top {
      // Extra padding at the top of the categories/apps
      // when the search box is at the bottom
      padding-top: $appmenu_small_padding;
    }
  }

  &-applications-box {
    // Extra gap between the highlighted app and the scroll handle
    padding-right: $appmenu_small_padding;
  }

  &-search-box {
    spacing: $appmenu_padding;
  }

  &-sidebar {
    padding: $appmenu_large_padding 0px;
    background-color: $bg_color2;
    border-radius: $radius 0 0 0;
    @at-root .menu-top #{&}    { border-radius: 0 0 0 $radius; }
    @at-root .menu-bottom #{&} { border-radius: $radius 0 0 0; }
    @at-root .menu-left #{&}   { border-radius: 0; }
    @at-root .menu-right #{&}  { border-radius: 0; }
    border-right-width: 1px;
    border-color: $borders_color;
    spacing: 5px;

    &-user-box {}

    .appmenu-system-button {
      background-color: lighten($bg_color2, 10%);
      &-lock:hover { background-color: lighten($bg_color2, 15%); }
      &-logout:hover { background-color: lighten($bg_color2, 15%); }
      &-shutdown { color: white; background-color: $osd_destructive_color; }
      &-shutdown:hover { color: white; background-color: lighten($osd_destructive_color, 5%); }
    }
  }

  &-system-box {
    spacing: $appmenu_padding;
  }

  &-sidebar-button {
    @extend %appmenu_button;

    padding: 4px $base_padding;
    margin: 0 $appmenu_padding;

    &:hover {
      background-color: $bg_color3;
      border-color: $borders_color;
    }
  }

  &-system-button {
    padding: $base_padding * 1.2;
    border: 1px solid $borders_color;
    border-radius: 9999px;
    background-color: lighten($bg_color2, 5%);
    &-shutdown { color: white; background-color: $osd_destructive_color; }
    &-lock:hover { background-color: lighten($bg_color2, 10%); }
    &-logout:hover { background-color: lighten($bg_color2, 10%); }
    &-shutdown:hover { color: white; background-color: lighten($osd_destructive_color, 5%); }
  }

  &-application-button {
    @extend %appmenu_button;

    &-label { padding: 0; }
    &-description {
      @extend %caption;
      color: $dim_color;
    }

    &:highlighted { font-weight: bold; }

    &-selected {
      @extend %appmenu_button;
      background-color: $bg_color2;

      &:highlighted { font-weight: bold; }
    }
  }

  &-category-button {
    @extend %appmenu_button;

    &-label { padding: 0; }

    &:hover { background-color: $bg_color3; }

    &-selected {
      @extend %appmenu_button;

      background-color: $bg_color2;
    }

    &-greyed {
      @extend %appmenu_button;
      color: $insensitive_fg_color;
      font-style: italic;

      StIcon { opacity: 0.5; }
    }
  }

  &-search-entry-icon {
    icon-size: 1em;
  }
}

#appmenu-search-entry {
  @extend %entry;
}

//
// Window list (windowList.js)
//
.window-list {

  &-box {
    spacing: 6px;
    padding-left: 10px;
    padding-top: 1px;

    &.vertical {
      spacing: 2px;
      padding-left: 0px;
      padding-right: 0px;
      padding-top: 10px;
      padding-bottom: 10px;
    }

    &:highlight {
      background-color: transparentize($error_color, 0.5);
    }
  }

  &-item-label {
    font-weight: bold;
    width: 15em;
    min-width: 5px;
  }

  &-item-box {
    font-weight: bold;
    background-image: none;
    padding-top: 0;
    padding-left: 8px;
    padding-right: 8px;
    transition-duration: 100;
    color: transparentize($panel_fg, 0.2);

    &.top,
    &.bottom {
      border-bottom-width: 2px;

      & StLabel { padding-left: 2px; }
    }

    &.right {
      padding-left: 0px;
      padding-right: 0px;
      border-right-width: 2px;

      & StBin { padding-right: 0; }
    }

    &.left {
      padding-left: 0px;
      padding-right: 0px;
      border-left-width: 2px;

      & StBin { padding-left: 1px; }
    }

    &:hover,
    &:groupFocus {
      color: $panel_fg;
      background-color: transparentize($panel_fg, 0.8);
    }

    &:active,
    &:checked,
    &:focus,
    &:running {
      color: $panel_fg;
      border-color: $accent_color;
      background-color: transparentize($panel_fg, 0.8);
    }

    & .progress {
      background-color: transparentize($accent_color, 0.2);
    }
  }

  &-item-demands-attention {
    background-gradient-direction: vertical;
    background-gradient-start: $destructive_color;
    background-gradient-end: $destructive_color;
  }

  &-preview {
    spacing: 6px;
    color: $fg_color;
    border: 1px solid $menus_border_color;
    background-color: $bg_color;
    border-radius: 3px;
    padding: 6px 12px 12px 12px;
    font-size: 1em;
  }
}

//
// Grouped window list
//

.grouped-window-list {

  &-item-label {
    font-weight: bold;
    width: 15em;
    min-width: 5px;
  }

  &-item-box {
    text-align: left;
    font-weight: bold;
    background-image: none;
    padding-top: 0;
    padding-left: 8px;
    padding-right: 8px;
    transition-duration: 100;
    color: transparentize($panel_fg, 0.2);

    &.top,
    &.bottom {
      border-bottom-width: 2px;
    }

    &.right {
      padding-left: 0px;
      padding-right: 0px;
      border-right-width: 2px;

      & StBin { padding-right: 0; }
    }

    &.left {
      padding-left: 0px;
      padding-right: 0px;
      border-left-width: 2px;

      & StBin { padding-left: 1px; }
    }

    &:hover,
    &:focus {
      color: $panel_fg;
      background-color: $bg_color2;
    }

    &:active,
    &:checked {
      color: $panel_fg;
      border-color: $accent_color;
    }

    & .progress {
      background-color: transparentize($accent_color, 0.2);
    }
  }

  &-item-demands-attention {
    background-gradient-direction: vertical;
    background-gradient-start: $destructive_color;
    background-gradient-end: $destructive_color;
  }

  &-thumbnail-label {
    padding-left: 4px;
  }

  &-number-label {
    font-size: 12px;
    color: $selected_fg_color;
  }

  &-badge {
    border-radius: 99px;
    background-color: $accent_color;
    margin: 0;
  }

  &-notifications-badge-label {
    font-size: 12px;
  }

  &-button-label {
    padding-left: 4px;
  }

  &-thumbnail-alert {
    background: rgba(255,52,52,0.3);
  }

  &-thumbnail-menu {
    color: $fg_color;
    border: 1px solid $menus_border_color;
    background-color: $bg_color;
    border-radius: 3px;
    padding: 0px;

    > StBoxLayout {
      padding: 4px;
    }

    .item-box {
      padding: 10px;
      border-radius: 2px;
      spacing: 4px;

      &:outlined {
        padding: 8px;
        border: 1px solid $accent_color;
      }

      &:selected {
        border: 1px solid $accent_color;
      }
    }

    .thumbnail { width: 256px; }

    .separator {
      width: 1px;
      background: rgba(255,255,255,0.2);
    }
  }
}

///
// Sound Applet (status/volume.js)
//
.sound-button {
  width: 22px;
  height: 13px;
  padding: 8px;

  @extend %button;

  &-container {
    padding-right: 3px;
    padding-left: 3px;
  }
  StIcon { icon-size: 1.4em; }
}

.sound-track {
  &-infos { padding: 5px; }
  &-info {
    padding-top: 2px;
    padding-bottom: 2px;

    StIcon { icon-size: 16px; }

    StLabel {
      padding-left: 5px;
      padding-right: 5px;
    }
  }
  &-box {
    padding-left: 15px;
    padding-right: 15px;
    max-width: 220px;
  }
}

.sound-seek-box {
  padding-left: 15px;

  StLabel { padding-top: 2px; }
  StIcon { icon-size: 16px; }
}

.sound-seek-slider { width: 140px; }

.sound-volume-menu-item {
  padding: .4em 1.75em;

  StIcon {
    icon-size: 1.14em;
    padding-left: 8px;
    padding-right: 8px;
  }
}

.sound-playback-control { padding: 5px 10px 10px 10px; }

// 2.8
.sound-player {
  // padding: 0 4px;

  > StBoxLayout:first-child {
    padding: 5px 10px 12px 10px;
    spacing: 0.5em;

    StButton:small {
      width: 20px;
      height: 20px;
      border: 1px solid transparent;

      StIcon { icon-size: 12px; }

      &:hover { @include button(hover); }
      &:active { @include button(active); }
    }
  }

  &-generic-coverart {
    background: rgba(0,0,0,0.2);
  }

  &-overlay {
    width: 290px;
    padding: 15px;
    spacing: 0.5em;
    background: transparentize($bg_color, 0.1);
    border-top: 1px solid $borders_color;
    // background: transparentize(darken($osd_bg_color, 5%), 0.1);
    // border: 0px solid darken($osd_bg_color, 10%);
    // border-bottom: 1px ;
    color: $fg_color;

    StButton {
      width: 22px;
      height: 13px;
      padding: 5px;
      color: $fg_color;
      border-radius: 2px;
      border: 1px solid transparent;

      StIcon { icon-size: 16px; }

      &:hover{ @include button(hover); }
      &:active { @include button(active); }
    }

    StBoxLayout {
      padding-top: 2px;
    }

    > StBoxLayout {
      spacing: 5px;
    }
  }

  .slider {
    height: 0.5em;
    padding: 0;
    border: none;
    -slider-height: 0.5em;
    -slider-background-color: if($variant == 'light', $button_border, darken($bg_color, 5%));
    -slider-border-color: rgba(0,0,0,0);
    -slider-active-background-color: $accent_color;
    -slider-active-border-color: rgba(0,0,0,0);
    -slider-border-width: 0px;
    -slider-handle-radius: 0px;
  }
}

// workspace switcher applet

.panel-top,
.panel-bottom {

  .workspace-switcher { padding: 0 4px;}
}

.workspace-button {
  border: 1px solid $borders_color;
  width: 2em;
  color: $insensitive_fg_color;
  background-color: transparentize($fg_color, 0.95);

  &.vertical { height: 2em; }

  &:outlined {
    background-color: $bg_color2;
    color: $fg_color;

    &:hover { background-color: $bg_color3; }
  }

  &:hover { background-color: $bg_color2; }

  &:shaded { // this is a workspace with no open windows
    background-color: darken($bg_color, 5%);
  }
}

$workspace_window_color: if($variant == 'light', black, white);

.workspace-graph {
  padding: 4px;
  spacing: 4px;

  .workspace {
    border: 1px solid transparentize($fg_color, 0.8);
    background-color: $bg_color;

    &:active {
      border-color: $accent_color;

      .windows {
        -active-window-background: transparentize($workspace_window_color, 0.7);
        -active-window-border: transparentize($workspace_window_color, 0.65);
        -inactive-window-background: transparentize($workspace_window_color, 0.9);
        -inactive-window-border: transparentize($workspace_window_color, 0.85);
      }
    }

    .windows {
      -active-window-background: transparentize($workspace_window_color, 0.7);
      -active-window-border: transparentize($workspace_window_color, 0.65);
      -inactive-window-background: transparentize($workspace_window_color, 0.9);
      -inactive-window-border: transparentize($workspace_window_color, 0.85);
    }
  }
}

//
// Panel Launchers Applet (panelLaunchers.js)
//
.panel-launchers {
  padding-left: 7px;
  spacing: 2px;

  & .launcher {
    padding-left: 2px;
    padding-right: 2px;
    padding-bottom: 2px;
    // border-bottom-width: 1px;
    transition-duration: 200;
    &:hover { 
      background-color: $bg_color2;
    }
  }

  &.vertical {
    padding-top: 2px;
    padding-bottom: 2px;
    padding-left:0px;
    padding-right: 0px;
    spacing: 1px;

    & .launcher {
      padding-top: 2px;
      padding-bottom: 2px;
    }
  }
}

//
// Overview corner
//
#overview-corner {
  background-image: url("common-assets/misc/overview.png");

  &:hover { background-image: url("common-assets/misc/overview-hover.png"); }
}

//
// Applets (applet.js)
//

//padding and spacing for applets
$applet_padding: 5px;

.applet {
  &-separator {
    padding: 1px 4px;

    &.vertical { padding: 4px 1px; }
  }

  &-separator-line {
    width: 1px;
    background: $borders_color;

    &-vertical {
      height: 1px;
      background: $borders_color;
    }
  }

  &-box {
    padding: 0 $applet_padding;
    spacing: $applet_padding;
    color: $panel_fg;
    text-shadow: none;
    transition-duration: 100;
    text-align: center;

    &.vertical {
      padding: $applet_padding 0;
    }

    &:hover,
    &:checked {
      color: $noaccent_selected_fg_color;
      background-color: $bg_color2;
    }

    &:highlight {
      background-image: none;
      border-image: none;
      background-color: transparentize($error_color, 0.5);
    }
  }

  &-label {
    font-weight: bold;
    color: $panel_fg;

    &:hover,
    &:checked,
    .applet-box:hover &,
    .applet-box:checked & {
      color: $noaccent_selected_fg_color;
      text-shadow: none;
    }
  }

  &-icon {
    color: $noaccent_selected_fg_color;
    icon-size: 22px;

    &:hover,
    &:checked,
    .applet-box:hover > &,
    .applet-box:checked > & {
      color: $noaccent_selected_fg_color;
      text-shadow: none;
    }
  }

}

//
// User Applet
//
.user-icon {
  background-size: contain;
  border-radius: 99px;
  color: $fg_color;
  border-color: transparent;

  & StIcon {
    border: 1px solid transparent;
    border-radius: 99px;
    padding: 14px;
  }

  & StIcon.highlighted {
    border: 1px solid $fg_color;
    border-radius: 99px;
    padding: 14px;
  }

  &.user-avatar {
    border: 1px solid transparent;
    border-radius: 99px;
  }
}

.user-label {
    color: $fg_color;
    font-size: 1em;
    font-weight: bold;
    margin: 0px;
}

.user-widget-label {}

.user-widget.horizontal { spacing: 7px; }

.user-widget.vertical { spacing: $appmenu_padding; }

.user-widget.vertical .user-widget-label {
  @extend %title_4;
  color: $fg_color;
  text-align: center;
}

// cornerbar applet

.applet-cornerbar {
  width: 8px;
  background-color: $corner_bar_unhighlighted;
  border: 1px solid $borders_color;

  &.vertical { height: 8px; }

  &-box {
    background: none;
  }
}

.applet-cornerbar-box:hover > .applet-cornerbar { background-color: $corner_bar_highlighted; }

//
// Desklets (desklet.js)
//
.desklet {
  color: $fg_color;

  &:highlight {
    background-color: transparentize($error_color, 0.5);
  }

  &-with-borders {
    border: 1px solid $borders_color;
    border-radius: 5px;
    background-color: $bg_color;
    color: $fg_color;
    padding: 12px;
    padding-bottom: 16px;

    &:highlight {
      background-color: transparentize($error_color, 0.5);
    }
  }

  &-with-borders-and-header {
    border: 1px solid $borders_color;
    border-top-width: 0;
    border-radius: 0 0 5px 5px;
    background-color: $bg_color;
    color: $fg_color;
    border-radius: 0;
    border-radius-topleft: 0;
    border-radius-topright: 0;
    padding: 12px;
    padding-bottom: 17px;

    &:highlight {
      background-color: transparentize($error_color, 0.5);
    }
  }

  &-header {
    border: 1px solid $borders_color;
    border-radius: 5px 5px 0 0;
    background-color: darken($bg_color, 3%);
    color: $fg_color;
    font-size: 1em;
    padding: 12px;
    padding-bottom: 6px;
  }

  &-drag-placeholder {
    border: 2px solid $accent_color;
    background-color: transparentize($accent_color, 0.7);
  }
}

.photoframe-box {
  border: 1px solid $borders_color;
  border-radius: 5px;
  background-color: $bg_color;
  color: $fg_color;
  padding: 12px;
  padding-bottom: 16px;
}

//
// Notification Applet
//
.notification-applet-padding { padding: .5em 1em; }

.notification-applet-container { max-height: 100px; }

//
// Tile Preview
//
.tile-preview {
  background-color: transparentize($accent_color, 0.7);
  border: 1px solid $accent_color;

  &.snap { background-color: transparentize($accent_color, 0.4); }
}

.tile-hud {
  background-color: transparentize($accent_color, 0.7);
  border: 1px solid $accent_color;

  &.snap { background-color: transparentize($accent_color, 0.4); }

  &:top { border-top-width: 0px; }
  &:bottom { border-bottom-width: 0px; }
  &:left { border-left-width: 0px; }
  &:right { border-right-width: 0px; }
  &:top-left {
    border-top-width: 0px;
    border-left-width: 0px;
  }
  &:top-right {
    border-top-width: 0px;
    border-right-width: 0px;
  }
  &:bottom-left {
    border-bottom-width: 0px;
    border-left-width: 0px;
  }
  &:bottom-right {
    border-bottom-width: 0px;
    border-right-width: 0px;
  }
}

.xkcd-box {
  padding: 6px;
  border: 0px;
  background-color: rgba(0,0,0,0);
  border-radius: 0px;
}
