/* Store Credit My Account Styles */

// Balance Card
.arraysubs-store-credit-balance {
  background: #212121;
  color: #fff;
  padding: 30px;
  border-radius: $radius-sm;
  margin-bottom: 30px;
  text-align: center;

  &__label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: $spacing-xs;
  }

  &__amount {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
  }

  &__actions {
    margin-top: 15px;
  }
}

// Buy Credit Button
.arraysubs-buy-credit-btn {
  background: rgba(255, 255, 255, 0.2) !important;
  border: 2px solid rgba(255, 255, 255, 0.5) !important;
  color: #fff !important;
  padding: $spacing-sm 20px !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;

  &:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    border-color: #fff !important;
  }
}

// Expiring Credits Warning
.arraysubs-store-credit-expiring {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: $radius-md;
  padding: 15px 20px;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 12px;

  &__icon {
    font-size: 20px;
  }

  &__text {
    color: #856404;
    font-size: 14px;
  }

  &__amount {
    font-weight: 600;
  }
}

// Purchase Section
.arraysubs-store-credit-purchase {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: $radius-md;
  padding: 20px;
  margin-bottom: 20px;

  h3 {
    margin: 0 0 $spacing-sm;
    font-size: 18px;
    font-weight: 600;
  }

  .description {
    margin: 0 0 20px;
    color: #666;
    font-size: 14px;
  }
}

// Credit Products Grid
.arraysubs-credit-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
}

.arraysubs-credit-product {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: $radius-md;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: box-shadow 0.2s ease;

  &:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  &__name {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 600;
  }

  &__amount {
    font-size: 24px;
    font-weight: 700;
    color: #2271b1;
    margin-bottom: 10px;
  }

  &__bonus {
    margin-bottom: 10px;

    .bonus-badge {
      display: inline-block;
      background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
      color: #fff;
      padding: $spacing-xxs 10px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 600;
    }
  }

  &__price {
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
  }

  &__action {
    margin-top: auto;

    .button {
      width: 100%;
      text-align: center;
    }
  }

  &--custom {
    background: linear-gradient(135deg, #f0f6fc 0%, #e8f4f8 100%);
    border-color: #2271b1;
  }
}

// Custom Credit Form
.arraysubs-custom-credit-form {
  width: 100%;

  .button {
    width: 100%;
  }
}

.arraysubs-custom-credit-input {
  display: flex;
  align-items: center;
  margin-bottom: $spacing-sm;

  .currency-symbol {
    background: #e0e0e0;
    padding: $spacing-sm 12px;
    border: 1px solid #ccc;
    border-right: none;
    border-radius: $radius-sm 0 0 $radius-sm;
    font-weight: 600;
    color: #333;
  }

  input {
    flex: 1;
    padding: $spacing-sm 12px;
    border: 1px solid #ccc;
    border-radius: 0 $radius-sm $radius-sm 0;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    box-sizing: border-box;

    &:focus {
      border-color: #2271b1;
      outline: none;
      box-shadow: 0 0 0 1px #2271b1;
    }
  }
}

.arraysubs-custom-credit-limits {
  font-size: 11px;
  color: #666;
  margin: 0 0 12px;
  text-align: center;
}

// History Section
.arraysubs-store-credit-history {
  margin-top: 20px;

  &__title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
  }
}

// Credit Table
.arraysubs-credit-table-wrapper {
  border-radius: $radius-sm;
  border: 1px solid #e0e0e0;
}

.arraysubs-credit-table {
  width: 100% !important;
  overflow: hidden;
  border-collapse: collapse;

  th,
  td {
    padding: 12px 15px !important;
    text-align: left;
    border-bottom: 1px solid #eee;
  }

  th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: #666;
  }
}

// Credit Amount Colors
.arraysubs-credit-amount {
  &--credit {
    color: #28a745;
    font-weight: 600;
  }

  &--debit {
    color: #dc3545;
    font-weight: 600;
  }
}

// Credit Source Badges
.arraysubs-credit-source {
  display: inline-block;
  padding: 6px $spacing-sm;
  line-height: 1;
  border-radius: 3px;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 500;

  &--refund {
    background: #e3f2fd;
    color: #1976d2;
  }

  &--admin {
    background: #f3e5f5;
    color: #7b1fa2;
  }

  &--subscription {
    background: #e8f5e9;
    color: #388e3c;
  }

  &--order {
    background: #fff3e0;
    color: #f57c00;
  }

  &--purchase {
    background: #fce4ec;
    color: #c2185b;
  }

  &--expiration {
    background: #ffebee;
    color: #c62828;
  }
}

// Credit Expiry
.arraysubs-credit-expires {
  font-size: 12px;
  color: #666;

  &--soon {
    color: #dc3545;
    font-weight: 500;
  }
}

// Empty State
.arraysubs-credit-empty {
  text-align: center;
  padding: 40px;
  color: #666;
}

// Pagination
.arraysubs-credit-pagination {
  margin-top: 20px;
  text-align: center;
}

// Responsive
@media (max-width: 768px) {
  .arraysubs-store-credit-balance {
    padding: 20px !important;

    &__amount {
      font-size: 32px !important;
    }
  }

  .arraysubs-credit-table {
    th,
    td {
      padding: 10px !important;
      font-size: 13px;
    }
  }

  .arraysubs-credit-products {
    grid-template-columns: 1fr;
  }
}
