@import './_base.scss';
@import './_fonts.scss';

@import './components/_logo.scss';
@import './components/_container.scss';
@import './components/_dropbox.scss';
@import './components/_loader.scss';
@import './components/_info_timer.scss';
@import './components/_payment_status.scss';
@import './components/_copy.scss';
@import './components/_underpayment.scss';
@import './components/_instruction.scss';
@import './components/_cancel.scss';
@import './components/_qr-alternatives.scss';

@import './components/_rate.scss';
@import './components/_payment.scss';
@import './components/_payment-waiting.scss';
@import './components/_wallet-connect.scss';
@import './components/_payer.scss';
@import './components/_dob_input.scss';
@import './components/_select_input.scss';

body.ForumPayPaymentGatewayWidgetBody {
  #checkout.checkout-container {
    display: none;
  }
}

.forumpay-pgw {
  * {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    outline: none!important;
  }

  *:before, *:after {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    outline: none!important;
  }
  font-family: "Be Vietnam", sans-serif !important;
  font-size: 14px;
  min-width: 320px;
  min-height: 500px;
  position: relative;
  box-sizing: border-box;
  line-height: normal;

  &-content {
    min-width: 200px;
    max-width: 370px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 30px;
  }

  &-center {
    min-height: 200px;
    min-width: 200px;
    max-width: 330px;
    margin: 0 auto;
    margin-top: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 30px;
    box-sizing: content-box !important;
  }

  &-guide-text {
    font-weight: 400;
    margin: 0;
    text-align: center;

    &-align-start {
      text-align: start;
    }

    &-padding-bottom {
      padding-bottom: 10px;
    }

    &-thin-font-weight {
      font-weight: 300;
      font-size: 13px;
      color: black;
      line-height: 26px;

      b {
        font-weight: bold;
      }
    }

    &-alert {
      color: var(--pgw-color-danger-1);
      margin-bottom: 16px;
    }

    &-font-size-medium {
      font-size: medium;
    }
  }

  input {
    background-color: var(--pgw-color-gray-3);
    display: block;
    margin-bottom: 0;
    width: 100%;
    font-size: 12px;
    padding-top: 11px;
    padding-bottom: 16px;
    padding-left: 20px;
    border-radius: 10px;
    border-style: none;
    height: 36px;
    min-height: 36px;
    max-height: 36px;
    font-family: "Be Vietnam", sans-serif;
    font-weight: 500;
  }

  &-horizontal-list {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    padding-top: 13px;
    font-family: "Be Vietnam", sans-serif;
    font-weight: 600;

    button {
      height: 48px;
    }

    .forumpay-pgw-button {
      flex: 0 1 auto;
      transform: scale(0.95);
    }

    .forumpay-pgw-button:first-child {
      flex: 1;
      margin-right: 19px;
    }

    .forumpay-pgw-button:last-child {
      flex: 2;
    }
  }

  &-button {
    background-color: var(--pgw-color-primary);
    color: var(--pgw-color-black);
    font-weight: 600;
    border-radius: 3px;
    padding: 8px 16px;
    height: 37px;
    cursor: pointer;
    border: none;
    margin: 0 auto;
    text-decoration: none;
    font-size: 13px;
    line-height: 1;

    &:hover {
      border: 0;
    }

    &--cancel {
      color: var(--pgw-color-white);
      background-color: var(--pgw-color-danger-1);
      &:hover {
        opacity: .5;
      }
    }

    &--outline {
      color: var(--pgw-color-black) !important;
      background-color: var(--pgw-color-white) !important;
      border: 1px solid var(--pgw-color-gray-4);
      border-radius: var(--pgw-default-radius-1);
      padding: 11px 16px;
      letter-spacing: 0;
      font-weight: 600;
      white-space: pre-line;
      outline: none;

      &:hover {
        color: var(--pgw-color-black) !important;
        background-color: var(--pgw-color-white) !important;
        border: 1px solid var(--pgw-color-gray-4);
      }

      &:focus {
        outline: none;
        box-shadow: none;
      }

      &:active {
        outline: none;
      }
    }

    &:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }

    &--warning {
      color: var(--pgw-color-secondary);
      background-color: var(--pgw-color-primary);

      &:hover {
        color: var(--pgw-color-text-primary);
        background-color: var(--pgw-color-primary);
        border: 0;
      }
    }
  }
  ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  hr {
    box-sizing: content-box;
    height: 1px;
    overflow: visible;
    border: 0;
    border-top: 1px solid #eee;
    opacity: 1!important;
  }

  // Slide transitions
  .slide-forward-enter-active,
  .slide-forward-leave-active,
  .slide-backward-enter-active,
  .slide-backward-leave-active {
    transition: all 0.3s ease;
  }

  .slide-forward-enter-from {
    transform: translateX(100%);
    opacity: 0;
  }

  .slide-forward-leave-to {
    transform: translateX(-100%);
    opacity: 0;
  }

  .slide-backward-enter-from {
    transform: translateX(-100%);
    opacity: 0;
  }

  .slide-backward-leave-to {
    transform: translateX(100%);
    opacity: 0;
  }

  .fade-enter-active,
  .fade-leave-active {
    transition: opacity 0.3s ease;
  }

  .fade-enter-from,
  .fade-leave-to {
    opacity: 0;
  }

  // CMS override fixes - ensure consistent styling across all platforms
  // These rules use !important only where CMS themes commonly override

  // Fix form group styling - remove CMS grid layout interference
  .form-group,
  .form-control-label {
    display: block !important;
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    padding: 0 !important;
    margin: 0 !important;
    text-align: left !important;
  }

  // Fix any row/col issues from CMS grid systems
  .row {
    margin: 0 !important;
    display: block !important;
  }

  [class*="col-"] {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
  }

  // Hide CMS-specific elements that might interfere
  .help-block,
  .form-control-comment {
    display: none !important;
  }

  // Fix general input styling within the widget
  input[type="text"],
  input[type="email"],
  input[type="date"],
  input[type="number"] {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    box-shadow: none !important;
  }

  // Fix select/dropdown styling
  select {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
  }

  // Fix label styling
  label {
    text-align: left !important;
    float: none !important;
    width: 100% !important;
    display: block !important;
    padding: 0 !important;
    margin-bottom: 0!important;
  }

  // Network selection items - ensure proper layout
  &-network-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  &-network-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    padding: 11px !important;
    background-color: var(--pgw-color-background-secondary);
    border-radius: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    text-decoration: none !important;
    box-shadow: none !important;

    &:hover {
      background-color: var(--pgw-color-background-tertiary);
      text-decoration: none !important;
    }

    &.selected {
      background-color: var(--pgw-color-background-tertiary);
      border: 1px solid var(--pgw-color-primary);
    }

    &-icon {
      margin-right: 8px;
      flex-shrink: 0;
      width: 40px;

      img {
        width: auto;
        height: 30px;
        max-width: 40px !important;
        max-height: 30px !important;
      }
    }

    &-details {
      flex: 1;
      display: flex !important;
      flex-direction: column !important;
    }

    &-name {
      font-weight: 500;
      font-size: 14px;
      color: var(--pgw-color-text-primary);
      margin-bottom: 2px;
    }

    &-info {
      display: flex !important;
      justify-content: space-between !important;
      align-items: center !important;
      font-size: 11px;
      padding-top: 2px;
    }

    &-amount,
    &-wait-time {
      color: var(--pgw-color-gray-2);
    }
  }

  &-network-tag {
    white-space: nowrap;
    background-color: black;
    border-radius: 9999px;
    color: white;
    padding: 3px 13px;
    font-size: 11px;
    font-weight: 600;
  }

  &-network-title {
    font-weight: 800;
    font-size: 18px;
    margin: 0 0 10px 0;
    color: var(--pgw-color-text-primary);
  }

  &-network-subtitle {
    font-size: 11px;
    color: var(--pgw-color-gray-2);
    margin: 0;
    font-weight: 500;
  }

  // QR code protection - ensure proper sizing
  .qr,
  [class*="qr"] {
    img {
      width: 100%;
      height: auto;
      max-width: 180px;
      max-height: 180px;
    }
  }

  // Currency icon in headers - constrain size (but not QR codes)
  &-network > &-container > div[style*="flex-wrap"] img:not([class*="qr"] img) {
    max-width: 30px !important;
    max-height: 30px !important;
  }

  &-payment_status-list {
    text-align: center;
  }
}
