@import '~@capillarytech/cap-ui-library/styles/_variables';

/**
 * Android (Mobile) + Chrome Notification Styles
 */

.notification-container.android-mobile-chrome {
  background-color: $CAP_WHITE;
  border: 1px solid $CAP_G08;
  border-radius: 12px;
  padding: 12px;
  box-sizing: border-box;

  &.collapsed {
    width: 326px;
    height: 78px;

    .notification-header {
      display: flex;
      gap: 12px;
      height: 100%;
    }

    .notification-header.android-mobile-chrome-header {
      align-items: center;
    }

    .notification-icon-container {
      width: 28px;
      height: 28px;
      padding: 2px;
      border-radius: 50%;
    }

    .android-mobile-chrome-content {
      display: flex;
      flex-direction: column;
      gap: 4px;
      min-width: 0;

      .notification-title-row {
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 0;

        .notification-title {
          font-weight: 600;
          font-size: $FONT_SIZE_S;
          color: $FONT_COLOR_01;
          margin: 0;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
          flex: 1;
          min-width: 0;
        }

        .notification-time {
          font-size: $FONT_SIZE_S;
          color: $CAP_G05;
          flex-shrink: 0;
        }
      }

      .notification-body {
        font-size: $FONT_SIZE_S;
        color: $FONT_COLOR_01;
        margin: 0;
        line-height: 1.2;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
      }

      .notification-url {
        display: none;
      }
    }

    .notification-right-rail {
      display: flex;
      gap: 8px;
      margin-left: 8px;
      flex-shrink: 0;

      .android-mobile-chrome-brand-icon {
        width: 30px;
        height: 30px;
        padding: 0;
        background-color: transparent;
        display: flex;
        align-items: center;
        justify-content: center;

        .notification-brand-icon {
          width: 100%;
          height: 100%;
          object-fit: cover;
          border-radius: 4px;
        }
      }

      .android-mobile-chrome-arrow {
        font-size: 5.92px;
        color: $CAP_G05;
        line-height: 1;
        margin-top: 0;
        padding-top: 0;
        display: flex;
        align-items: center;
        justify-content: center;

        .android-mobile-chrome-arrow-icon {
          height: 5.92px;
          width: auto;
          display: block;
        }
      }
    }
  }

  &.expanded {
    width: 326px;
    min-height: 78px;
    padding: 12px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    position: relative;

    // Browser icon as separate column, aligned to top
    .android-mobile-expanded-icon {
      padding: 2px;
      border-radius: 50%;
      flex-shrink: 0;
      align-self: flex-start;

      .notification-icon-container {
        width: 16px;
        height: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
      }

      .notification-icon {
        width: 16px;
        height: 16px;
      }
    }

    .android-mobile-expanded-wrapper {
      display: flex;
      flex-direction: column;
      gap: 12px;
      flex: 1;
      min-width: 0;
    }

    .android-mobile-expanded-top {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      width: 100%;
    }

    .android-mobile-expanded-top-content {
      display: flex;
      flex-direction: column;
      gap: 8px;
      flex: 1;
      min-width: 0;
    }

    .android-mobile-expanded-title {
      font-weight: 600;
      font-size: $FONT_SIZE_S;
      color: $FONT_COLOR_01;
      margin: 0;
      line-height: 1.2;
      word-break: break-word;
    }

    // Top container: Browser name, URL, time (all inline) | Brand icon
    .android-mobile-expanded-header {
      display: flex;
      align-items: center;
      gap: 12px;
      width: 100%;

      .android-mobile-expanded-header-content {
        display: flex;
        align-items: center;
        gap: 6px;
        flex: 1;
        min-width: 0;
        font-family: Roboto, sans-serif;
        font-size: 10px;
        line-height: 13px;
        letter-spacing: 0;
        overflow: hidden;

        .android-mobile-expanded-browser-name {
          font-weight: 400;
          color: $CAP_G04;
          flex-shrink: 0;
        }

        .android-mobile-expanded-domain-time {
          display: inline-flex;
          align-items: center;
          gap: 6px;
          min-width: 0;
          overflow: hidden;

          .android-mobile-expanded-domain {
            color: $CAP_G04;
            font-weight: 400;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
          }

          .android-mobile-expanded-time {
            color: $CAP_G04;
            font-weight: 400;
            flex-shrink: 0;
          }
        }
      }
    }

    .android-mobile-chrome-brand-icon {
      width: 34.288px;
      height: 34.288px;
      padding: 0;
      background-color: transparent;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;

      .notification-brand-icon {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 4.576px;
      }
    }

    // Arrow icon positioned as sibling to wrapper
    .android-mobile-expanded-arrow {
      font-size: 5.92px;
      color: $CAP_G05;
      line-height: 1;
      flex-shrink: 0;
      align-self: flex-start;
      margin-top: 10px;
      display: flex;
      align-items: center;
      justify-content: center;

      .android-mobile-expanded-arrow-icon {
        height: 5.92px;
        width: auto;
        display: block;
      }
    }

    // Body container: body text, media
    .android-mobile-expanded-body {
      display: flex;
      flex-direction: column;
      gap: 8px;
      width: 100%;

      // Body text (limited to 4 lines)
      .android-mobile-expanded-body-text {
        font-size: $FONT_SIZE_S;
        color: $FONT_COLOR_01;
        margin: 0;
        line-height: 1.4;
        word-break: break-word;
        
        // Limit notification body to 4 lines with ellipsis
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 4;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      // Media image at bottom (if visible)
      .android-mobile-expanded-media {
        width: 100%;
        margin-top: 4px;
        border-radius: 8px;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;

        .android-mobile-expanded-media-image {
          width: 100%;
          max-width: 100%;
          height: 192px; // Fixed height limit
          object-fit: cover; // Ensures image covers the area without distortion
          object-position: center; // Centers the image
          display: block;
          box-sizing: border-box;
        }
      }
    }

    // CTA buttons container - direct child of notification-container, below the three vertical components
    .android-mobile-expanded-cta-container {
      display: flex;
      align-items: center;
      width: 100%;
      flex-basis: 100%;
      box-sizing: border-box;
      padding-top: 9.6px;
      margin-left: 0;
      margin-right: 0;
    }

    .android-mobile-expanded-cta-divider {
      width: 1px;
      height: 100%;
      background-color: $CAP_G07; // #DFE2E7
      flex-shrink: 0;
      align-self: stretch;
    }

    .android-mobile-expanded-cta-button {
      flex: 1;
      background: transparent;
      border: none;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      min-width: 0;
      box-sizing: border-box;

      &.android-mobile-expanded-cta-button-single {
        flex: 1;
        width: 100%;
      }

      .android-mobile-expanded-cta-button-text {
        font-family: $FONT_FAMILY; // Roboto
        font-weight: $FONT_WEIGHT_MEDIUM; // 500
        font-size: $FONT_SIZE_S; // 12px
        line-height: 16px;
        color: $FONT_COLOR_01; // #091E42
        letter-spacing: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
      }
    }
  }
}

