
//
// Elementary Desktop
//

// Wingpanel
.menubar.panel {
  .panel {
    &, &.color-light, &.color-dark {
      background-color: $panel_bg;
      background-image: image($panel_bg);
      transition: all 100ms ease-in-out;
      color: $panel_fg;
    }

    &.maximized {
      background-color: darken($panel_bg, 10%);
    }

    &.translucent {
      background-color: rgba($panel_bg, 0.95);
    }

    menubar {
      background: none;
      box-shadow: none;
      border: none;
    }
  }

  &-shadow {
    background-image: none;
    background-color: transparent;
  }

  popover {
    padding: 2px 4px;
    font-weight: normal;
    border: 1px solid if($variant == 'light', rgba(black, 0.35), rgba(white, 0.12));
    box-shadow: 0 2px 3px rgba(black, 0.12), 0 3px 6px rgba(black, 0.08);

    button {
      font-weight: normal;
      border-color: transparent;
      background-color: transparent;

      &:hover { border-color: $borders_color; }
      &:active, &:checked {
        border-color: $sec_selected_bg_color;
        label { color: white; }
      }
    }

    .linked > button {
      border-color: $borders_color;
    }

    list { background-color: transparent; }

    separator.horizontal {
      margin: 0 -4px;
    }

    separator.vertical {
      background-image: image($borders_color);
      margin: 0 2px;
    }

    .sidebar {
      border-style: none;
      background: none;

      .view {
        background: none;
        border-radius: $bt_radius;
        border: 1px solid transparent;
        color: $text_color;
        transition: $shorter_transition;

        &:hover {
          background-color: if($variant=='light', mix($fg_color, $bg_color, 5%), mix($fg_color, $bg_color, 10%));
          border: 1px solid $borders_color;
        }

        &:selected,
        &:active,
        &:checked,
        &:active:backdrop,
        &:checked:backdrop,
        &:selected:backdrop {
          color: $selected_fg_color;
          background-color: $selected_bg_color;
          border: 1px solid if($variant=='light', $sec_selected_bg_color, $alt_selected_bg_color);
        }
      }
    }
  }
}

// Popover switcher dots
button.flat.toggle.switcher {
  &:hover, &:active, &:checked, &:selected {
    image {
      color: $selected_bg_color;
    }
  }

  -gtk-outline-radius: 100px;
}

// Calendar Popover
.circular { // Calendar popover date button
  label:disabled { color: $insensitive_fg_color; }

  &.accent { // Today button
    color: $selected_fg_color;
    background-color: $selected_bg_color;
  }
}

.panel-app-button > GtkWidget > GtkWidget:first-child {
  padding: 0 2px 0 4px;
}

.panel .menu .spinner,
.menu .spinner { opacity: 1; } // Fixes sound indicator buttons

.composited-indicator {
  background-color: transparent;
  color: $panel_fg;
  padding: 0 $cont_padding;

  > revealer label,
  > revealer image,
  > revealer spinner {
    color: $panel_fg;
    font-weight: normal;
    text-shadow: none;
    transition: all 200ms ease-in-out;
  }

  > revealer image,
  > revealer spinner {
    padding: 3px 0;
  }

  > revealer label {
    padding: 3px 6px;
  }

  .keyboard {
    background-color: #fff;
    border-radius: $bt_radius;
    box-shadow: none;
    color: #333;
    font-weight: 600;
    padding: 0 3px;
    text-shadow: none;
  }

  > GtkWidget > GtkWidget:first-child { padding: 0 2px; }

  .menuitem:active, .menuitem:hover {
    border-style: none;
  }

  > .popup > .menu {
    padding-top: 8px;
    padding-bottom: 8px;
  }
}

// Birdie
BirdieWidgetsTweetList * {
  background-image: none;
  background-color: transparent;
}

// Marlin / Pantheon Files
MarlinViewWindow {
  *:selected, *:selected:focus {
    color: $selected_fg_color;
    background-color: $selected_bg_color;
    outline-color: transparent;
  }

  GtkIconView.view:selected {
    &, &:focus, &:hover, &:focus:hover { background-color: transparent; }
  }

  FMListView, FMColumnView { outline-color: transparent; }
}

.marlin-pathbar.pathbar {
  border-radius: $bt_radius;
  padding-left: 4px;
  padding-right: 4px;

  @include entry(header-normal);
  &:focus { @include entry(header-focus) }
  &:disabled { @include entry(header-insensitive) }
  &:active, &:checked { color: $selected_bg_color; }
}

treeview.view {
  &.sidebar {
    color: $dark_sidebar_fg;
    background-color: $dark_sidebar_bg;

    &.source-list {
      padding-top: 3px;
      padding-bottom: 3px;

      &.has-open-popup,
      &:hover {
        color: $dark_sidebar_fg;
        background-color: mix($dark_sidebar_fg, $dark_sidebar_bg, 10%);
      }

      &:disabled {
        color: rgba($dark_sidebar_fg, 0.35);
      }

      &:selected {
        @extend %selected_items;

        &.has-open-popup,
        &:hover {
          color: $selected_fg_color;
          background-color: mix(black, $selected_bg_color, 10%);
        }
      }

      &.trough {
        color: $fg_color;
        background-color: $borders_color;
        border-radius: $bt_radius;
        border-width: 0;

        &:selected, &:selected:focus {
          color: $selected_fg_color;
          background-color: rgba(black, 0.2);
          border-radius: $bt_radius;
          border-width: 0;
        }
      }
    }
  }
}

.dynamic-notebook {
  notebook {
    iconview.view.cell {
      &:selected { background-color: if($variant == 'light', rgba(black, 0.1), rgba(white, 0.08)); }
    }

    .overlay-bar { // floating infobar of files
      box-shadow: none;
      text-shadow: none;
    }
  }
}

headerbar.titlebar {
  > box.horizontal > entry.pathbar {
    // min-height: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding: 2px 12px;

    caret-color: currentColor;
  }

  button.flat.image-button.toggle {
    margin-top: 4px;
    margin-bottom: 4px;
  }

  // Hide Code header format-bar
  > grid.linked.horizontal.format-bar {
    background-image: image($header_bg);
    border-bottom: 1px solid transparent;
    border-radius: 0;

    &:backdrop {
      transition: $backdrop_transition;
      background-image: image($header_bg_backdrop);
    }
  }
}

// Code
popover {
  radiobutton {
    &.color-button {
      &.color-light, &.color-dark, &.color-white {
        border: 1px solid $borders_color;
      }
    }
  }
}

// Gala
.gala-notification {
    border: 1px solid rgba(0, 0, 0, 0.35);
    border-radius: $bt_radius;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    background-image: _solid(white);
    background-color: transparent;

  .title, .label {
    color: #5c616c;
  }
}

// system setting
actionbar.inline-toolbar {
  border: none;
  border-top: 1px solid $borders_color;

  // button + button { margin-left: -6px; }

  button { // Reset buttons
    border-radius: $bt_radius;
    border: 1px solid $borders_color;

    &:first-child { border-right-style: solid; }
    &:last-child { border-left-style: solid; }
  }
}

// Nightlight warmth trough
scale.warmth trough {
  background-image: linear-gradient(to right, $suggested_color, $destructive_color);
  box-shadow: inset 0 0 0 1px rgba($borders_color, 0.25);
}

// Terminal
.terminal-window {
  headerbar.titlebar.default-decoration {
    box-shadow: inset 0 -1px $borders_color;
  }

  .search-bar {
    background-color: $bg_color;
    border-bottom: 1px solid $solid_borders_color;
  }

  .dynamic-notebook {
    notebook > header { border-color: $solid_borders_color; }
  }
}
