@import "../../scss/variables.scss";

.popup {
  :global {
    .popup-container {
      width: 26.25rem;
      background: var(--light-filled-secondary-text-color);
      margin-top: 3.625rem;
      height: calc(100vh - 6.5rem);
      transition: var(--transition-standard-out);
      transition-property: height, margin-top, max-height;
      padding: 0;
      overflow: visible;
      border-radius: 14px;
      max-height: 100%;
    }

    .tabs-container, .tabs-tab {
      height: 100%;
      overflow: hidden;
      border-radius: 14px;
    }
  }

  overflow: visible;
}

:global(.popup-container).isChosenGift  {
  margin-top: 0rem;
  height: calc(100vh - 2.875rem);
  max-height: 800px;
}

.mainContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity var(--transition-standard-in), transform var(--transition-standard-in);
  border-radius: 14px;
}

.mainHeader {
  position: sticky;
  top: 0;
  width: 100%;
  padding: 0.5rem;
  z-index: 3;
  transition: background var(--transition-standard-in), border-color var(--transition-standard-in);
  border-bottom: 1px solid transparent;
  display: flex;
  align-items: center;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  
  :global(.popup-title) {
    margin-left: 1.5rem;
    opacity: 0;
    transform: translateX(1rem);
    transition: opacity var(--transition-standard-in), transform var(--transition-standard-in);
  }

  .isScrolled & {
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);

    :global(.popup-title) {
      opacity: 1;
      transform: translateX(0);
    }
  }
}


.recipientAvatar {
  margin-top: -1.5625rem;
  position: relative;

  :global(.avatar) {
    z-index: 1;
    position: relative;
  }
}

.recipientBackground {
  position: absolute;
  height: 6.75rem;
  top: -0.25rem;
  transform: translate(-3rem);
}

.mainTitle {
  margin-top: 0.75rem;
  font-weight: 500;
  font-size: 24px;
  line-height: 32px;
  text-align: center;
}

.mainSubtitle {
  margin-top: 0.375rem;
  margin-bottom: 0.625rem;
  font-weight: 400;
  font-size: 16px;
  line-height: 22px;
  text-align: center;
  text-wrap: balance;
}

.premiumOptionsContainer {
  margin-block: 0.375rem;
  display: flex;
  flex-direction: row;
  gap: 0.625rem;
  display: flex;
  flex-direction: row;
  width: 100%;
  padding-inline: 1rem;
}

.premiumOption {
  width: 100%;
  padding: 0.25rem 0.625rem 0.625rem;
  gap: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  border-radius: 0.625rem;
  cursor: pointer;
  background-color: var(--surface-color);

  &Sticker {
    width: 84px;
    height: 84px;
    position: relative;
  }

  &Title {
    margin-top: 0.375rem;
    font-size: var(--font-size-15);
    line-height: 1.25;
    font-weight: 600;
    z-index: 1;
  }

  &Subtitle {
    font-size: var(--font-size-13);
    line-height: 11px;
    font-weight: 400;
    z-index: 1;
  }

  &Price {
    margin-top: 0.8125rem;
    color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.1);
    border-radius: 9999px;
    padding: 0.625rem 0.75rem;
    font-size: 11px;
    line-height: 10px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 1;
  }

  &PriceStars {
    margin-top: 0.625rem;
    font-size: 11px;
    line-height: 13px;
    color: #D3720A;
    display: flex;
    align-items: center;
    flex-direction: row;
    z-index: 1;

    :global(.currency-star-icon) {
      width: 0.625rem;
      height: 0.625rem;
    }

    &Inner {
      display: flex;
      align-items: center;
      flex-direction: row;
      margin-left: 0.25rem;
      font-weight: 600;
      gap: 0.125rem;
    }
  }

  & &Badge {
    background: linear-gradient(343.43deg, #5981FE -16.38%, #F863D2 112.93%);
  }
  
  & &BadgeText {
    font-size: 11px;
    font-weight: 600;
  }
}

.categoriesContainer {
  position: sticky;
  top: 3.5rem;
  width: 100%;
  transition: background-color var(--transition-standard-in), border-bottom-color var(--transition-standard-in);
  border-bottom-color: transparent;
  z-index: 3;
  flex-shrink: 0;
  height: 2.5rem;

  &.isPinned {
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
  }

  :global(.scrollable) {
    display: flex;
    flex-direction: row;
    gap: 0.1875rem;
    padding: 0.375rem 1rem; 
  }
}

.giftCategoryChip {
  padding: 0.28125rem 0.75rem;
  font-size: 14px;
  line-height: 19px;
  color: var(--secondary-text-color);
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: background-color var(--transition-standard-in);

  :global(.currency-star-icon) {
    width: 1rem;
    height: 1rem;
  }

  &.active {
    background: var(--surface-color);
  }

  .isPinned &.active {
    background: var(--light-filled-secondary-text-color);
  }
}

.giftsGridContainer {
  width: 100%;
  min-height: calc(var(--height) - 5.75rem);
  margin-top: -0.25rem;
}

.secondPageContainer {
  background: var(--light-filled-secondary-text-color);
  z-index: 2;
  transition: opacity var(--transition-standard-in), transform var(--transition-standard-in);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.secondPageBody {
  height: 100%;
  position: relative;

  .scrollable {
    display: flex;
    flex-direction: column;
  }
}

.secondPageHeader {
  display: flex;
  flex-direction: row;
  padding: 0.5rem;
  padding-right: 0.75rem;
  align-items: center;
  gap: 1.5rem;
  border-top-right-radius: 14px;
  border-top-left-radius: 14px;
  background: var(--surface-color);
}

.bubblesContainer {
  height: 22.5rem;
  overflow: hidden;
  flex-shrink: 0;
}

.formSheet {
  padding: 0.5rem;
  background-color: var(--surface-color);

  :global(.i18n) {
    display: flex;
    align-items: center;
    white-space: pre-wrap;
  
    :global(.currency-star-icon) { 
      width: 1rem;
      height: 1rem;
    }
  }
}

.limitedProgressWrap {
  padding: 0.75rem 0.5rem;
}

.limitedProgressBar {
  border-radius: 0.625rem;
  height: 1.875rem;
  background-color: var(--limit-line-empty-background);
  position: relative;
  overflow: hidden;
}

.limitedProgressProgress {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background-color: var(--primary-color);
  color: #fff;
  border-top-right-radius: 0.3125rem;
  border-bottom-right-radius: 0.3125rem;
  padding: 0.375rem 0.75rem;
}

.limitedProgressText {
  padding: 0.375rem 0.75rem;
  font-size: var(--font-size-15);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
  position: absolute;
  inset: 0;
  background-clip: text;
  color: transparent;
}

.formInput {
  margin: 0.5rem;
  --padding: 0.75rem;
  --height: 48px;
}

.formHint {
  box-shadow: inset 0px 1px 4px rgba(0, 0, 0, 0.05);
  padding: 0.5rem 1.5rem;
  font-size: var(--font-size-14);
  line-height: var(--line-height-15);
  color: var(--secondary-text-color);
}

.formSend {
  margin: 1rem;
  width: auto;
  height: 3rem;
  flex-shrink: 0;
  text-transform: uppercase;

  :global(.i18n), :global(.xtr) {
    white-space: pre-wrap;
    display: inline-flex;
    align-items: center;
  }
}

.starsBalance {
  left: 50%;
  top: -1rem;
  transform: translate(-50%, -100%);
  transition: opacity var(--transition-standard-in);
  opacity: 1;
  z-index: -1;

  .isChosenGift & {
    opacity: 0;
  }
}

.resaleHeader {
  display: flex;
  flex-direction: column;
  background: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
}

.resaleHeaderInner {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  padding: 0.5rem;
  padding-right: 0.75rem;
  align-items: center;
  gap: 1.5rem;
  border-top-right-radius: 14px;
  border-top-left-radius: 14px;
}

.resaleTitle {
  display: flex;
  flex-direction: column;
}

.resaleSubtitle {
  font-size: var(--font-size-14);
  line-height: 20px;
  font-weight: 400;
  color: var(--secondary-text-color);
}

.resaleFilters {
  position: relative;
  height: 3rem;

  :global(.scrollable) {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    padding: 0.625rem 1rem;
    gap: 0.5rem;

    @media only screen and (max-width: $small-screen) {
      justify-content: flex-start;
    }
  }
}

.resaleFilterChip {
  padding-block: 0.25rem;
  padding-inline: 0.75rem 0.5rem;
  background: var(--light-filled-secondary-text-color);
  border-radius: 9999px;
  font-size: var(--font-size-14);
  line-height: 19px;
  font-weight: 500 !important;
  color: var(--secondary-text-color);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  transition: background-color var(--transition-standard-in);
  position: relative;
  white-space: nowrap;

  :global(.tgico) {
    font-size: 1.25rem;
  }

  :global(.btn-menu) {
    margin-top: 0.5rem;
  }
}

.resaleFilterChipSort {
  padding-inline: 0.5rem 0.75rem;
}

.resaleFilterChipCount {
  color: var(--secondary-text-color);
}

.resaleFilterChipBackdrop {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(var(--backdrop-center-color) 0%, var(--backdrop-edge-color) 50%);
}

.emptyPlaceholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--secondary-text-color);

  overflow: hidden;
  text-align: center;
  overflow-wrap: break-word;
  padding-inline: 1rem;
  text-wrap: balance;

  :global(.i18n) {
    display: block;
    overflow: hidden;
  }
}

@media only screen and (max-width: $small-screen) {
  .popup {
    padding: 0;
    --popup-min-width: 100%;
    --popup-max-width: 100%;
  }

  :global(.popup-container) {
    margin-bottom: 0;
    margin-top: auto!important;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .premiumOptionsContainer, :global(.star-gifts-grid) {
    padding-inline: 0.5rem;
  }

  .resaleFilters {
    justify-content: flex-start;
  }
}