/*********
 * Links *
 *********/
@at-root %link,
*:link {
  &, &:hover, &:active { color: $link_color; }

  &:visited {
    &, &:hover, &:active { color: $visited_link_color; }
  }

  @at-root %link_selected,
  &:selected,
  *:selected & { color: $inverse_fg_color; }
}

button:link,
button:visited {
  @extend %link;

  > label { text-decoration-line: underline; }
}

/********
 * Misc *
 ********/
// content view (grid/list)
.content-view {
  background-color: $bg_color;

  // &:hover { -gtk-icon-effect: highlight; }

  rubberband, .rubberband { @extend rubberband; }
}

.scale-popup {
  .osd & { @extend %osd; }

  .osd & button.flat {
  }

  button { // +/- buttons on GtkVolumeButton popup
  }
}

/*********************
 * Spinner Animation *
 *********************/
@keyframes spin {
  to { -gtk-icon-transform: rotate(1turn); }
}

spinner {
  background: none;
  opacity: 0; // non spinning spinner makes no sense
  -gtk-icon-source: -gtk-icontheme('process-working-symbolic');

  &:checked {
    opacity: 1;
    animation: spin 1s linear infinite;

    &:disabled { opacity: $disabled_opacity; }
  }
}

/****************
 * Print dialog *
*****************/
printdialog {
  paper {
    padding: 0;
    border: $border_size solid $border_color;
    background-color: $base_color;
    color: $fg_color;
  }

  .dialog-action-box { margin: $standard_padding; }
}

/*********************
 * App Notifications *
 *********************/
.app-notification {
  @extend %osd;

  @extend %toolbar_osd;

  margin: $small_padding;

  button { @extend %flat_button; }

  &.frame,
  border { border-style: none; }
}

/************
 * Calendar *
 ************/
calendar {
  padding: $mini_padding;
  border: $border_size solid $border_color;
  color: $fg_color;

  &:disabled { color: $disabled_fg_color; }

  &:selected {
    @extend %selected_items;

    border-radius: $pocillo_radius;
  }

  &.header {
    border-style: none none solid;
    border-radius: 0;
  }

  &.button { @extend %simple_flat_button; }

  &.highlight {
    color: $secondary_fg_color;
    font-weight: 500;
  }

  &:indeterminate { color: $disabled_secondary_fg_color; }
}

/**********************
 * Touch Copy & Paste *
 **********************/
// touch selection handlebars for the Pocilloover.osd above
cursor-handle {
  border-radius: $circular_radius;
  background-color: $primary_color;
  background-image: none;

  &.top:dir(ltr), &.bottom:dir(rtl) {
    padding-left: $tiny_padding;
    border-top-right-radius: 0;
  }

  &.bottom:dir(ltr), &.top:dir(rtl) {
    padding-right: $tiny_padding;
    border-top-left-radius: 0;
  }

  &.insertion-cursor:dir(ltr), &.insertion-cursor:dir(rtl) {
    -GtkWidget-text-handle-width: 24;
    -GtkWidget-text-handle-height: 30;

    $_url: 'assets/scale-horz-marks-before-slider#{$asset_suffix}';
    -gtk-icon-source: -gtk-scaled(url('#{$_url}.png'),
                                  url('#{$_url}@2.png'));
  }
}

.context-menu { font: initial; } // Decouple the font of context menus from their entry/textview

// shortcut window keys
.keycap {
  min-width: $shortcut_key_size;
  min-height: $shortcut_key_size;
  margin-top: $mini_padding;
  padding-bottom: $mini_padding;
  padding-left: $small_padding;
  padding-right: $small_padding;

  border: solid $border_size $border_color;
  border-radius: $shortcut_key_radius;
  box-shadow: inset 0 -2px $border_color;
  background-color: $base_color;
  color: $fg_color;
  font-size: smaller;
}

/*
:not(decoration):not(window):drop(active) { // FIXME needs to be done widget by widget, this wildcard should really die
  transition: $longer_transition;
  box-shadow: $shadow_1, inset 0 0 0 2px $accent_color;
  caret-color: $accent_color;
}*/

stackswitcher button.text-button { min-width: 100px; } 

stackswitcher button.circular,
stackswitcher button.text-button.circular { 
  min-width: $medium_size;
  min-height: $medium_size;
  padding: 0;
}

/********
 * Misc *
 ********/
// content view (grid/list)
.content-view {
  background-color: $bg_color;

  rubberband, .rubberband { @extend rubberband; }
}

.osd .scale-popup { @extend %osd; }


// catch all extend :)

%selected_items {
  background-color: $primary_color;
  color: $inverse_fg_color;
  &:backdrop {background-color: backdrop($primary_color); }

  @at-root %nobg_selected_items, & {
    color: $inverse_fg_color;
 
    @at-root %selected_items_disabled,
    &:disabled { color: $inverse_disabled_fg_color; }
  }
}

.monospace { font-family: monospace; }

