@use '@angular/material' as mat;

@use 'src/lib/attribution-dialog/_attribution-dialog-component-theme' as
  attribution;
@use 'src/lib/information-dialog/metadata/_metadata-component-theme' as metadata;
@use 'src/lib/viewer/_viewer-component-theme' as viewer;
@use 'src/lib/content-search-dialog/_content-search-dialog-component-theme' as
  content-search-dialog;
@use 'src/lib/viewer/osd-toolbar/_osd-toolbar-component-theme' as osd-toolbar;

@mixin color($theme) {
  @include attribution.theme($theme);
  @include metadata.theme($theme);
  @include viewer.theme($theme);
  @include content-search-dialog.theme($theme);
  @include osd-toolbar.theme($theme);

  .mime-dialog {
    .mat-mdc-dialog-surface {
      background: mat.get-theme-color($theme, surface-container-high);
    }
  }

  .viewer-container,
  .mime-dialog {
    a {
      color: mat.get-theme-color($theme, primary);
    }

    .secondary-toolbar {
      @if mat.get-theme-type($theme) == dark {
        background: mat.get-theme-color($theme, surface-container);
        color: mat.get-theme-color($theme, on-surface);
      } @else {
        background: mat.get-theme-color($theme, secondary-container);
        color: mat.get-theme-color($theme, on-secondary-container);
      }
    }
  }

  .mime-mobile-dialog {
    .mat-mdc-dialog-surface {
      border-radius: unset;
    }
    max-width: 100% !important;
  }
}

@mixin typography($theme) {
}

@mixin theme($theme) {
  @if mat.theme-has($theme, color) {
    @include color($theme);
  }

  @if mat.theme-has($theme, typography) {
    @include typography($theme);
  }
}
