@import '../../styles/helper.scss';
@import '../../styles/dialog.scss';

// How to use : https://tomastrajan.medium.com/the-complete-guide-to-angular-material-themes-4d165a9d24d1
@mixin cfar-offer-dialog-theme($theme) {
  // Colors used for element backgrounds
  $bg-palette: map-get($theme, background);

  // Colors used for texts and icons
  $fg-palette: map-get($theme, foreground);

  // Main color most widely used across all screens and components
  $primary-palette: map-get($theme, primary);

  // Also known as the secondary color. Used for floating action buttons and interactive elements.
  $accent-palette: map-get($theme, accent);

  // Color to convey error state
  $warn-palette: map-get($theme, warn);

  // If it's dark theme or not
  $is-dark: map-get($theme, is-dark);

  // ----------------------------------------------

  hopper-cfar-offer-dialog {
    .mat-mdc-button,
    .mat-mdc-unelevated-button,
    .mat-mdc-icon-button,
    .mat-mdc-raised-button,
    .mat-mdc-outlined-button {
      border-radius: 0px;
    }

    .mat-mdc-dialog-title {
      background-color: map-get($primary-palette, 900);
      color: map-get($primary-palette, '900-contrast');
      margin: 0px;

      .provided-by-container {
        height: 0px;

        .provided-by-image {
          margin-top: 20px;
          background: white;
          position: relative;
          padding: 4px 16px;
          border-radius: 16px;
        }
      }
    }

    .mat-mdc-dialog-content {
      @if ($is-dark) {
        background-color: rgb(52, 52, 52);
      } @else {
        background-color: rgb(255, 255, 255);
      }

      .check-icon {
        font-weight: bold;
        color: green;
        font-size: 1.5rem;
        height: 1.5rem;
        min-width: 1.5rem;
        width: 1.5rem;
      }

      .text-justify {
        text-align: justify;
      }

      .error-message {
        background: map-get($warn-palette, 50);
        border: 1px solid map-get($warn-palette, default);
        padding: 0px 16px;
        color: black;
      }

      a {
        color: map-get($accent-palette, default);
      }

      .mat-mdc-card {
        color: map-get($fg-palette, default);
        border-radius: 0px;
        cursor: pointer;
        @include mat.elevation(4);

        &:hover {
          @include mat.elevation(6);
        }

        &.active {
          border: 2px solid map-get($accent-palette, default);
        }

        .offer-title {
          font-weight: bold;
        }

        .price {
          font-style: bold;
          color: map-get($fg-palette, 'secondary-text');
        }

        .price-per-traveler {
          font-weight: bold;
          margin-right: 8px;
        }

        .incl-taxes {
          color: map-get($fg-palette, 'secondary-text');
        }
      }
    }

    .mat-mdc-dialog-actions {
      @if ($is-dark) {
        background-color: rgb(52, 52, 52);
      } @else {
        background-color: rgb(255, 255, 255);
      }

      .mat-mdc-button-base + .mat-button-base,
      .mat-mdc-button-base + .mat-mdc-button-base {
        margin: 0px;
      }
    }
  }
}
