@import url(https://fonts.googleapis.com/css2?family=Google+Sans+Code);

$card-title-background-color: #fff;
$card-title-focus-background-color: #eee;
$card-title-color: #000;
$button-focus-color: #777;
$border-color: #eee;
$content-primary-color: #4a4a4a;
$content-secondary-color: #5f6368;
$dark-theme-card-title-background-color: #3f51b5;
$dark-theme-card-title-focus-background-color: #7885cb;
$dark-theme-card-title-color: #fff;
$code-font-family: 'Google Sans Code', monospace;

.goog-tooltip {
  z-index: 10;
}

.mat-mdc-tooltip {
  font-size: 12px;
}

.google-visualization-table-type-number {
  text-align: center;
}

.hidden-content trace-viewer {
  display: none;
}

//TODO(jonahweaver): Remove tool specific styles from common.scss to tool specific stylesheet.
op-profile .ops-control .mat-mdc-form-field {
  /* stylelint-disable-next-line declaration-no-important -- legacy code */
  text-align: center !important;
}

// Styles for overlay components needs to be global.
//
// Reference: https://material.angular.io/guide/customizing-component-styles#styling-overlay-components
// Some OS hides scrollbars while not in use. Always show scrollbar if the
// overlay has a scroll feature.
.panel-override::-webkit-scrollbar {
  -webkit-appearance: none;
  width: 7px;
}

.panel-override::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background-color: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
}

.google-chart-table-header-cell {
  word-wrap: break-word;
  background-color: #fff;
  /* stylelint-disable-next-line declaration-no-important -- legacy code */
  border-top: none !important;
  /* stylelint-disable-next-line declaration-no-important -- legacy code */
  border-left: none !important;
  /* stylelint-disable-next-line declaration-no-important -- legacy code */
  border-right: none !important;
}

.google-chart-table-table-cell {
  word-break: break-all;
  color: black;
  /* stylelint-disable-next-line declaration-no-important -- legacy code */
  border-top: none !important;
  /* stylelint-disable-next-line declaration-no-important -- legacy code */
  border-left: none !important;
  /* stylelint-disable-next-line declaration-no-important -- legacy code */
  border-right: none !important;
}

.horizontal-center {
  text-align: center;
}

.full-width {
  width: 100%;
}

.full-height {
  height: 100%;
}

.auto-height {
  height: auto;
}

.disabled {
  color: rgba(0, 0, 0, 0.26);
}

.hidden-content {
  height: 0;
  overflow: hidden;
}

.primary-content {
  color: $content-primary-color;
}

.description {
  color: $content-secondary-color;
  font-size: 14px;
  font-style: italic;
}

.item-container {
  padding: 20px 20px 0;
}

.row {
  display: flex;
  align-items: center;
}

mat-card {
  // MDC mat-card does not have padding by default
  // Add padding to keep style persistent during migration
  padding: 16px;
}

mat-form-field {
  margin-top: 16px;
}

mat-option {
  // Break word for long text to see full content
  overflow-wrap: break-word;
}

// TODO(css-cleanup): Remove redundant styles in component's css files for loading spinner.
mat-progress-bar {
  width: 200px;
  margin: 0 auto;
}

.loading-message {
  width: fit-content;
  margin: 0 auto;
}

.progress-container {
  position: absolute;
  width: 100%;
  margin: 300px 0;
  z-index: 1;
}

@mixin overview-card {
  /* stylelint-disable-next-line declaration-no-important -- legacy code */
  box-shadow: none !important;
  margin: 8px;
  @media screen and (max-width: 1140px) {
    min-width: 500px;
  }
}

@mixin overview-card-dark-theme {
  margin: 8px;
  @media screen and (max-width: 1140px) {
    min-width: 500px;
  }
}

@mixin overview-card-height {
  height: calc(100% - 48px);
}

@mixin overview-card-title {
  background-color: $card-title-background-color;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  color: $card-title-color;
  font-size: 24px;
  font-weight: 400;
}

@mixin box-shadow-none {
  box-shadow: none;
}

@mixin border-black {
  border: 1px solid #000;
}

@mixin border-bottom-gray {
  border-bottom: 1px solid #eee;
}

@mixin border-right-gray {
  border-right: 1px solid #eee;
}

@mixin ul-flat {
  list-style-position: outside;
  margin-top: -16px;
  padding-inline-start: 20px;
}

@mixin detail-card {
  /* stylelint-disable-next-line declaration-no-important -- legacy code */
  box-shadow: none !important;
  border-top: 1px solid #eee;
  border-radius: 0;
  padding: 0;
}

// CSS for callout components.

.callout {
  padding: 0;
  border-left: none;
  border-radius: 4px;
}

.callout header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  line-height: 24px;
  font-weight: 500;
  padding: 8px 16px;
  margin: 0;
  text-transform: uppercase;
  border-radius: 4px 4px 0 0;
}

.callout p {
  padding: 16px;
  margin: 0;
  font-size: 14px;
}

.callout > :not(:first-child) {
  padding: 12px 24px;
}

.callout-list {
  margin: 10px;
  max-height: 20vh;
  overflow-y: auto;
  list-style-position: outside;
}

.callout-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
  padding: 5px;
  background: rgba(25, 118, 210, 0.2);
}

.callout.is-critical {
  border-color: #dd0031;
  background: rgba(221, 0, 49, 0.05);
}

.callout.is-critical header {
  background: #dd0031;
}

.callout.is-important {
  border-color: #ff9800;
  background: rgba(255, 152, 0, 0.05);
}

.callout.is-important header {
  background: #ffa000;
}

.callout.is-helpful {
  border-color: #1976d2;
  background: rgba(25, 118, 210, 0.05);
}

.callout.is-helpful header {
  background: #1976d2;
}
