@define-color cc-bg rgba(46, 46, 46, 0.7);

@define-color noti-border-color rgba(255, 255, 255, 0.15);
@define-color noti-bg rgba(48, 48, 48, 0.8);
@define-color noti-bg-opaque rgb(48, 48, 48);
@define-color noti-bg-darker rgb(38, 38, 38);
@define-color noti-bg-hover rgb(56, 56, 56);
@define-color noti-bg-hover-opaque rgb(56, 56, 56);
@define-color noti-bg-focus rgba(68, 68, 68, 0.6);
@define-color noti-close-bg rgba(255, 255, 255, 0.1);
@define-color noti-close-bg-hover rgba(255, 255, 255, 0.15);

@define-color text-color rgb(255, 255, 255);
@define-color text-color-disabled rgb(150, 150, 150);

@define-color bg-selected rgb(0, 128, 255);

$border: 1px solid #{"@noti-border-color"};
$border-radius: 12px;

$font-size-body: 15px;
$font-size-summary: 16px;

$hover-tranistion: background 0.15s ease-in-out;
$group-collapse-tranistion: opacity 400ms ease-in-out;

$notification-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3),
  0 1px 3px 1px rgba(0, 0, 0, 0.7), 0 2px 6px 2px rgba(0, 0, 0, 0.3);

.notification-row {
  outline: none;

  &:focus,
  &:hover {
    background: #{"@noti-bg-focus"};
  }
  .notification-background {
    padding: 6px 12px;

    .close-button {
      /* The notification Close Button */
      background: #{"@noti-close-bg"};
      color: #{"@text-color"};
      text-shadow: none;
      padding: 0;
      border-radius: 100%;
      $margin: 5px;
      margin-top: $margin;
      margin-right: $margin;
      box-shadow: none;
      border: none;
      min-width: 24px;
      min-height: 24px;

      &:hover {
        box-shadow: none;
        background: #{"@noti-close-bg-hover"};
        transition: $hover-tranistion;
        border: none;
      }
    }

    .notification {
      /* The actual notification */
      border-radius: $border-radius;
      border: $border;
      padding: 0;
      transition: $hover-tranistion;
      background: #{"@noti-bg"};

      &.low {
        /* Low Priority Notification */
      }
      &.normal {
        /* Normal Priority Notification */
      }
      &.critical {
        /* Critical Priority Notification */
      }

      %action {
        padding: 4px;
        margin: 0;
        box-shadow: none;
        background: transparent;
        border: none;
        color: #{"@text-color"};
        transition: $hover-tranistion;
      }
      %action-hover {
        -gtk-icon-effect: none;
        background: #{"@noti-bg-hover"};
      }

      .notification-default-action {
        /* The large action that also displays the notification summary and body */
        @extend %action;
        border-radius: $border-radius;

        &:hover {
          @extend %action-hover;
        }

        &:not(:only-child) {
          /* When alternative actions are visible */
          border-bottom-left-radius: 0px;
          border-bottom-right-radius: 0px;
        }

        .notification-content {
          background: transparent;
          border-radius: $border-radius;
          $margin: 4px;
          padding: $margin;

          .image {
            /* Notification Primary Image */
            -gtk-icon-effect: none;
            border-radius: 100px; /* Size in px */
            margin: $margin;
          }
          .app-icon {
            /* Notification app icon (only visible when the primary image is set) */
            -gtk-icon-effect: none;
            -gtk-icon-shadow: 0 1px 4px black;
            margin: 6px;
          }

          .text-box {
            .summary {
              /* Notification summary/title */
              font-size: $font-size-summary;
              font-weight: bold;
              background: transparent;
              color: #{"@text-color"};
              text-shadow: none;
            }
            .time {
              /* Notification time-ago */
              font-size: $font-size-summary;
              font-weight: bold;
              background: transparent;
              color: #{"@text-color"};
              text-shadow: none;
              margin-right: 30px;
            }
            .body {
              /* Notification body */
              font-size: $font-size-body;
              font-weight: normal;
              background: transparent;
              color: #{"@text-color"};
              text-shadow: none;
            }
          }

          progressbar {
            /* The optional notification progress bar */
            margin-top: $margin;
          }

          .body-image {
            /* The "extra" optional bottom notification image */
            margin-top: $margin;
            background-color: white;
            border-radius: $border-radius;
            -gtk-icon-effect: none;
          }

          .inline-reply {
            /* The inline reply section */
            margin-top: $margin;

            .inline-reply-entry {
              background: #{"@noti-bg-darker"};
              color: #{"@text-color"};
              caret-color: #{"@text-color"};
              border: $border;
              border-radius: $border-radius;
            }
            .inline-reply-button {
              margin-left: 4px;
              background: #{"@noti-bg"};
              border: $border;
              border-radius: $border-radius;
              color: #{"@text-color"};

              &:disabled {
                background: initial;
                color: #{"@text-color-disabled"};
                border: $border;
                border-color: transparent;
              }
              &:hover {
                background: #{"@noti-bg-hover"};
              }
            }
          }
        }
      }

      .notification-action {
        /* The alternative actions below the default action */
        @extend %action;
        border-top: $border;
        border-radius: 0px;
        border-right: $border;

        &:first-child {
          /* add bottom border radius to eliminate clipping */
          border-bottom-left-radius: $border-radius;
        }
        &:last-child {
          border-bottom-right-radius: $border-radius;
          border-right: none;
        }

        &:hover {
          @extend %action-hover;
        }
      }
    }
  }
}

.notification-group {
  /* Styling only for Grouped Notifications */

  &.low {
    /* Low Priority Group */
  }
  &.normal {
    /* Low Priority Group */
  }
  &.critical {
    /* Low Priority Group */
  }

  %header {
    margin: 0 16px;
    color: #{"@text-color"};
  }

  .notification-group-headers {
    /* Notification Group Headers */
    @extend %header;

    .notification-group-icon {
      color: #{"@text-color"};
    }
    .notification-group-header {
      color: #{"@text-color"};
    }
  }
  .notification-group-buttons {
    /* Notification Group Buttons */
    @extend %header;
  }

  &.collapsed {
    .notification-row {
      .notification {
        background-color: #{"@noti-bg-opaque"};
      }

      &:not(:last-child) {
        /* Top notification in stack */
        /* Set lower stacked notifications opacity to 0 */
        .notification-action,
        .notification-default-action {
          opacity: 0;
        }
      }
    }

    &:hover {
      .notification-row:not(:only-child) {
        .notification {
          background-color: #{"@noti-bg-hover-opaque"};
        }
      }
    }
  }
}

.control-center {
  /* The Control Center which contains the old notifications + widgets */
  background: #{"@cc-bg"};
  color: #{"@text-color"};
  border-radius: $border-radius;

  .control-center-list-placeholder {
    /* The placeholder when there are no notifications */
    opacity: 0.5;
  }

  .control-center-list {
    /* List of notifications */
    background: transparent;

    .notification {
      box-shadow: $notification-shadow;

      .notification-default-action,
      .notification-action {
        transition: $group-collapse-tranistion, $hover-tranistion;

        &:hover {
          background-color: #{"@noti-bg-hover"};
        }
      }
    }
  }
}

.blank-window {
  /* Window behind control center and on all other monitors */
  background: transparent;
}

.floating-notifications {
  background: transparent;

  .notification {
      box-shadow: none;
  }
}

/*** Widgets ***/
/* Title widget */
@import "widgets/title";
/* DND widget */
@import "widgets/dnd";
/* Label widget */
@import "widgets/label";
/* Mpris widget */
@import "widgets/mpris";
/* Buttons widget */
@import "widgets/buttons";
/* Menubar widget */
@import "widgets/menubar";
/* Volume widget */
@import "widgets/volume";
/* Backlight widget */
@import "widgets/backlight";
/* Inhibitors widget */
@import "widgets/inhibitors";
