/**
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// mixins and config
@use '@material/card/_index' as card;
@use '@material/tab/_index' as tab with (
  $height: 40px
);
@use '@material/tab-indicator/_index' as tab-indicator;
@use '@material/dialog/_index' as dialog;
@use '@material/ripple/_index' as ripple;
@use '@material/elevation/_index' as elevation;

// style imports
@import '@material/card/dist/mdc.card';
@import '@material/dialog/dist/mdc.dialog';
@import '@material/tab/dist/mdc.tab';
@import '@material/tab-bar/dist/mdc.tab-bar';
@import '@material/tab-scroller/dist/mdc.tab-scroller';
@import '@material/tab-indicator/dist/mdc.tab-indicator';

@import '/src/components/common/material-components';
@import '/src/components/common/material-overrides-buttons';
@import '/src/components/common/material-overrides-inputs';

@import '/src/components/common/radius';

.mdc-card {
  @include card.shape-radius($BORDER_RADIUS_CARD);
}

.mdc-dialog {
  @include dialog.shape-radius($BORDER_RADIUS_DIALOG);
}

.mdc-dialog__actions {
  // Dialog actions assume using unfilled button, but we always fill them.
  padding: 20px 24px;
}

.mdc-radio
  .mdc-radio__native-control:enabled
  + .mdc-radio__background
  .mdc-radio__inner-circle,
.mdc-radio
  .mdc-radio__native-control:enabled:checked
  + .mdc-radio__background
  .mdc-radio__outer-circle {
  border-color: var(--mdc-theme-primary);
}

:not(.mdc-list--non-interactive) {
  > .mdc-list-item:not(.mdc-list-item--disabled) {
    &::before,
    &::after {
      // colored hover instead of gray
      background-color: var(--mdc-theme-primary);
    }
  }
}

// TODO: Use text-transform mixins once RMWC updates to @material/tabs v4.0+
// https://github.com/material-components/material-components-web/commit/22d7ad2fb1796fbd71a3a5ee9c7ab2e77c60e34e
.mdc-tab {
  @include tab.horizontal-padding(5px);
  text-transform: none;
}

.mdc-tab-indicator {
  @include tab-indicator.underline-height(3px);
  @include tab-indicator.underline-top-corner-radius(2px);
}

.mdc-dialog {
  @include dialog.container-fill-color(#fafafa);

  .mdc-dialog__surface {
    @include elevation.elevation(9);
  }
}

.material-icons {
  font-family: 'Material Icons Extended';
}
