// Include base styling.
@import 'shared-base';

.incognito-mode {
  $window_color: $incognito_color;
  @import 'Adwaita-colored-window';
}

.automation-mode {
  $window_color: $automation_color;
  @import 'Adwaita-colored-window';
}

@import 'drawing';

$close_button_fg_color: if($variant == 'light', lighten($fg_color, 10%), darken($fg_color, 10%));
@mixin close_button($bg:$bg_color, $fg:$close_button_fg_color) {
  background: none;
  border: none;
  box-shadow: none;

  &:last-child {
    image {
      color: $fg;
      border: 1px solid transparent;
      border-radius: 5px;
    }

    &:hover image {
      @include button(normal, $bg, $fg);
      @include button(hover, $bg, $fg);
    }

    &:active image {
      @include button(normal, $bg, $fg);
      @include button(active, $bg, $fg);
    }
  }
}

@if not $high_contrast {
  .url_entry:not(:hover):not(:focus) {
    background-color: transparentize($base_color, 0.25);
  }
}

.bookmark-tag-widget {
  border-radius: 5px;

  button {
    @include close_button();
  }
}

.bookmark-tag-widget-selected button {
  @include close_button($selected_bg_color, $selected_fg_color);
}

.page-row-close-button {
  @include close_button();

  row:selected & {
    @include close_button($selected_bg_color, $selected_fg_color);
  }

  row.narrow & image {
    padding: 6px;
  }
}

@keyframes needs_attention_keyframes {
    0% {background-image: linear-gradient(to bottom, #fafafa, #ededed 40%,  #e0e0e0); border-color: themecolor(borders); }
    /* can't do animation-direction, so holding the color on two keyframes */
    30% {background-image: linear-gradient(to bottom, themecolor(theme_base_color), themecolor(theme_base_color), themecolor(theme_base_color)); border-color: themecolor(theme_fg_color); }
    90% {background-image: linear-gradient(to bottom, themecolor(theme_base_color), themecolor(theme_base_color), themecolor(theme_base_color)); border-color: themecolor(theme_fg_color); }
    100% {background-image: linear-gradient(to bottom, #fafafa, #ededed 40%,  #e0e0e0); border-color: themecolor(borders); }
}

.epiphany-downloads-button-needs-attention {
  animation: needs_attention_keyframes 2s ease-in-out;
}

.epiphany-downloads-button-needs-attention-multiple {
  animation: needs_attention_keyframes 3s ease-in-out;
  animation-iteration-count: 3;
}

// Pinned tabs
.main-notebook {
  tab {
    min-width: 16px;
  }

  header {
    &.top,
    &.bottom {
      tab {
        border-style: none solid;
      }
    }

    &.left,
    &.right {
      tab {
        border-style: solid none;
      }
    }
  }
}

.tab-attention {
  $_dot_color: if($variant=='light', $selected_bg_color,
                                   lighten($selected_bg_color,15%));
  background-image: -gtk-gradient(radial,
                                  center center, 0,
                                  center center, 0.5,
                                  to($_dot_color),
                                  to(transparent));
}

#title-box-container {
  color: gtkalpha(themecolor(theme_fg_color), 0.2);

  > clamp {
    color: themecolor(theme_fg_color);

    &:backdrop {
      color: themecolor(theme_unfocused_fg_color);
    }
  }
}
