@use 'sass:map';
@use '@angular/material' as mat;

:root {
  // Google Material 3 (GM3) Design Tokens.
  --md-sys-color--on-secondary-container: #004A77;
  --md-sys-color--on-surface: #1f1f1f;
  --md-sys-color--on-surface-variant: #444746;
  --md-sys-color--outline-variant: #c4c7c5;
  --md-sys-color--primary-container: #d3e3fd;
  --md-sys-color--primary: #0b57d0;
  --md-sys-color--secondary-container: #c2e7ff;
  --md-sys-color--surface-container-highest: #dde3ea;
  --md-sys-color--surface-container-low: #f8fafd;
  --md-sys-color--surface-container: #f0f4f9;
  --md-sys-color--surface: #fff;
}

$typography-config: mat.define-typography-config();

@include mat.all-component-typographies($typography-config);
@include mat.core();
@include mat.typography-hierarchy($typography-config);

$primary: mat.define-palette(mat.$orange-palette, 600);
$accent: mat.define-palette(mat.$orange-palette, 600, 100, 700);
$warn: mat.define-palette(mat.$red-palette, 600);
$theme: mat.define-light-theme(
  (
    color: (
      primary: $primary,
      accent: $accent,
      warn: $warn,
    ),
    density: 0,
    typography: $typography-config,
  )
);

@include mat.all-component-themes($theme);
@include mat.fab-theme($theme);
@include mat.button-theme($theme);
@include mat.icon-button-theme($theme);
@include mat.card-theme($theme);
@include mat.autocomplete-theme($theme);
@include mat.core-theme($theme);
@include mat.input-theme($theme);
@include mat.form-field-theme($theme);
@include mat.checkbox-theme($theme);
@include mat.select-theme($theme);
@include mat.menu-theme($theme);
@include mat.dialog-theme($theme);
@include mat.progress-spinner-theme($theme);
@include mat.progress-bar-theme($theme);
@include mat.slide-toggle-theme(map.merge($theme, (density: -5)));
@include mat.radio-theme($theme);
@include mat.snack-bar-theme($theme);
@include mat.slider-theme($theme);
@include mat.tooltip-theme($theme);

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Roboto', sans-serif;
}

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

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

.google-chart-table-header-cell {
  word-wrap: break-word;
  background-color: #fff;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
}

.google-chart-table-table-cell {
  word-break: break-all;
  color: black;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
}

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

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

overview recommendation-result-view .bottleneck-tips li a,
overview recommendation-result-view .documentation-tips li a,
input-pipeline host-side-analysis-detail .recommendations a {
  color: mat.get-color-from-palette($primary, default);
  cursor: pointer;
  text-decoration: underline;
}

capture-profile-dialog .mat-expansion-panel-body,
input-pipeline host-side-analysis-detail .mat-expansion-panel-body {
  padding: 0;
}

sidenav mat-form-field.mat-primary .mat-form-field-infix {
  border: 1px solid #000;
  padding: 8px;
  margin-top: 8px;
}

sidenav mat-form-field.mat-focused .mat-form-field-infix {
  border: 2px solid mat.get-color-from-palette($primary, default);
  border-bottom: none;
}

sidenav mat-form-field.mat-form-field-disabled .mat-form-field-infix {
  border-style: dotted;
}

sidenav mat-form-field .mat-select-value {
  color: #777;
}

op-profile .ops-control .mat-mdc-form-field {
  text-align: center !important;
}

op-profile .ops-control .mat-slider-horizontal {
   width: 200px;
}

op-profile .control .mat-slide-toggle-bar {
  width: 45px;
  height: 18px;
}

op-profile .control .mat-slide-toggle-thumb {
  height: 25px;
  width: 25px;
}

// Angular material styles
@font-face {
  font-family: 'Material Icons';
  font-style: normal;
  font-weight: 400;
  src: url(materialicons.woff2) format('woff2');
}

.material-icons {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 300;
  src: local('Roboto Light'), local('Roboto-Light');
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  src: local('Roboto'), local('Roboto-Regular');
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 500;
  src: local('Roboto Medium'), local('Roboto-Medium');
}

// 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);
}
