// Gateway Health Dashboard Styles
.arraysubs-gateway-health {
  padding: 20px;

  // ── Gateway Cards ────────────────────────────────
  &__cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
    margin-bottom: 30px;

    @media (max-width: 782px) {
      grid-template-columns: 1fr;
    }
  }

  &__empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;

    svg {
      color: #ccc;
      margin-bottom: 16px;
    }

    p {
      font-size: 14px;
      max-width: 400px;
      margin: 0 auto;
    }
  }

  &__card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    overflow: hidden;

    &--disabled {
      opacity: 0.7;
    }
  }

  &__card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f9f9f9;
    border-bottom: 1px solid #ccd0d4;
  }

  &__card-title {
    display: flex;
    align-items: center;
    gap: 8px;

    h3 {
      margin: 0;
      font-size: 15px;
      font-weight: 600;
    }
  }

  &__card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: #eee;
    border-bottom: 1px solid #ccd0d4;
  }

  &__card-details {
    padding: 16px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  // ── Webhook Event Log ────────────────────────────
  &__log {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    overflow: hidden;
  }

  &__log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f9f9f9;
    border-bottom: 1px solid #ccd0d4;

    h3 {
      display: flex;
      align-items: center;
      gap: 8px;
      margin: 0;
      font-size: 15px;
      font-weight: 600;
    }
  }

  &__log-controls {
    display: flex;
    align-items: center;
    gap: 8px;

    // Match the 30px height across selects + refresh button. WP 7.0's
    // input/select default min-height is 40px and button-small is 24px,
    // which left a visible step between filters and the Refresh button.
    select {
      min-height: 30px;
      line-height: 1.5;
      padding: 0 24px 0 8px;
    }

    .button,
    .button.button-small {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      min-height: 30px;
      line-height: 2;
      padding: 0 10px;
      font-size: 13px;
    }
  }

  &__log-body {
    padding: 0;

    table {
      margin: 0;
    }

    .arraysubs-loading {
      padding: 40px 20px;
      text-align: center;
      color: #666;
    }
  }

  &__log-empty {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    margin: 0;
  }

  &__log-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid #eee;

    span {
      font-size: 13px;
      color: #555;
    }
  }

  &__log-footer {
    padding: 8px 16px;
    font-size: 12px;
    color: #999;
    border-top: 1px solid #eee;
    text-align: right;
  }
}

// ── Gateway Stat Items ─────────────────────────────
.arraysubs-gw-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: #fff;

  &__label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.3px;
  }

  &__value {
    font-size: 13px;
    color: #333;

    &--number {
      font-size: 20px;
      font-weight: 700;
      color: #1e1e1e;
    }
  }
}

// ── Gateway Status Icons ───────────────────────────
.arraysubs-gw-icon {
  &--ok {
    color: #28a745;
  }

  &--warning {
    color: #d68910;
  }

  &--disabled {
    color: #999;
  }
}

// ── Test Mode Badge ────────────────────────────────
.arraysubs-gw-test-badge {
  display: inline-block;
  padding: 1px 6px;
  background: #fff3cd;
  color: #856404;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

// ── Gateway Description ────────────────────────────
.arraysubs-gw-description {
  font-size: 13px;
  color: #666;
  margin: 0;
}

// ── Webhook URL Display ────────────────────────────
.arraysubs-gw-webhook-url {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;

  strong {
    font-size: 12px;
    color: #555;
  }

  code {
    display: block;
    padding: 8px 10px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
    word-break: break-all;
    color: #333;
  }
}

.arraysubs-gw-stripe-health {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

.arraysubs-gw-health-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;

  strong {
    font-size: 12px;
    color: #555;
  }
}

.arraysubs-gw-config-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;

  &--ok {
    background: #e7f7ed;
    color: #0a6b2b;
  }

  &--warning {
    background: #fff3cd;
    color: #856404;
  }
}

// ── Capability Tags ────────────────────────────────
.arraysubs-gw-capabilities {
  display: flex;
  flex-direction: column;
  gap: 6px;

  strong {
    font-size: 12px;
    color: #555;
  }
}

.arraysubs-gw-capability-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.arraysubs-gw-capability-tag {
  display: inline-block;
  padding: 2px 8px;
  background: #e7f3ff;
  color: var(--arraysubs-fb-primary-color, #0073aa);
  border-radius: 3px;
  font-size: 11px;
  text-transform: capitalize;
}

// ── Gateway Actions Row ────────────────────────────
.arraysubs-gw-actions {
  display: flex;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid #eee;

  .button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
}

// ── Webhook Log Table Elements ─────────────────────
.arraysubs-gw-slug-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #f0f0f0;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
  text-transform: capitalize;
}

.arraysubs-gw-event-id {
  font-size: 11px;
  word-break: break-all;
}

.arraysubs-gw-filter-select {
  min-width: 150px;
  font-size: 13px;
}
